tags:

views:

52

answers:

1

Why is it that the s:textfield is placed on bottom when I insert it in between other HTML elements inside a form? How can I fix this?

<label><span class="required">*</span>First name</label>
                <input type="text" id="firstName" name="firstName" value=""><br>

                <div>
                <s:select id="selectDrop" list="list" name="list"/>
                </div>

                <label><span class="required">*</span>Last name</label>
                <input type="text" id="lastName" name="lastName"><br>

Result on browser:
First Name
Last Name
"The drop down element"

A: 

Ok I actually was able to solve by adding the them="simple" in the s:form element.

<s:form id="registrationForm" action="/registration/.action" method="post" theme="simple">

I guess if I don't add them property Struts2 UI components add their own stylesheet and therefore get weir behavior.

Marquinio
You can read about the themes here: http://struts.apache.org/2.1.6/docs/themes-and-templates.html
Nate