This week's book giveaway is in the OCPJP forum.
We're giving away four copies of OCA/OCP Java SE 7 Programmer I & II Study Guide and have Kathy Sierra & Bert Bates on-line!
See this thread for details.
The moose likes Struts and the fly likes Linking checkbox to textfield in nested? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCA/OCP Java SE 7 Programmer I & II Study Guide this week in the OCPJP forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Linking checkbox to textfield in nested?" Watch "Linking checkbox to textfield in nested?" New topic
Author

Linking checkbox to textfield in nested?

Karl Beowulph
Ranch Hand

Joined: May 31, 2004
Posts: 130
Howdy.

I've got a nested statement to go through a populated DTO and display the contents.

That part works fine, but what I'd like to do next is have a column of checkboxes / multiboxes. When the user clicks on the checkbox, I'd like to display the ID in an alert box.

Example
____________________
|Check | ID | Name |
|-------------------
| [] | 6 | Fred |
|-------------------
| [] | 12 | John |
|-------------------

When the user hits the first box, "6" would pop up on the screen etc.

This is my current (non-working) code.


When I do this, it literally displays "nested:write property="ID" ". Anyone have any ideas?

Any suggestions?
Junilu Lacar
Bartender

Joined: Feb 26, 2001
Posts: 4777
    
    8

<nested:multibox property ="SELECTED_ROW" value='<nested:write property="ID"/>' onklick="display(this.value)"/>

You can't nest tags like this. There may be a more straightforward way but I think you could do this:

<nested:writeNesting id="value" property="ID" />
<nested:multibox property ="SELECTED_ROW" value='<%= value %>' onklick="display(this.value)"/>
[ July 15, 2004: Message edited by: Junilu Lacar ]

Junilu - [How to Ask Questions] [How to Answer Questions]
Karl Beowulph
Ranch Hand

Joined: May 31, 2004
Posts: 130
Thanks, but I couldn't do that either, as I'm not going to know the values that are going in (it's a search result page).

I actually did find the solution, and it's much simpler then I thought. I just had to use the Bean:write using the name of my nested parameter.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Linking checkbox to textfield in nested?