You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Charbel Abdul-Massih <ca...@soundbite.com> on 2007/05/31 16:16:25 UTC

[S2] How do I get radio buttons to show vertically

I am using the following tag in my jsp

 

<s:radio list="someMappedList" name="radioButtonSelected"/>

 

Currently, my map has two entries.  The radios are displayed on the same
line...I would like them displayed on 2 separate lines...Is there an
easy way to do this???

 

Thanks,

Charbel

 

 


Re: [S2] How do I get radio buttons to show vertically

Posted by dougwig <do...@gmail.com>.
I was having this same issue today...

When I wrapped some display text in a struts html:radio tag the resulting
html for the radio input did not wrap the display text and the display text
did not become a "child" of the radio input, instead it became a sibling.

For radio inputs styled with display:block, the display text will drop below
the radio input.

As a quick fix, I just removed the display:block from the radio inputs and
wrapped the struts radio tags with a span tag. Then I set the span to
display:block. Although not optimal, this worked fine.

Using french brackets for  "<" and ">" you'd have:

HTML:
{fieldset id=someOptions}
{span}{html:radio etc.} Option 1 {/span}
{fieldset}

CSS:
fieldset#someOptions span {display:block}














Laurie Harper wrote:
> 
> Then customizing the theme is probably the way to go:
> 
> http://struts.apache.org/2.x/docs/themes-and-templates.html
> 
> L.
> 
> Charbel Abdul-Massih wrote:
>> Laurie,
>> That wrapped markup around all the radio buttons, not each of the
>> button/label combination :(
>> 
>>  
>> -----Original Message-----
>> From: news [mailto:news@sea.gmane.org] On Behalf Of Laurie Harper
>> Sent: Thursday, May 31, 2007 3:06 PM
>> To: user@struts.apache.org
>> Subject: Re: [S2] How do I get radio buttons to show vertically
>> 
>> You could switch to the xhtml or css_xhtml theme, which would give you 
>> additional markup around each radio button / label pair. You would then 
>> have sufficient markup structure to style with CSS.
>> 
>> Alternatively, create your own custom theme, or just write a custom 
>> template for this specific tag and use the template and/or templateDir 
>> attributes to reference it.
>> 
>> L.
>> 
>> Charbel Abdul-Massih wrote:
>>> Guru,
>>>
>>> The HTML that's outputted by struts is like this (with the "simple"
>>> theme)
>>>
>>> <input type="radio" name="testRadio" id="testRadio1" value="all"
>>> class="radioB"/><label for="testRadio1">label 1</label>
>>>
>>> <input type="radio" name="testRadio" id="testRadio2" value="prev"
>>> class="radioB"/><label for="testRadio2">label 2</label>
>>>
>>> Using the "display:block" would put my radios on sperate lines, but
>> also
>>> put the labels for the radios on separate lines as well...I want the
>>> radio and label associated with it to stay on the same line...any
>> other
>>> suggestions?
>>>
>>> Thanks,
>>> Charbel
>>>
>>> -----Original Message-----
>>> From: Raghupathy, Gurumoorthy
>>> [mailto:Gurumoorthy.Raghupathy@nielsen.com] 
>>> Sent: Thursday, May 31, 2007 11:11 AM
>>> To: Struts Users Mailing List
>>> Subject: RE: [S2] How do I get radio buttons to show vertically
>>>
>>> Apply a style sheet class which has "display:block" .... 
>>> http://www.w3schools.com/css/pr_class_display.asp
>>>
>>> Google is your best friend :)
>>>
>>> Guru
>>>
>>> -----Original Message-----
>>> From: Charbel Abdul-Massih [mailto:cabdulmassih@soundbite.com] 
>>> Sent: 31 May 2007 15:16
>>> To: Struts Users Mailing List
>>> Subject: [S2] How do I get radio buttons to show vertically
>>>
>>> I am using the following tag in my jsp
>>>
>>>  
>>>
>>> <s:radio list="someMappedList" name="radioButtonSelected"/>
>>>
>>>  
>>>
>>> Currently, my map has two entries.  The radios are displayed on the
>> same
>>> line...I would like them displayed on 2 separate lines...Is there an
>>> easy way to do this???
>>>
>>>  
>>>
>>> Thanks,
>>>
>>> Charbel
>>>
>>>  
>>>
>>>  
>>>
>>>
>>> ---------------------------------------------------------------------
>>> 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
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/-S2--How-do-I-get-radio-buttons-to-show-vertically-tf3846801.html#a11082190
Sent from the Struts - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: [S2] How do I get radio buttons to show vertically

Posted by Laurie Harper <la...@holoweb.net>.
Then customizing the theme is probably the way to go:

http://struts.apache.org/2.x/docs/themes-and-templates.html

L.

