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 values from dynamic component? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSF
Bookmark "How to get values from dynamic component?" Watch "How to get values from dynamic component?" New topic

How to get values from dynamic component?

anupv desai

Joined: Jan 09, 2012
Posts: 2


I am displaying dynamic components based on user selection, where InputText and OutputText display properly. But now i want to read that component value on
button click. Can any body help me in that?
Source code is as follow,


Thank You,

Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 17255

Welcome to the JavaRanch, Anup!

Good JSF practice is to avoid raw HTML. In the case of tables, a panelGrid or dataTable tag would be more appropriate.

JSF is HTTP-based, and HTTP is based on batch submission of forms. To update only a single field when a button is clicked therefore means that you need to either have no other fields in the form that contains the button and input control or that you use AJAX to do partial page processing. IceFaces can do that and in JSF2, there's also an "ajax" tag that can do that.

If you have properly set up your view definition, you don't need to "get" values, because JSF will "put" them into the backing bean automatically by invoking the "set" method for the value property that was assigned to the input control on its tag element.

An IDE is no substitute for an Intelligent Developer.
I agree. Here's the link:
subject: How to get values from dynamic component?
jQuery in Action, 3rd edition