File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes JSF and the fly likes Using ValueChangeListeners with Datatable Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSF
Bookmark "Using ValueChangeListeners with Datatable" Watch "Using ValueChangeListeners with Datatable" New topic

Using ValueChangeListeners with Datatable

Aravind Elango

Joined: Jun 02, 2003
Posts: 20

I have a datatable with 2 columns and a number of rows. The first column contains a selectone listbox and the next column contains a textbox. My objective is to select an option from the drop down list and to get the selected value to show up on the textbox(Only in that purticular row).

I tried to do this by attaching an ValueChangeListener to the selectBox. I expected the valueChangeListener function to be called once. Instead, it gets called once for every row in the datatable.

Some Background Info:
SampleBean is a request scope managed bean
SampleBean's attribute is an arry of TableBean (i.e. TableBean[])
TableBean contains 2 attributes: An SelectItem[] and a String.
Thus, each row in the datatable corresponds to one TableBean.
I tried having the valueChangeListener() placed in both the SampleBean and the TableBean, but still have the same problem of multiple calls.

Any/All help would be greatly appreciated.

I agree. Here's the link:
subject: Using ValueChangeListeners with Datatable
It's not a secret anymore!