File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes JSF and the fly likes how to get data from immediate true? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » JSF
Bookmark "how to get data from immediate true?" Watch "how to get data from immediate true?" New topic

how to get data from immediate true?

kahkean chor
Ranch Hand

Joined: Jan 26, 2013
Posts: 67
<hutputText value="Country "/>
<h:inputText value="#{}" /> <-------------------how to get this data
<h:commandButton image="resources/images/search.png" action="#{}" />

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: 17421

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.

An IDE is no substitute for an Intelligent Developer.
I agree. Here's the link:
subject: how to get data from immediate true?
It's not a secret anymore!