Struts uses "themes" to create the HTML/CSS layout of form elements. You should read up what you can on S2 themes.

Each theme uses a set of freemarker templates for the form tags. If you set your theme to simple on your form then all elements (textfield, button) would be on one line bit you would have to do your label yourself. I think you also lose the validation messages on the field with simple. You can also set the theme on individual form elements.

If you are feeling adventerous you can cuatomize the freemarker templates struts uses for its themes it create your own theme. Appworx does the former in the /templates directory.

-D

On May 13, 2009, at 11:13 PM, maker su <make...@gmail.com> wrote:

Hi there,
I have a .jsp with only 1 textfield and 1 button,so I'd like to align them in 1 line.
When i use s:textfield with key for validation ,as the following:

<s:form id="addFriendEmailForm" action="addFriendEmail" method="post" validate="true">

<s:textfield key="friendEmail" cssClass="text medium" cssStyle="margin-right: 5px" labelposition="left"/>
 <s:submit key="button.add" cssClass="button" theme="simple"/>

</s:form>

Here is my question:
1.The label,textfield,button don't align in 1 line.how to do if there are some .jsps with only 2 UIs like this ?
2.How to align the label vertical with the "div main" or "left 0px"?

Please Hint.
Thank you very much,
Mark Su





---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@appfuse.dev.java.net
For additional commands, e-mail: users-h...@appfuse.dev.java.net

Reply via email to