Hi Wendy,
Thanks for responding. I have gotten closer to what I want to accomplish
but not quite.
To give you a little background. I have a menu with an action that has
multiple fowards
to simple select several jsp pages. That works fine. Two of the
selections use the
same form. So the same form will be displayed with the two selections. The
only difference
is I want one page to come up with one radio button selected and when the
other
form is displayed the other radio button is selected. The action is very
simple
it just fowards to the required jsp.
I have come up with the following but it does not select the desired radio
button.
mypage.jsp?formOption=center
mypage.jsp?formOption=home
<bean:parameter id="options"
name="formOption"
value="type not found"/>
Results:
<bean:write name="options"/>
This first part (above) works fine the following is what I am still trying
to work out:
<jsp:useBean id="myformbean" class="com.forms.myForm"/>
<jsp:setProperty name="myformbean" property="type" value="center" />
The property does get set but the radio button does not get set.
<bean:write name="myformbean" property="type"/> will display "center" which
is fine
Now here is the radio buttons:
<html-el:radio property="type" value="center"/>
<html-el:radio property="type" value="home"/>
At runtime I would want center to be checked.
<input type="radio" name=type value="center" checked="checked">
Set property does set the form bean property to center (value="center"
above) but
it does not set the form radio button.
So in summary all I really want to do here is call a jsp page directly and
set a radio button as selected.
Barry
----- Original Message -----
From: "Wendy Smoak" <[EMAIL PROTECTED]>
To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
Sent: Friday, October 03, 2003 4:30 PM
Subject: RE: ANY TAKERS?? Initializing Form bean values in jsp
> AGAIN I AM NOT CALLING THE JSP FROM AN ACTION SO INITIALIZING THE
> DYNAFORM BEAN IN STRUTS-CONFIG WILL NOT WORK.
No need to yell... But you have to understand that this it not the
Struts Way. Many of us put JSP's under WEB-INF or behind a security
constraint specifically to FORCE users to go through an action. Life's
just better that way.
I'm not sure what the issue is. If you insist on doing stuff in the
JSP, you have access to the 'request' object. Do some conditional tags
(<c:if> or <c:choose> <c:when> ) or even {shudder} a scriptlet based on
the results of request.getParameter("type"); .
You may end up doing plain-old <input type="radio"> for these. There's
no rule that says you *have* to use the Struts tags. In this case, I
see three choices--
type=1 , write out the radio tags with the first one selected
type=2 , write out the radio tags with the second one selected
type not present in request, use the Struts tag
--
Wendy Smoak
Applications Systems Analyst, Sr.
Arizona State University, PA, IRM
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]