pre pouplating selectone list box with data

hello friends, im very new to jsf programming

I have one requrement like this.

In one jsp page there are many select boxes (jSF components).

and there is one backing bean corresponding to that jsp page.

I want to pre populate the select boxes with the data, from the database.

I dont know howand where to set the values to these select boxes.

please help me friends.

Thanks in advance.

[434 byte] By [avn_venkia] at [2007-11-27 2:10:54]
# 1

You can pre-propulate the bean anytime before you attempt to build the page (on which the select boxes are on).

Use an action method, action listener, or even the beans constructor to populate the bean.

There are a few other times/ways you can pre-populate the bean, but they are more special cases.

Most people will use the beans constructor. It's the simplest and most straight forward way (plus, that's what a constructor is for... populating your Object with defaults). You can make your DB calls from within the constructor.

CowKing

IamCowKinga at 2007-7-12 2:03:35 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...