-
11 May 2012 10:14 AM #1
Unanswered: consume a web service with sencha touch 1
Unanswered: consume a web service with sencha touch 1
SALAM,
I want to consume a web service with sencha touch, here is my code but it doesnt work
the result of the web service is
{"Id":10,"NAME":"zied"}
how can i fix this. thank youuuCode:var App = new Ext.Application({ name: 'webservice', useLoadMask: true, launch: function () { webservice.views.service = new Ext.Ajax.request({ id: 'show', items: [{ xtype: 'panel', id: 'JSONP', url :'http://localhost:8732/Service1/data/10', success : function(response) { var user.Name = eval('('+ response.responseText+ ')'); } }] }); webservice.views.form = new Ext.extend(Ext.Panel, { scroll: 'vertical', items: [{ xtype: 'form', id: 'form', fullscreen: true, cls : 'form', items: [ { xtype: 'textfield', name : 'first', id: 'Nom', placeHolder: 'Nom', }, { xtype: 'button', flex: 1, margin: 10, text: 'Envoyer', handler: function() { Ext.getCmp('Nom').setValue(webservice.views.service.user); } } ] }] }); webservice.views.Viewport = new Ext.Panel({ fullscreen: true, layout: 'card', cardAnimation: 'slide', items: [webservice.views.form] }); } });
-
11 May 2012 3:03 PM #2
I also tried this code but it still does not work
the web service is made with WCFCode:App.views.Homeinfo = Ext.extend(Ext.Panel, { scroll: 'vertical', items: [{ xtype: 'form', id: 'form', fullscreen: true, cls : 'form', items: [ { xtype: 'fieldset', title: 'Demande d\'information', instructions:'Veuillez entrer les informations precedente', items: [ { xtype: 'textfield', name : 'first', label: 'Nom', placeHolder: 'Nom', }, { xtype: 'textfield', name : 'last', label: 'Prenom', placeHolder: 'Prenom', }, { xtype: 'emailfield', name: 'Email', label: 'Email', placeHolder: 'me@example.com', useClearIcon: true }, { xtype: 'numberfield', name: 'tel', label: 'Telephone', placeHolder: '00216-55-555-555', useClearIcon: true }, { xtype: 'textfield', id: 'title', label: 'Objet', required: true }, { xtype: 'textareafield', name: 'narrative', label: 'Demande' }, ]}, { xtype: 'button', flex: 1, margin: 10, text: 'Envoyer', handler: function() { alert("Demande envoye") Ext.data.JsonP.request({ url : 'http://localhost:8732/Service1/data/10', success : function(response) { var obj = Ext.decode(response.responseText); Ext.getCmp('title').setValue(obj); alert("dooooooo somthing") } }); } } ] }] }); Ext.reg('Homeinfo', App.views.Homeinfo);
thank you


Reply With Quote