It's not a secret anymore!*
The moose likes Struts and the fly likes set value of a property as another property Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "set value of a property as another property" Watch "set value of a property as another property" New topic
Author

set value of a property as another property

Michael Brown
Greenhorn

Joined: May 05, 2008
Posts: 27
Hello to everyone!

I have a problem using struts2 custom tags.

I have a variable called data in my action class. data is an ArrayList of ArrayLists
Also, I have a variable called useIndex that says which element of every inner ArrayList will be send to java script function doSomething(element)

Now, I want to iterate through these ArrayLists:

<!-- I started creating table ...



I tried putting another <s:property value="useIndex" /> in it , something like this:

<s:property value="#row[ <s:property value="useIndex" /> ]" />

but it cannot be put there...

Does anyone has a solution to this problem?
Thanks.

Ankit Garg
Sheriff

Joined: Aug 03, 2008
Posts: 9291
    
  17

Did you try %{useIndex}


SCJP 6 | SCWCD 5 | Javaranch SCJP FAQ | SCWCD Links
Michael Brown
Greenhorn

Joined: May 05, 2008
Posts: 27
Yes, I did, but it doesn't work...

 
It is sorta covered in the JavaRanch Style Guide.
 
subject: set value of a property as another property
 
Similar Threads
s:iterator problem...
struts2 custom components checkbox JSP
[Struts2] Setting up preselection in s:select tag
back button issue...
Struts 2 iterating enums