ibm mobilefirst - How to create SwapView dynamically using Dojo -


i using dojo v1.8 worklight; create swapview dynamically in view, i'm encountering problems...

html code:

<div data-dojo-type="dojox.mobile.view" id="listeinscriptionview"             data-dojo-props="selected:false,scrolldir:'vh'"             style="background-image: url('images/bg-texture.jpg');"                              data-dojo-id="id">     </div> 

javascript code:

var view = registry.byid(listeinscriptionview);     alert(view);      for(var = 1; < 3; i++ ){         var swap = new dojox.mobile.swapview({             id: i,              selected:false          });          var head = new dojox.mobile.heading({             label:'swap' + i,         });         swap.addchield(head);         view.addchield(swap);         alert("test" + i);     } 

the above not work. how can create widget swapview dynamically?

is copy of actual code? have not tested there syntax errors , typos:

registry.byid(listeinscriptionview); 

should

registry.byid("listeinscriptionview"); 

(missing quotes), ,

swap.addchield(head); view.addchield(swap); 

should

swap.addchild(head); view.addchild(swap); 

maybe works better these errors fixed?


Comments

Popular posts from this blog

Why does Ruby on Rails generate add a blank line to the end of a file? -

keyboard - Smiles and long press feature in Android -

node.js - Bad Request - node js ajax post -