Win a copy of Five Lines of Code this week in the OO, Patterns, UML and Refactoring forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
  • Piet Souris
  • Frits Walraven
  • Carey Brown

Convert Html fields to Struts2 tags

Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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:
<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>

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 ???

Ranch Hand
Posts: 281
Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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...
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
    Bookmark Topic Watch Topic
  • New Topic