This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Struts and the fly likes checkboxlist alignment Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "checkboxlist alignment" Watch "checkboxlist alignment" New topic
Author

checkboxlist alignment

abi chitnis
Greenhorn

Joined: Feb 13, 2009
Posts: 11
It is possible, in checkboxlist in struts2, to arrange checkboxes vertically?
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

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

Joined: Feb 13, 2009
Posts: 11
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

Joined: Sep 29, 2008
Posts: 12617

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

Joined: May 11, 2009
Posts: 1
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>
 
Don't get me started about those stupid light bulbs.
 
subject: checkboxlist alignment
 
Similar Threads
Doubt in checkboxlist
checkboxlist alignment
About checkboxList...