You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by DJR <ji...@gmail.com> on 2007/11/29 06:00:50 UTC
Pitfall of , etc. tags in Struts2???
Well, the problem comes from a real project we're developing by Struts2
framework.
We want to achieve the effect below:
http://www.nabble.com/file/p14019492/rightresult.png
Now we will use <s:select> tag to achieve the above effect, our code is:
----------------------------------------------------
<table width="400" border="1" bordercolor="black">
<tr>
<td>item1</td>
<td>
<s:select list="%{'111','222'}"></s:select>
</td>
</tr>
<tr>
<td>item2</td>
<td>
<s:select list="%{'333','444'}"></s:select>
</td>
</tr>
</table>
--------------------------------------------------------
But to our suprise, the result happens to be:
http://www.nabble.com/file/p14019492/wrongresult.png
According to the requirement of the project, we do not want to use the label
attribute of <s:select> tag,
and we begin to find that the above problems alse exist in the tags like
<s:radio>, <s:text> etc.
when we use them in <table>...</table> and do not use their label attribute.
How does the problem happen and how to solve it???
--
View this message in context: http://www.nabble.com/Pitfall-of-%3Cs%3Aselect%3E%2C-%3Cs%3Aradio%3E-etc.-tags-in-Struts2----tf4895137.html#a14019492
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
Problem Solved!
Posted by DJR <ji...@gmail.com>.
Thanks, Shoaib Gauhar. Your code does help us a lot. With "theme = simple",
the tag can produce the right result.
Shoaib Gauhar wrote:
>
> Try the following code.
>
> <table width="400" border="1" bordercolor="black">
> <tr>
> <td>item1</td>
> <td>
> <s:select list="%{'111','222'}" theme="simple"></s:select>
> </td>
> </tr>
> <tr>
> <td>item2</td>
> <td>
> <s:select list="%{'333','444'}" theme="simple"></s:select>
> </td>
> </tr>
> </table>
>
>
> ----- Original Message ----
> From: DJR <ji...@gmail.com>
> To: user@struts.apache.org
> Sent: Thursday, November 29, 2007 10:00:50 AM
> Subject: Pitfall of <s:select>, <s:radio> etc. tags in Struts2???
>
>
> Well, the problem comes from a real project we're developing by Struts2
> framework.
> We want to achieve the effect below:
> http://www.nabble.com/file/p14019492/rightresult.png
> Now we will use <s:select> tag to achieve the above effect, our code is:
> ----------------------------------------------------
> <table width="400" border="1" bordercolor="black">
> <tr>
> <td>item1</td>
> <td>
> <s:select list="%{'111','222'}"></s:select>
> </td>
> </tr>
> <tr>
> <td>item2</td>
> <td>
> <s:select list="%{'333','444'}"></s:select>
> </td>
> </tr>
> </table>
> --------------------------------------------------------
> But to our suprise, the result happens to be:
> http://www.nabble.com/file/p14019492/wrongresult.png
> According to the requirement of the project, we do not want to use the
> label
> attribute of <s:select> tag,
> and we begin to find that the above problems alse exist in the tags like
> <s:radio>, <s:text> etc.
> when we use them in <table>...</table> and do not use their label
> attribute.
> How does the problem happen and how to solve it???
>
>
> --
> View this message in context:
> http://www.nabble.com/Pitfall-of-%3Cs%3Aselect%3E%2C-%3Cs%3Aradio%3E-etc.-tags-in-Struts2----tf4895137.html#a14019492
> 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
>
>
>
> ____________________________________________________________________________________
> Be a better sports nut! Let your teams follow you
> with Yahoo Mobile. Try it now.
> http://mobile.yahoo.com/sports;_ylt=At9_qDKvtAbMuh1G1SQtBI7ntAcJ
>
> ---------------------------------------------------------------------
> 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/Pitfall-of-%3Cs%3Aselect%3E%2C-%3Cs%3Aradio%3E-etc.-tags-in-Struts2----tf4895137.html#a14019742
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