Charbel Abdul-Massih wrote:
> Laurie,
> That wrapped markup around all the radio buttons, not each of the
> button/label combination :(
> 
>  
> -----Original Message-----
> From: news [mailto:news@sea.gmane.org] On Behalf Of Laurie Harper
> Sent: Thursday, May 31, 2007 3:06 PM
> To: user@struts.apache.org
> Subject: Re: [S2] How do I get radio buttons to show vertically
> 
> You could switch to the xhtml or css_xhtml theme, which would give you 
> additional markup around each radio button / label pair. You would then 
> have sufficient markup structure to style with CSS.
> 
> Alternatively, create your own custom theme, or just write a custom 
> template for this specific tag and use the template and/or templateDir 
> attributes to reference it.
> 
> L.
> 
> Charbel Abdul-Massih wrote:
>> Guru,
>>
>> The HTML that's outputted by struts is like this (with the "simple"
>> theme)
>>
>> <input type="radio" name="testRadio" id="testRadio1" value="all"
>> class="radioB"/><label for="testRadio1">label 1</label>
>>
>> <input type="radio" name="testRadio" id="testRadio2" value="prev"
>> class="radioB"/><label for="testRadio2">label 2</label>
>>
>> Using the "display:block" would put my radios on sperate lines, but
> also
>> put the labels for the radios on separate lines as well...I want the
>> radio and label associated with it to stay on the same line...any
> other
>> suggestions?
>>
>> Thanks,
>> Charbel
>>
>> -----Original Message-----
>> From: Raghupathy, Gurumoorthy
>> [mailto:Gurumoorthy.Raghupathy@nielsen.com] 
>> Sent: Thursday, May 31, 2007 11:11 AM
>> To: Struts Users Mailing List
>> Subject: RE: [S2] How do I get radio buttons to show vertically
>>
>> Apply a style sheet class which has "display:block" .... 
>> http://www.w3schools.com/css/pr_class_display.asp
>>
>> Google is your best friend :)
>>
>> Guru
>>
>> -----Original Message-----
>> From: Charbel Abdul-Massih [mailto:cabdulmassih@soundbite.com] 
>> Sent: 31 May 2007 15:16
>> To: Struts Users Mailing List
>> Subject: [S2] How do I get radio buttons to show vertically
>>
>> I am using the following tag in my jsp
>>
>>  
>>
>> <s:radio list="someMappedList" name="radioButtonSelected"/>
>>
>>  
>>
>> Currently, my map has two entries.  The radios are displayed on the
> same
>> line...I would like them displayed on 2 separate lines...Is there an
>> easy way to do this???
>>
>>  
>>
>> Thanks,
>>
>> Charbel
>>
>>  
>>
>>  
>>
>>
>> ---------------------------------------------------------------------
>> 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


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


RE: Re: [S2] How do I get radio buttons to show vertically

Posted by Charbel Abdul-Massih <ca...@soundbite.com>.
Laurie,
That wrapped markup around all the radio buttons, not each of the
button/label combination :(

 
-----Original Message-----
From: news [mailto:news@sea.gmane.org] On Behalf Of Laurie Harper
Sent: Thursday, May 31, 2007 3:06 PM
To: user@struts.apache.org
Subject: Re: [S2] How do I get radio buttons to show vertically

You could switch to the xhtml or css_xhtml theme, which would give you 
additional markup around each radio button / label pair. You would then 
have sufficient markup structure to style with CSS.

Alternatively, create your own custom theme, or just write a custom 
template for this specific tag and use the template and/or templateDir 
attributes to reference it.

L.

Charbel Abdul-Massih wrote:
> Guru,
> 
> The HTML that's outputted by struts is like this (with the "simple"
> theme)
> 
> <input type="radio" name="testRadio" id="testRadio1" value="all"
> class="radioB"/><label for="testRadio1">label 1</label>
> 
> <input type="radio" name="testRadio" id="testRadio2" value="prev"
> class="radioB"/><label for="testRadio2">label 2</label>
> 
> Using the "display:block" would put my radios on sperate lines, but
also
> put the labels for the radios on separate lines as well...I want the
> radio and label associated with it to stay on the same line...any
other
> suggestions?
> 
> Thanks,
> Charbel
> 
> -----Original Message-----
> From: Raghupathy, Gurumoorthy
> [mailto:Gurumoorthy.Raghupathy@nielsen.com] 
> Sent: Thursday, May 31, 2007 11:11 AM
> To: Struts Users Mailing List
> Subject: RE: [S2] How do I get radio buttons to show vertically
> 
> Apply a style sheet class which has "display:block" .... 
> http://www.w3schools.com/css/pr_class_display.asp
> 
> Google is your best friend :)
> 
> Guru
> 
> -----Original Message-----
> From: Charbel Abdul-Massih [mailto:cabdulmassih@soundbite.com] 
> Sent: 31 May 2007 15:16
> To: Struts Users Mailing List
> Subject: [S2] How do I get radio buttons to show vertically
> 
> I am using the following tag in my jsp
> 
>  
> 
> <s:radio list="someMappedList" name="radioButtonSelected"/>
> 
>  
> 
> Currently, my map has two entries.  The radios are displayed on the
same
> line...I would like them displayed on 2 separate lines...Is there an
> easy way to do this???
> 
>  
> 
> Thanks,
> 
> Charbel
> 
>  
> 
>  
> 
> 
> ---------------------------------------------------------------------
> 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


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: [S2] How do I get radio buttons to show vertically

