Adding Multiple text field in one row using struts2 tag

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Adding Multiple text field in one row using struts2 tag

manoj.sharma135
Hi All,

I have to display two text fields in a row using struts2 tag. Using struts2 tags, it adds each component in next row.
like...

<s:form action="UserAction" method="post" validate="true">
<s:submit/>
</s:form>
<s:textfield label="First Name" name="fname" required="true"/>
<s:textfield label="Last Name" name="lname" required="true"/>
or
<s:form action="UserAction" method="post" validate="true">
<s:textfield label="First Name" name="fname" required="true"/>
<s:textfield label="Last Name" name="lname" required="true"/>
<s:submit/>
</s:form>

This code showing me both the text field in separate row.
First Name <text field> 
Last Name <text field>

I want them to display on the same row.
like...

First Name <text field> Last Name <text field>

How I can do that?
Reply | Threaded
Open this post in threaded view
|

Re: Adding Multiple text field in one row using struts2 tag

vinodkashyap
Administrator
HEY

This is because struts2 uses two column layout as a default theme
You have to make new theme or use simple

theme="simple" for page
Reply | Threaded
Open this post in threaded view
|

Re: Adding Multiple text field in one row using struts2 tag

Ananth
Thanks a lot mr.vinodkashyap...:-)))
Reply | Threaded
Open this post in threaded view
|

Re: Adding Multiple text field in one row using struts2 tag

Ananth
In reply to this post by vinodkashyap
But label name is not displaying for textfield in that theme....is there any solution for that...?Thanks in advance..