Skip to Main Content

Java EE (Java Enterprise Edition) General Discussion

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

How to set ListBox Option Group name

jsfgeeksNov 29 2008
hi,
i populate h:selectOneListBox and it's done well, now i want to put optionGroup Label but it is not set,
i try using SelectItemGroup with selectItem but it also not set.
my jsp code
  <h:selectOneListbox binding="#{TOPLIsting.bio_tab2lstbx}" id="bio_tab2lstbx" 
                                onchange="common_timeoutSubmitForm(this.form, 'bio_tab2lstbx');" size="5"
                                style=" height: 336px; left: 192px; top: 336px; position: absolute; visibility: visible; width: 192px; z-index: 1"
                                title="ListBox" valueChangeListener="#{TOPLIsting.bio_tab2lstbx_processValueChange}">                           
                           <f:selectItems id="listbox1SelectItems" value="#{TOPLIsting.listbox1DefaultItems}"/>
                            </h:selectOneListbox>
and bean code
 List selectItems = new ArrayList();            
        Iterator it1 = bio_2_arrayList.listIterator();
        Iterator it3 = bio_id_2_arrayList.listIterator();
        String label1_11 = null;
        String label2_22 = null;
        while (it1.hasNext()) {
            while (it3.hasNext()) {
                label1_11 = (String) it1.next();
                label2_22 = (String) it3.next();
                selectItems.add(new SelectItem(label2_22, label1_11));
            }
        } 
bio_tab2_lstItem = (SelectItem[]) selectItems.toArray(new SelectItem[0]);
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Dec 27 2008
Added on Nov 29 2008
0 comments
174 views