aspose file tools*
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


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » JSF
Bookmark "How to get values from dynamic component?" Watch "How to get values from dynamic component?" New topic
Author

How to get values from dynamic component?

anupv desai
Greenhorn

Joined: Jan 09, 2012
Posts: 2

Hi:

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,

test.xhtml



bean.java



Thank You,
Anup


Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 15632
    
  15

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.


Customer surveys are for companies who didn't pay proper attention to begin with.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How to get values from dynamic component?
 
Similar Threads
Generating user details in form as ReadOnly
Not able to submit datatable
HOW TO REFRESH THE FULL PAGE USING JSF ICE FACES AND TO GET THE UPDATED RECORDS INTO PAGE
Dynamic Component in JSF
Why events are not fired when value changes in h:selectOneMenu? I am stuck!