facebook

Setting ComboBox (iPhone) Display Text

  1. MobiOne Archive
  2.  > 
  3. Feedback & Suggestions
Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #333040 Reply

    abhall98
    Participant

    I have a Combo Box application which I am trying to populate with some values from a database
    I am able to populate the combobox Ok but I have a problem when I try to select a specific value
    I use the combobox.selected property to cause the item to show when the combobox is opened ( in IPhone Mode)
    But when the combobox is first displayed the text of the selected Item in not displayed

    I have attached a sample code

    Attachments:
    You must be logged in to view attached files.
    #333128 Reply

    Hi Tony,

    You just need to call the phoneui.preprocessDOM after your for instruction:

    for (var i=0; i<noOfOptions; i++) {

    var oOption = document.createElement(“OPTION”);
    oOption.text=i + ” – ” + comboData[i] ;
    oOption.value=i;
    if(i ==1){
    oOption.selected=true;
    }else{
    oOption.selected=false;
    }
    lCombo.add(oOption);

    }//for
    phoneui.preprocessDOM(“#m1-combo”);

Viewing 2 posts - 1 through 2 (of 2 total)
Reply To: Setting ComboBox (iPhone) Display Text

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