Immediate Submit From Dropdown List Selection

In JSF what is the best way to get the form to submit immediately when a dropdown list item is selected? I know I can use a JavaScript onchange="..." but just wondering if there is a more standard/cool way of doing this in JSF.Thanks!Vaughn
[261 byte] By [vvernona] at [2007-10-3 9:49:40]
# 1
map your select list to a ValueChangeListener. Put your code for the submission in the processValueChange method of Listener class. If you google for ValueChangeListener and selectOneMenu you can probably find a lot of code examples. Take care.
rvflannerya at 2007-7-15 5:06:45 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 2

No. Simply creating a ValueChangeListener won't do what he wants. When he used the term "immediately" he meant "as soon as the value changes" and not "immediate" in the sense of bypassing Faces lifecycles. This can be seen from his reference to "onchange=".

The suggestion I am about to make solves one problem but creates another.

In addition to valueChangeListener= "#{...}" and immediate="true", put onchange="submit()". This will execute your event as soon as the value changes BUT...

Faces navigation doesn't work any more when you return a navigation target.

How do we get Faces Navigation to keep working when we use "onchange" ?

owebeewana at 2007-7-15 5:06:45 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...