Armando Ruperez

Greenhorn
+ Follow
since Jun 30, 2009
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Armando Ruperez

Andres Quinones wrote:

Originally posted by Tushar Kherde:
Thanks for reply

I cant use javascriprt because i am populating 2nd dropdown from database and not using ajax also.
Cant we do this using plain JSF on some event, if we render the whole page again.



You can do it this way
<h:selectOneMenu valueChangeListener="#{Bean.listenerMethod}" onchange="submit()" value="#{Bean.value}">
<f:selectItems value="#{Bean.list}"/>
</h:selectOneMenu>
And in the Bean you only need to add a method like this
public void listenerMethod( ValueChangeEvent e ) throws AbortProcessingException{
Object value = e.getNewValue();
}

There you will have the value you selected in the list and you can use it to populate the other dropdown.

I hope this helps
[ February 14, 2007: Message edited by: Andres Quinones ]




I'm trying to follow this suggestion but, it doesn´t seem to work, throws a null pointer exception unless y put the rendered="#{GlobalData.selectClient!=null}" option in the second selectOneListbox, and if that is the case, after the selection of the first listbox is made, the second one never shows up.

Is something im missing?, perhaps someone can help me.
14 years ago
JSF