In Reset Method
this.direct =null;

>From: Steve Earl <[EMAIL PROTECTED]>
>Reply-To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
>To: "'Struts Users Mailing List' (E-mail)"  
><[EMAIL PROTECTED]>
>Subject: Retaining checkbox state on redisplay
>Date: Fri, 22 Feb 2002 09:24:25 -0000
>
>Hi guys,
>
>As usual with my questions this has probably been done to death but I still
>haven't grasped it!!
>
>Can someone tell me the 'best practice' method of defining checkbox 
>elements
>to allow them to be re-populated with the user selected state
>when a page is redisplayed.
>
>I currently have a checkbox contained within my jsp which has the following
>setup:
>
><snip>
><html:checkbox property="direct" value="Y" />
><snip>
>
>within my formbean for this page I have direct defined as a string, not a
>boolean and set it as follows:
><snip>
>public void setDirect(String direct) {
>  this.direct = direct;
>}
><snip>
>
>The action class then examines the state of the direct attribute within the
>formBean and if it's set to "Y" it does some work.
>
>My problem is that on the redisplay of the page the checkbox is shown as
>unchecked i.e. it reverts to its original state.
>
>I read some messages on the archive suggesting that the formBean needed to
>set the value of direct from within a reset() method
>but didn't quite figure out whether that means that direct should be 
>defined
>as a boolean or not. Also had a look at most of the
>examples on the struts homepage and couldn't find any which included
>checkboxes.
>
>All a bit confused really....a normal Friday feeling..
>
>tia
>steve
>
>
>--
>To unsubscribe, e-mail:   
><mailto:[EMAIL PROTECTED]>
>For additional commands, e-mail: 
><mailto:[EMAIL PROTECTED]>
>




_________________________________________________________________
Join the world’s largest e-mail service with MSN Hotmail. 
http://www.hotmail.com


--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to