You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Asim Ghosh <as...@yahoo.co.uk> on 2004/06/21 07:39:15 UTC

hello guys
 
 how do i implement checked option with <html:radio>
 
example:
<input type="radio" checked>
 
in struts how to...?
 
asim

		
---------------------------------
 ALL-NEW Yahoo! Messenger - sooooo many all-new ways to express yourself 

Re:

Posted by Henrique VIECILI <vi...@softplan.com.br>.
For example:

if you have something like this:

Gender:
( ) Male
( ) Female

your jsp will look like this:

<html:radio property="gender" value="M"/> Male <br>
<html:radio property="gender" value="F"/> Female

and you want to make 'Male' the default checked value, then your ActionForm will look like this:

    //form attributes declaration
    private String gender = "M";

if you like, you can set the default value inside the reset method too.

Henrique Viecili
  ----- Original Message ----- 
  From: Asim Ghosh 
  To: Struts Users Mailing List 
  Sent: Monday, June 21, 2004 8:31 AM
  Subject: Re: <html:radio>


  hello Henrique,
    
   can you give me an example...
   
  thanks
  Asim

  Henrique VIECILI <vi...@softplan.com.br> wrote:
  You must initialize the correspondent variable in ActionForm (inside 'reset' method) with the value you want to be checked, Struts will render the checked 'automagicly'.

  Henrique Viecili
  ----- Original Message ----- 
  From: Asim Ghosh 
  To: StrutsUsers 
  Sent: Monday, June 21, 2004 2:39 AM
  Subject: 


  hello guys

  how do i implement checked option with 

  example:
   [input] 

  in struts how to...?

  asim


  ---------------------------------
  ALL-NEW Yahoo! Messenger - sooooo many all-new ways to express yourself

  ---------------------------------
   ALL-NEW Yahoo! Messenger - sooooo many all-new ways to express yourself

Re:

Posted by Asim Ghosh <as...@yahoo.co.uk>.
hello Henrique,
  
 can you give me an example...
 
thanks
Asim

Henrique VIECILI <vi...@softplan.com.br> wrote:
You must initialize the correspondent variable in ActionForm (inside 'reset' method) with the value you want to be checked, Struts will render the checked 'automagicly'.

Henrique Viecili
----- Original Message ----- 
From: Asim Ghosh 
To: StrutsUsers 
Sent: Monday, June 21, 2004 2:39 AM
Subject: 


hello guys

how do i implement checked option with 

example:
 [input] 

in struts how to...?

asim


---------------------------------
ALL-NEW Yahoo! Messenger - sooooo many all-new ways to express yourself
		
---------------------------------
 ALL-NEW Yahoo! Messenger - sooooo many all-new ways to express yourself 

Re:

Posted by Henrique VIECILI <vi...@softplan.com.br>.
You must initialize the correspondent variable in ActionForm (inside 'reset' method) with the value you want to be checked, Struts will render the checked 'automagicly'.

Henrique Viecili
  ----- Original Message ----- 
  From: Asim Ghosh 
  To: StrutsUsers 
  Sent: Monday, June 21, 2004 2:39 AM
  Subject: <html:radio>


  hello guys
   
   how do i implement checked option with <html:radio>
   
  example:
  <input type="radio" checked>
   
  in struts how to...?
   
  asim


  ---------------------------------
   ALL-NEW Yahoo! Messenger - sooooo many all-new ways to express yourself