How to handle click event on listBox

I have two listboxs. And I want to load The items into the second accordingly to the selected items in the first.And I want that the content of the second change each time the selected items of the first listbox are modified.

I don't know which event to handle for the first listBox indicating the items are selected in the first listbox. I want to execute the method loading items into the second listbox each time this event is fired.

Thanks in advance.

[475 byte] By [WebServicea] at [2007-11-27 5:41:54]
# 1

You can just use the 'onchange' attribute of the fist menu and put Javascript in it to submit the form on every menu change.<h:selectOneMenu onchange="this.form.submit();">

In the 2nd menu just check the current value of the 1st menu and then populate the list accordingly.

BalusCa at 2007-7-12 15:19:55 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 2

Thanks for your reply.

I used <webuijsf:listbox > component to display the list and .

And I want to allow user to select multiple items.

Then I want that the 2nd will be populated each time an item is selected.So the method doing it must be called in an action listener .

Please I don't really know how to use the <h:selectOneMenu> component.And I want that after the submit the 2nd list will be populated.

How can I do it please.

Thanks.

WebServicea at 2007-7-12 15:19:55 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 3
Selecting multiple items can be achieved with h:selectManyMenu.I know nothing about the webuijsf components. Just take a look into their documentation.
BalusCa at 2007-7-12 15:19:55 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 4

> You can just use the 'onchange' attribute of the fist

> menu and put Javascript in it to submit the form on

> every menu change.<h:selectOneMenu

> onchange="this.form.submit();">

In the 2nd menu

> just check the current value of the 1st menu and then

> populate the list accordingly.

When I submit the form the components like the second listBox will be reloaded ?

WebServicea at 2007-7-12 15:19:55 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 5
It depends on the loading logic and the scope of the data.
BalusCa at 2007-7-12 15:19:55 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 6
I want to call the method populating the second listbox each time an item is selected in the first listbox.How can I do please.
WebServicea at 2007-7-12 15:19:55 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 7

After the submit of the form , how can I please reload items in the second listbox.What I mean is which method to call.For example if I want th set a new value in a TextArea component a call its get method.

Which method is called to loaded item sin listbox to put in the code populating the listBox.

Thanks in advance.

WebServicea at 2007-7-12 15:19:55 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...