ibm mobilefirst - Populate List based on json data in Worklight Application -


i developing worklight application using dojo shows list data based on webservice response.for getting webservice response have created adapter,i tested adapter , working fine.my problem show json data on view ,also in new view taught of showing data in list(list should populate based on json data array length) if click on list show details.

how .any appreciated.

code.

.js

function dispdata() {     var invocationdata = {             adapter : 'getsampleadapter',             procedure : 'sample'         };      wl.client.invokeprocedure(invocationdata,{         onsuccess : success,         onfailure : failure,     }); }  function success(result) {     var httpstatuscode = result.status;     if (200 == httpstatuscode) {           dijit.registry.byid("view0").performtransition("view1", 1, "slide");     } } 

html file

<div data-dojo-type="dojox.mobile.scrollableview" id="view0"             data-dojo-props="selected:false,scrolldir:'v'">         <div data-dojo-type="dojox.mobile.heading"             data-dojo-props="label:'status'"></div>             <button data-dojo-type="dojox.mobile.button" style="margin-left: 38%; margin-top: 30%"             data-dojo-props="label:'data details', onclick:function(e){dispdata();}" ></button>     </div>   <div data-dojo-type="dojox.mobile.scrollableview" id="view1"         data-dojo-props="selected:false,scrolldir:'v'">         <div data-dojo-type="dojox.mobile.heading"             data-dojo-props="label:'data'" back="status" moveto="view0"></div>  ----------json data should display here-------- </div> 

this technical forum. must try before post this. use dojox.mobile.edgetoedgestorelist.put json response in global variable such

    var mydata="[ "; mydata+="{ 'label': 'bla bla', 'moveto':'#'  }, "; mydata+="] "; global_var= eval (mydata); globalstorelist.generatelist(global_var); 

and build list programmatly(example)


Comments

Popular posts from this blog

basic authentication with http post params android -

vb.net - Virtual Keyboard commands -

css - Firefox for ubuntu renders wrong colors -