• 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

checkboxlist alignment

 
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
It is possible, in checkboxlist in struts2, to arrange checkboxes vertically?
 
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
Yes, via several techniques, including modifying the existing template, creating a new one, using the "simple" theme and building the list manually, using plain old HTML checkbox tags, or by using CSS.
 
abi chitnis
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am using following to create checkboxes dynamically. These checkboxes are arranged horizontally. Is there any way I can arrange these in vertically.



Thank you

Abi
 
David Newton
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
Yes, via several techniques, including modifying the existing template, creating a new one, using the "simple" theme and building the list manually, using plain old HTML checkbox tags, or by using CSS.
 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello,

This answer is given by keeping struts 2 in mind.

To complete this task include required .ftl files in directory suitable to you, and the list of those file is given below:

checkboxlist.ftl
common-attributes.ftl
form-close.ftl
label.ftl
optgroup.ftl
scripting-events.ftl
select.ftl

and after placing these files in a directory change one file that is checkboxlist.ftl

<label for="${parameters.name?html}-${itemCount}" class="checkboxLabel">${itemValue?html}</label>


you just have to replace the code line shown above. I have just added one BR tag at the end of the line.

and after doing these you have to mention 3 attributes of the <s:checkboxlist tag, and those tags are

templateDir
template
theme

for above things to work I have placed required .ftl files in a path com/os/util/strutsTemplates/highq
and thats why value of the above given attribute would be

templateDir="com/os/util/strutsTemplates" template="checkboxlist.ftl" theme="highq"

see here my last folder is highq and the same folder name would be the value for the theme attribute. Keep in mind that you have to specify value of the attribute based on the path where you have copied your .ftl files.

I hope above given information will help you to arrange ><s:checkboxlist in a vertical order.

Thanks & Regards,

Ashish>
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic