Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Doubt in checkboxlist

 
Sakthi Priya
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That's not a valid OGNL expression--you're opening it twice. Remove the second "%{".
 
Sakthi Priya
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 26
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Try without the "%".
 
Sakthi Priya
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That's odd, they both have "%" characters, which I suggested you try removing.
 
Sakthi Priya
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes David, It worked



Thanks
 
Sakthi Priya
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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

 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic