This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Struts and the fly likes EL with Struts Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "EL with Struts" Watch "EL with Struts" New topic
Author

EL with Struts

Ralf Schneider
Greenhorn

Joined: Dec 03, 2004
Posts: 4
Hi,

I need to access an indexed property inside a <logic:iterate> tag.

<logic:iterate id="col" indexId="i" name="sheetForm" property="cols"
type="de.fortu.ccdata.sheet.Column">
...
<util esignrule rule="${bean.editable[i] == false}" styleClass="readonly"/>
...
</logic:iterate>

The class behind "bean" has an ArrayList with a getter method

public boolean getEditable (int index)

The code above results in an exception saying:
javax.servlet.jsp.el.ELException: Unable to find a value for "editable" in object of class "de.fortu.ccdata.tree.LeaveNode" using operator "."

How do I have to modify my code to access the i-th element of that ArrayList?

Thanks,
Ralf.
Anthony Watson
Ranch Hand

Joined: Sep 25, 2003
Posts: 327
You should write a method for your bean that returns an ArrayList that takes no arguments. Then, you should loop through the elements in the ArrayList and call the getEditable() method on them.


Anthony W.<br />MCP, SCJP 1.4, SCJD, SCWCD 1.3, SCWCD 1.4, SCBCD
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: EL with Struts
 
Similar Threads
Value not returned to form inside logic:iterate
No getter method for property name of bean userList
Display data using Structs Tag
how to use html:checkbox and requestgetParameterValues() in association
Nested loops