aspose file tools*
The moose likes Struts and the fly likes Doubt in checkboxlist Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Doubt in checkboxlist" Watch "Doubt in checkboxlist" New topic
Author

Doubt in checkboxlist

Sakthi Priya
Greenhorn

Joined: Apr 02, 2009
Posts: 26
I want to create list of checkboxes using s:checkboxlist tag, where in the properties has to read from Application Resources property file. As the values are static i dont want to populate the list in my action class and display it in jsp. Please let me know how can i do it? I'm using as



for displaying single property the above code is working fine.



which is not working.
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

That's not a valid OGNL expression--you're opening it twice. Remove the second "%{".
Sakthi Priya
Greenhorn

Joined: Apr 02, 2009
Posts: 26
And my another doubt is :

Is there a way to set the width / alignment of each checkbox among the checkbox list. When i'm displaying some 20-30 checkboxes, next to next checkboxes are getting displayed and looking ugly.

It is better if i come to know how can i set to display only 3 checkboxes with lables in a row

Thanks
Sakthi Priya
Greenhorn

Joined: Apr 02, 2009
Posts: 26
Yes, its working. But only the lastly given label is displaying with only one checkbox. when i give as


only one checkbox is displayed with label First Name

David Newton wrote:That's not a valid OGNL expression--you're opening it twice. Remove the second "%{".
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

Try without the "%".
Sakthi Priya
Greenhorn

Joined: Apr 02, 2009
Posts: 26
No David, its not working. I tried as


and also


Getting the below eror:
SEVERE: Servlet.service() for servlet jsp threw exception
tag 'checkboxlist', field 'list', name 'downloadColList': The requested list key '%{getText('employee.label.number'), {getText('employee.label.extension')}' could not be resolved as a collection/array/map/enumeration/iterator type. Example: people or people.{name} - [unknown location]
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

That's odd, they both have "%" characters, which I suggested you try removing.
Sakthi Priya
Greenhorn

Joined: Apr 02, 2009
Posts: 26
Yes David, It worked



Thanks
Sakthi Priya
Greenhorn

Joined: Apr 02, 2009
Posts: 26
And do you have any idea on the other doubt that i asked?


Is there a way to set the width / alignment of each checkbox among the checkbox list. When i'm displaying some 20-30 checkboxes, next to next checkboxes are getting displayed and looking ugly.

It is better if i come to know how can i set to display only 3 checkboxes with lables in a row

 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Doubt in checkboxlist