facebook

Add and Remove Item from a Combobox: CLOSED

  1. MobiOne Archive
  2.  > 
  3. Getting Help – General
Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #334023 Reply

    donij
    Member

    Hi All,

    I have made attempts to add/remove items from a combobox but without success.
    I used jquery as follows;

    Remove: $(‘#m1-myapp-combo1’).empty();

    Add: $(‘#m1-myapp-combo1′).append($(“<option></option>”)
    .attr(“value”,’Hello’)
    .text(‘Hello’));

    Need some help.

    Thanks

    #334044 Reply

    donij
    Member

    Hi All,

    please I need help cos am stuck here. It is such a simple thing but just don’t know why all the methods applied just didn’t work. I have tried examples on the net but still not working. Even what works for me on my .net app did not work in mobione. This simple one too did not work.

    $(“#m1-myapp-combo1”).html(“<option value=’text’>Hello</option>”);

    does the screen need refreshing after the add/append/remove?

    Please help.

    Thanks

    #334053 Reply

    donij
    Member

    interestingly I located the problem. It is quite amazing the naming convention for the html elements generation.

    I thought the naming convention for all generated html component id is m1-myscreenname-mywidgetname. I discovered that for my combobox it is different. I walked through the html and what I got is m1-myscreename-hidden-select-mywidgetname. I used this and everything was fine. Will this be different naming convention for other widgets?

    The next issue now is after dynamically populating the combobox, the selected item does not appear until I go select it from the list. Any solution please.

    Thanks

    #334075 Reply

    Hi donij,

    Have you tried the phoneui.preprocessDOM() function after modify your combobox? See a similar question here: http://www.genuitec.com/support-genuitec/viewtopic.php?f=9&t=4323

    #334078 Reply

    donij
    Member

    Hi Octavio,

    thanks a million! it is all working!!

    I just pulled this from one of your widgets how-tos. Instruction clearer ;

    phoneui.preprocessDOM(‘#screenId’); //force UI to update

    Thanks brother.

Viewing 5 posts - 1 through 5 (of 5 total)
Reply To: Add and Remove Item from a Combobox: CLOSED

You must be logged in to post in the forum log in