You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Dave Belfer-Shevett <db...@homeport.org> on 2009/09/02 22:33:39 UTC
Session variables in buttons - preselection and formatting?
I have a twofold question.
The first is I have a session variable called 'sendto' which contains a
string ('registrant','none', or 'everyone'). When the page with the
radio buttons is rendered, I want to preselect based on whatever the
value in the session hash for 'sendto' is set to.
Code:
<div style="float: right; width: 150px;">
<b>Notifications</b><hr>
Send email to:<br>
<s:radio
list="#{'none':'None','registrant':'This
Registrant','everyone':'Everyone on this invoice'}"
value="#{sendto}" name="sendto" />
</div>
I woudl have thought the value="#{sendto}" would have done that, but it
doesn't. I've checked and the session key 'sendto' does have the value
'registrant' in it.
Secondly - These render on a straight line, one right after another.
I'd like line breaks <br> between each radio button. Is this possible?
Thanks!
-dbs
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
RE: Session variables in buttons - preselection and formatting?
Posted by Lee Clemens <ja...@leeclemens.net>.
And if you're using cssClass in the <s:radio> tag, you might want to add
this to the template (just replace the <tr><td> from the example Mike
provided):
<tr><td
<#if parameters.cssClass??>
class="${parameters.cssClass?html}"<#rt/>
</#if>>
-----Original Message-----
From: Mike Baranski [mailto:list-subscriptions@secmgmt.com]
Sent: Wednesday, September 02, 2009 4:50 PM
To: 'Struts Users Mailing List'; dbs@homeport.org
Subject: RE: Session variables in <s:radio> buttons - preselection and
formatting?
For #1, I don't know.
For #2, I did exactly that, see here:
http://mikeski.net/site/node/16
Mike.
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
RE: Session variables in buttons - preselection and formatting?
Posted by Mike Baranski <li...@secmgmt.com>.
For #1, I don't know.
For #2, I did exactly that, see here:
http://mikeski.net/site/node/16
Mike.
>-----Original Message-----
>From: Dave Belfer-Shevett [mailto:dbs@homeport.org]
>Sent: Wednesday, September 02, 2009 4:34 PM
>To: Struts Users Mailing List
>Subject: Session variables in <s:radio> buttons - preselection and
>formatting?
>
>I have a twofold question.
>
>The first is I have a session variable called 'sendto' which contains a
>string ('registrant','none', or 'everyone'). When the page with the
>radio buttons is rendered, I want to preselect based on whatever the
>value in the session hash for 'sendto' is set to.
>
>Code:
> <div style="float: right; width: 150px;">
> <b>Notifications</b><hr>
> Send email to:<br>
> <s:radio
> list="#{'none':'None','registrant':'This
>Registrant','everyone':'Everyone on this invoice'}"
> value="#{sendto}" name="sendto" />
> </div>
>
>I woudl have thought the value="#{sendto}" would have done that, but it
>doesn't. I've checked and the session key 'sendto' does have the value
>'registrant' in it.
>
>Secondly - These render on a straight line, one right after another.
>I'd like line breaks <br> between each radio button. Is this possible?
>
>Thanks!
>
> -dbs
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>For additional commands, e-mail: user-help@struts.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org