| Author |
how to get data from immediate true?
|
kahkean chor
Ranch Hand
Joined: Jan 26, 2013
Posts: 49
|
|
<h utputText value="Country "/>
<h:inputText value="#{packageManagedBean.country}" /> <-------------------how to get this data
<h:commandButton image="resources/images/search.png" action="#{packageManagedBean.search()}" />
immediate help me skipped the form validation...however the input text value is not retrieve , could anyone help me? thanks in advance
|
 |
Tim Holloway
Saloon Keeper
Joined: Jun 25, 2001
Posts: 14568
|
|
Hint: if you use the "Code" button on our message editor to generate code tags around your XML, it will be a lot easier to read.
When you specify "immediate="true"" on a commandButton or commandLink, it doesn't simply bypass validation. It bypasses all data handing. The form data is simply not sent down to the server at all.
JSF requires that all data on a submitted form pass validation. If even a single value is invalid, the submission process is short-circuited. The Model (backing bean) is not updated, listeners don't fire, and the action method (if any) is not invoked. This ensures that you never work with partially-corrupt data.
The other thing that you should be aware of is that the action attribute is not executable code. It is a reference to executable code. Therefore it should not attempt to do code-like things, nor should it have "()" on it.
If you have everything set up properly, the backing bean's "search" method will be invoked and the backing bean "country" property will have already been set with the value the user entered into the form. Providing the form controls all have valid values.
|
Customer surveys are for companies who didn't pay proper attention to begin with.
|
 |
 |
|
|
subject: how to get data from immediate true?
|
|
|