This week's book giveaways are in the Java EE and JavaScript forums.
We're giving away four copies each of The Java EE 7 Tutorial Volume 1 or Volume 2(winners choice) and jQuery UI in Action and have the authors on-line!
See this thread and this one for details.
The moose likes JSF and the fly likes Valuechangelistener f:selectitems Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Java » JSF
Bookmark "Valuechangelistener f:selectitems" Watch "Valuechangelistener f:selectitems" New topic
Author

Valuechangelistener f:selectitems

Gina vernon
Ranch Hand

Joined: Jan 16, 2009
Posts: 108
Hi,
I am coding a requirement where a valuechange listener triggers the population of a UIselectitems component. Here is my code:
JSF page:


Backing bean:


Valuechangelistener:


I am unable to populate the component.

Sridhar Santhanakrishnan
Ranch Hand

Joined: Mar 20, 2007
Posts: 317
I hope you are trying to populate Pnsis values with the valuechangelistener.

1) Is the listener called?
2) getPnsis() seems to be returning a default ArrayList. This is the method that will be called when the pnsis dropdown is rendered. you should have code here that binds the value to the data returned from the listener method.
Gina vernon
Ranch Hand

Joined: Jan 16, 2009
Posts: 108
Sridhar Santhanakrishnan wrote:I hope you are trying to populate Pnsis values with the valuechangelistener.

1) Is the listener called?
2) getPnsis() seems to be returning a default ArrayList. This is the method that will be called when the pnsis dropdown is rendered. you should have code here that binds the value to the data returned from the listener method.


Sridhar,
1) I provided a valuechangelistener tag in the jsp as a child of the triggering component.
2) I am not sure how to accomplish your second suggestion. The listener method does not return anything. The method is triggered automatically when the parent component's value changes so why or how can it be called explicitly from getPnsis()? Some sample code would be helpful.

Thanks.
Gina vernon
Ranch Hand

Joined: Jan 16, 2009
Posts: 108
I should also mention that I tried using a text box instead of UIselectitems and it worked. And the backing bean setup was the same.
Its just the selectitems that doesn't work.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Valuechangelistener f:selectitems