DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=31365>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=31365

Add initValue attribute to html:radio tags

           Summary: Add initValue attribute to html:radio tags
           Product: Struts
           Version: 1.2.4
          Platform: Other
        OS/Version: Other
            Status: NEW
          Severity: Enhancement
          Priority: Other
         Component: Custom Tags
        AssignedTo: [EMAIL PROTECTED]
        ReportedBy: [EMAIL PROTECTED]


I would like to propose the addition of a "initValue" attribute to a radio tag
in the Struts HTML taglib which would override the value of the bean "property"
for the purposes of initialising the form-bean value.

An example of why this is required is as follows: you have two actions, a view
action and a business action. A JSP form page targets the business action and
has a set of radio options that determines which fields are available and are
also parameters of the business logic. The radio buttons are 'hot' and a
JavaScript refresh statically calls another, view action which re-renders the
page when the radio buttons values are altered. Effectively, the radio buttons
are fields for both actions.

The problem is without the ability to set the initial value in the radio buttons
and override the normal method of selecting which radio option is selected,
there is now way to reliably set the properties for the form-bean of the
primary, business action form bean. You can set the values of the radio buttons
in the request scope from the view action and read them in the reset() method of
the business action form bean, but the reset() method is only called when the
form-bean is retired after the action has been executed. Hence, it is not callde
afetr refreshing the page using the javascript.

What I propose is a initValue parameter to be used as so:

<html:radio
  property="searchType"
  value="flight"
  initValue="${viewForm.searchType}"
/>

<html:radio
  property="searchType"
  value="car"
  initValue="${viewForm.searchType}"
/>

For the purposes of initialising the values of the form the initValue is used to
check if the radio button is checked except where the form is returned to due to
errors executing the form data through the business action.

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

Reply via email to