You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by "Wei, Mei" <Me...@isd.sccgov.org> on 2008/01/16 22:43:03 UTC

question about struts 2 and table layout

Hi,

 

I am wondering in the Validation example quiz-ajax.jsp (which is in the
struts 2.0's tutorial showcase
http://www.planetstruts.org/struts2-showcase/showcase.action), is there
a way to arrange the table into two columns. That means to make field
"name" and "age" on the same row.

 

Here is the snippet from quiz-ajax.jsp

<%@ taglib prefix="s" uri="/struts-tags" %>

 

<!-- START SNIPPET: ajaxValidation -->

 

<html>

<head>

    <title>Validation - Basic</title>

    <s:head theme="ajax"/>

</head>

 

<body>

 

<s:form method="post" validate="true" theme="ajax">

    <s:textfield label="Name" name="name"/>

    <s:textfield label="Age" name="age"/>

    <s:textfield label="Favorite color" name="answer"/>

    <s:submit/>

</s:form>

 

</body>

</html>

 

<!-- END SNIPPET: ajaxValidation -->

 

Any help is appreciated.

Thanks,

Mei 


Re: question about struts 2 and table layout

Posted by Dave Newton <ne...@yahoo.com>.
--- "Wei, Mei" <Me...@isd.sccgov.org> wrote:
> [...] is there a way to arrange the table into two columns.

You'll want to explore themes and templates [1].

The nutshell version is that you'll probably want to either (a) use the
"simple" theme on your <s:textfield.../> elements or (b) modify a template.
The default theme, as you've noticed, assumes a one-field-per-row layout.

One disadvantage of using the "simple" theme is that you'll lose some of the
automagic error handling provided in the default theme.

d.

[1] http://struts.apache.org/2.x/docs/themes-and-templates.html
[tags: s2, themes, forms, form tags]



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