Posted by Laurie Harper <la...@holoweb.net>.
You could switch to the xhtml or css_xhtml theme, which would give you 
additional markup around each radio button / label pair. You would then 
have sufficient markup structure to style with CSS.

Alternatively, create your own custom theme, or just write a custom 
template for this specific tag and use the template and/or templateDir 
attributes to reference it.

L.

Charbel Abdul-Massih wrote:
> Guru,
> 
> The HTML that's outputted by struts is like this (with the "simple"
> theme)
> 
> <input type="radio" name="testRadio" id="testRadio1" value="all"
> class="radioB"/><label for="testRadio1">label 1</label>
> 
> <input type="radio" name="testRadio" id="testRadio2" value="prev"
> class="radioB"/><label for="testRadio2">label 2</label>
> 
> Using the "display:block" would put my radios on sperate lines, but also
> put the labels for the radios on separate lines as well...I want the
> radio and label associated with it to stay on the same line...any other
> suggestions?
> 
> Thanks,
> Charbel
> 
> -----Original Message-----
> From: Raghupathy, Gurumoorthy
> [mailto:Gurumoorthy.Raghupathy@nielsen.com] 
> Sent: Thursday, May 31, 2007 11:11 AM
> To: Struts Users Mailing List
> Subject: RE: [S2] How do I get radio buttons to show vertically
> 
> Apply a style sheet class which has "display:block" .... 
> http://www.w3schools.com/css/pr_class_display.asp
> 
> Google is your best friend :)
> 
> Guru
> 
> -----Original Message-----
> From: Charbel Abdul-Massih [mailto:cabdulmassih@soundbite.com] 
> Sent: 31 May 2007 15:16
> To: Struts Users Mailing List
> Subject: [S2] How do I get radio buttons to show vertically
> 
> I am using the following tag in my jsp
> 
>  
> 
> <s:radio list="someMappedList" name="radioButtonSelected"/>
> 
>  
> 
> Currently, my map has two entries.  The radios are displayed on the same
> line...I would like them displayed on 2 separate lines...Is there an
> easy way to do this???
> 
>  
> 
> Thanks,
> 
> Charbel
> 
>  
> 
>  
> 
> 
> ---------------------------------------------------------------------
> 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


RE: [S2] How do I get radio buttons to show vertically

Posted by Charbel Abdul-Massih <ca...@soundbite.com>.
Guru,

The HTML that's outputted by struts is like this (with the "simple"
theme)

<input type="radio" name="testRadio" id="testRadio1" value="all"
class="radioB"/><label for="testRadio1">label 1</label>

<input type="radio" name="testRadio" id="testRadio2" value="prev"
class="radioB"/><label for="testRadio2">label 2</label>

Using the "display:block" would put my radios on sperate lines, but also
put the labels for the radios on separate lines as well...I want the
radio and label associated with it to stay on the same line...any other
suggestions?

Thanks,
Charbel

-----Original Message-----
From: Raghupathy, Gurumoorthy
[mailto:Gurumoorthy.Raghupathy@nielsen.com] 
Sent: Thursday, May 31, 2007 11:11 AM
To: Struts Users Mailing List
Subject: RE: [S2] How do I get radio buttons to show vertically

Apply a style sheet class which has "display:block" .... 
http://www.w3schools.com/css/pr_class_display.asp

Google is your best friend :)

Guru

-----Original Message-----
From: Charbel Abdul-Massih [mailto:cabdulmassih@soundbite.com] 
Sent: 31 May 2007 15:16
To: Struts Users Mailing List
Subject: [S2] How do I get radio buttons to show vertically

I am using the following tag in my jsp

 

<s:radio list="someMappedList" name="radioButtonSelected"/>

 

Currently, my map has two entries.  The radios are displayed on the same
line...I would like them displayed on 2 separate lines...Is there an
easy way to do this???

 

Thanks,

Charbel

 

 


---------------------------------------------------------------------
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


RE: [S2] How do I get radio buttons to show vertically

Posted by "Raghupathy, Gurumoorthy" <Gu...@nielsen.com>.
Apply a style sheet class which has "display:block" .... 
http://www.w3schools.com/css/pr_class_display.asp

Google is your best friend :)

Guru

-----Original Message-----
From: Charbel Abdul-Massih [mailto:cabdulmassih@soundbite.com] 
Sent: 31 May 2007 15:16
To: Struts Users Mailing List
Subject: [S2] How do I get radio buttons to show vertically

I am using the following tag in my jsp

 

<s:radio list="someMappedList" name="radioButtonSelected"/>

 

Currently, my map has two entries.  The radios are displayed on the same
line...I would like them displayed on 2 separate lines...Is there an
easy way to do this???

 

Thanks,

Charbel

 

 


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org