struts-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Laurie Harper <lau...@holoweb.net>
Subject Re: BUG - Struts ui components inside <table> mess the layout.
Date Fri, 30 Mar 2007 21:46:34 GMT
Firstly, this is really a question for the users list. Please follow up 
there if you have further questions. That said:

Felipe Rodrigues wrote:
> Hi everyone,
> 
> I'm using a <table> to organize the layout of my form. I'd like to get all
> components in one line, so, I'm using this code:
> <table>
>   <tr>
>     <td>some text</td>
>     <td>other text</td>
>     <td><s:textfield name="any" size="30" required="true"/></td>
>     <td><s:checkbox name="check" value="OUT"></s:checkbox></td>
>     <td><s:checkbox name="check2" value="INV"></s:checkbox></td>
>   </tr>
> </table>
> 
> But when rendering the page, struts put each component under the other. I
> checked out the generated code and found some <tr> tags lost in middle of my
> <td> tags. These <tr> tags was added by struts.
> 
> Is that a real bug? Any idea?

No, it's not a bug. It sounds like you're using the 'xhtml' theme, which 
is designed to automatically lay your forms out using table. For your 
use case, you'll need to use the 'simple' theme instead.

Be aware that you'll need to take care of showing field labels, error 
messages, etc. yourself when using the 'simple' theme.

See the documentation for more:

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

L.


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


Mime
View raw message