Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Passing the Radio button Value to Next Page  RSS feed

 
Raj Shekar H
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a dataTable in my page which renders on Ajax call of Input text . It has a radio button and some other fields . I need to grab checked radio button value to next page .

Let me know if you have any ideas ?

Thanks,
RJ
 
Tim Holloway
Bartender
Posts: 18662
71
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes. In JSF, you don't "grab" data. The essence of Inversion of Control is that you don't go out and get stuff. Instead the stuff is pushed in to you.

When you submit a JSF request, the values of the controls on the submitted form get sent to the server. JSF validates them, and if they are all valid, JSF automatically updates the backing bean(s). You don't have to "get" the radio button value, because JSF itself will set it for you in your Model (backing bean).

After the Model is updated, the action method or AJAX listener is called (and ONLY if the model was updated - meaning that the submitted data was 100% validated).

If you want the action to navigate to a new page (View), then you'd use a normal commandButton/commandLink and a normal action method. If you want to retain the current View, then you'd use AJAX instead. Unless you wanted the entire current page re-rendered.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!