• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Passing the Radio button Value to Next Page

 
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Saloon Keeper
Posts: 27763
196
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
reply
    Bookmark Topic Watch Topic
  • New Topic