This week's book giveaway is in the Clojure forum.
We're giving away four copies of Clojure in Action and have Amit Rathore and Francis Avila on-line!
See this thread for details.
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

checkboxlist alignment

 
abi chitnis
Greenhorn
Posts: 11
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It is possible, in checkboxlist in struts2, to arrange checkboxes vertically?
 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • 0
  • Mark post as helpful
  • send pies
  • 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
  • 0
  • Mark post as helpful
  • send pies
  • 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
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • 0
  • Mark post as helpful
  • send pies
  • 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.
 
Ashish Taank
Greenhorn
Posts: 1
  • 0
  • Mark post as helpful
  • send pies
  • 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>
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic