This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Struts and the fly likes Convert Html fields to Struts2 tags Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Convert Html fields to Struts2 tags" Watch "Convert Html fields to Struts2 tags" New topic
Author

Convert Html fields to Struts2 tags

kaleeswaran Gounder
Greenhorn

Joined: Jun 07, 2011
Posts: 4
I am new to struts2... I designed a page in plain html.. now i have use this html page in struts2 project.. how can i convert html field elements to Struts2 ui tags ??? My html page looks like:
<tr>
<td class="style4">**Customer Name***</td>
<td><input type="text" name="Scr_Inq_CName" class="body-fieldsTextFields" id="Scr_Inq_CName_id" tabindex="4" onkeypress="return CommonKeyPressIsAlpha(event);"/></td>
</tr>


I have assigned style(style4) to a label "Customer name" and style(body-fieldsTextFields) to text box.

When i use Struts-tag

When i see this page in firebug.
It displays text field with style(body-fieldsTextFields) applied, When i run project... But Customer name label is displayed in separate row <tr><td>Customer name</td></tr>.

And text field is displayed in below table row <tr>.

how to apply style4 to Customer name label and body-fieldsTextFields style to all textfields and also how can i make both label and text field to be displayed in same row ???

Thanks..
Robin John
Ranch Hand

Joined: Sep 10, 2008
Posts: 270

Struts 2 tags create their own table structure... so you cant do anything to remove them...

Good news: Struts2 comes with three themes: xhtml, simple and css_xhtml. Try exploring each of them, they might help..

You can also create your own custom themes, look HERE

Also try putting them in <div> tags...


Time is what we want the most, but what we use the worst. -- William Penn
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Convert Html fields to Struts2 tags
 
Similar Threads
Problem with Struts2 validation
Jsp is not displaying in Struts2
iterate problem in struts2
STRUTS2 Tabbed interface problem with Tiles tag in IE6
unable to do validation for select in struts2