dcsimg
H:selectOneRadio
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Prateek_Agarwal
Posted On:   Monday, December 1, 2008 04:30 AM

Hi im new to jguru. the problem i m facing is in when i use radio button. suppose i save the value of the selectOneRadio button in my DB. when i click in edit page i need to populate and check the same button based on what the user had selected during creating. suppose he selected YES in the create page and says SAVE on click of edit page he should be able to see the same.(YES should be tick on its own). How to achieve it. and in bean i have private String select; //getter //setter    More>>

Hi im new to jguru.


the problem i m facing is in when i use radio button.



suppose i save the value of the selectOneRadio button in my DB.

when i click in edit page i need to populate and check the same button based on what the user had selected during creating.


suppose he selected YES in the create page and says SAVE
on click of edit page he should be able to see the same.(YES should be tick on its own).

How to achieve it.















and in bean i have




private String select;



//getter

//setter

   <<Less

Re: H:selectOneRadio

Posted By:   Anonymous  
Posted On:   Wednesday, December 10, 2008 12:32 PM

Hi Prateek,
Welcome to Jguru..

You Said: "suppose he selected YES in the create page and says SAVE on click of edit page he should be able to see the same.(YES should be tick on its own). How to achieve it. "

Its simple,
When you click on edit page, first read the value from the database. Suppose you stored the Value of 'select' in the database as '1' in some table, when you click on the edit page button, inside the action method call a service to read the value from database and assign that value to the 'select' property that you have on the backing bean.

This will automatically populate((YES will be tick on its own- in your words) since the value it is holding is 1.

Reply if you still face prblem..
About | Sitemap | Contact