Quantcast

[Help] - Binding the Drop Down List with List (JSF)

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

[Help] - Binding the Drop Down List with List (JSF)

DanglingChap
Hi,

I am using Netbeans 5.5 with Visual Web Pack plugin. I am able to bind the Drop Down List with the data from the database using "Option[]", following this tutorial http://www.netbeans.org/kb/55/vwp-hibernate.html . It's cool, but Don't want to use "Option[]" I want to bind the Drop Down List Directly to the List returned from the Hibernate.

Here is few line of code that is writen in sessionbean1.init() method

                Person person = (Person) iter.next();

                Option opt = new Option("" + person.getPersonId(),person.getName());
                personOptions[i++] = opt;

Here i am iterating again over the list to make new options, which in my thinking an added overhead, if i have very large list. So, how can i bind the Drop Down List directly to the List?

cheers,
Muhammad Ali
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [Help] - Binding the Drop Down List with List (JSF)

Kishm
This tutorial shows you how to bind a dropdown list directly to a dataprovider

http://developers.sun.com/jscreator/learning/tutorials/2/inserts_updates_deletes.html

Thanks
Kish


DanglingChap wrote
Hi,

I am using Netbeans 5.5 with Visual Web Pack plugin. I am able to bind the Drop Down List with the data from the database using "Option[]", following this tutorial http://www.netbeans.org/kb/55/vwp-hibernate.html . It's cool, but Don't want to use "Option[]" I want to bind the Drop Down List Directly to the List returned from the Hibernate.

Here is few line of code that is writen in sessionbean1.init() method

                Person person = (Person) iter.next();

                Option opt = new Option("" + person.getPersonId(),person.getName());
                personOptions[i++] = opt;

Here i am iterating again over the list to make new options, which in my thinking an added overhead, if i have very large list. So, how can i bind the Drop Down List directly to the List?

cheers,
Muhammad Ali
Loading...