• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

format the Struts 2 tag <s:checkboxlist> into a columned HTML table

 
Ranch Hand
Posts: 41
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Is it possible to format the Struts 2 tag <s:checkboxlist> into a columned HTML table instead of a wraparound list

<s:checkboxlist name="cust.communityList" theme="mytheme" cssStyle="vertical"
label="Are You Inteterested In"
list="{'WebSpere Consultuing','Portal Consulting','SOA/BPM Consulting','Content Management',
'DataPower Consulting','Information Management Services','Application Monitoring',
'Application Security','Migration to WebSphere','Application Testing','WebSphere Version Upgrade',
'JAM/Panther Consulting','IBM Software Procurement','XMLink/Progressions','Other'}" />
Scrot-2.png
[Thumbnail for Scrot-2.png]
 
Sheriff
Posts: 9707
43
Android Google Web Toolkit Hibernate IntelliJ IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
did you see the response you got here??
 
Jyothi Sree
Ranch Hand
Posts: 41
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Yes I did saw the response , it is displaying the items in a single column , but i want to display it in 2 or 3 columns like the one in the attachment ?

The freemarker template language is somewhat complex to understand it ,

Is there any other way so that i can change the view as i want in the jsp page . rather changing in the .ftl file ?

If not how do i understand the checkbox.ftl file in order to customise it ...


Thanks
 
Ranch Hand
Posts: 213
Eclipse IDE Tomcat Server Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I don't know of any other way since the layout of the checkboxlist is determined by the template. If you look at the example on the linked page, you will need to modify the code in red to insert the br tag afther every second checkbox instead of every checkbox.

The fremarker documetation can be found here
 
Ankit Garg
Sheriff
Posts: 9707
43
Android Google Web Toolkit Hibernate IntelliJ IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
If you want an easy way to do this, then you can use simple theme with your checkboxlist (that way no extra HTML is generated by Struts) and use custom CSS using the cssStyle or cssClass to arrange your checkboxes. You can use float:left so that they will try to fit in one row but if there is only enough space to fit two in a row, they'll automatically drop into the next row...
 
Author
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
FreeMarker, for what it's worth, is *very* simple, especially compared to JSP.
 
No matter how many women are assigned to the project, a pregnancy takes nine months. Much longer than this tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic