• 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

html:checkbox probs

 
Ranch Hand
Posts: 152
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

Below is the code which i'm using.What I want is how do i pass the value eno to the top(eno) which basically returns a hashMap.How do I go about

<logic:iterate name="bookListForm" property="books" id="book">
<tr>
<td><bean:write name="book" property="eno" /></td>

<td><html:checkbox disabled="false" name="book" property="tops(eno)" />
</td>
</logic:iterate>
 
Ranch Hand
Posts: 123
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
top(eno) , is this a javaScript fuction on what ???
 
clyde melly
Ranch Hand
Posts: 152
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
tops(eno) is not javascript but getter and setter methods in the form bean.Already mentioned a HashMap.
 
Ranch Hand
Posts: 4864
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The short answer to your question is, you can't do it. The hashmap getter and setter were created for situations where you know the key in the hashmap, and can use a literal in the page to retrieve it. Nesting in Struts tags doesn't work. For example, the following:

property="tops(<bean:write name="book" property="eno" /> "

will not work.

I don't understand your application well enough to know, but sometimes it's just easier to use plain old HTML tags with scriptlets rather than trying to force Struts tags to handle odd situations. Another possibility would be to rewrite your Book bean in a way that would be more compatible with Struts tags.

Merrill
 
Oh sure, it's a tiny ad, but under the right circumstances, it gets bigger.
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic