Hey Drew,
I was playing will ognl selection today on some tapestry pages and found
what seems to be a bug.
First, the background.
I was using a looping component (table, for, foreach, etc. happens with
all of them), and had the following expression for the source:
source="ognl:courseList.{? @[EMAIL PROTECTED](visit.user,
#this) }"
courseList returns a list of courses from a query. Course implements the
"PermissionRequired" interface.
There are two static methods called "hasReadPermission". They are:
public static boolean hasReadPermission(User u, String permissionName);
public static boolean hasReadPermission(User u, PermissionRequired obj);
When the page /also/ implements the interface, the "PermissionRequired"
version of the method is called for each object in the list, and the
PermissionRequired object passed to the method is the current course in
the iterator, as expected.
But, when the page does /not/ implement the PermissionRequired interface,
the permissionName version of the method is called, and the string passed
in is the result of a call to page.toString().
So, if the page implements the interface, the #this reference refers to
the current value in the iterator (like the docs say it should). But if
the page does not, then #this refers to the page, and the page is coerced
into a string. The method is still called for every course in the list.
Thoughts?
Robert
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]