Thanks Kent,
> class YourPageClass {
> void dispatch(IRequestCycle cycle) {
> String listenerName = (String)cycle.getServiceParameters()[0];
> ...
> }
> }
But what do I do after
String listenerName = (String)cycle.getServiceParameters()[0];
Use reflection to invoke the Method that matches the listenerName?
or the less dynamic,
if (listenerName.equals("blah"))
blah(cycle);
else if ...
Kent Tong wrote:
sean gao <sean.gao <at> secpay.com> writes:
<div jwcid="links <at> Foreach" source="menuNode" value="menuItem">
<a jwcid=" <at> DirectLink"
listener="ognl:listeners.getListener(menuItem.listenerName)">
<span jwcid=" <at> Insert"
value="ognl:getMessage(menuItem.pageName)"/>
</a>
</div>
It seems that menuItem was "null", but how come menuItem.pageName works?
Because the listener is evaluated in the request handling phase (only
the DirectLink but not the Foreach), while the Insert's value is
evaluated on render.
is this a scope or page rewinding issue? How can I solve it (Tapestry 3.03)?
Try:
<div jwcid="links <at> Foreach" source="menuNode" value="menuItem">
<a jwcid=" <at> DirectLink"
listener="ognl:listeners.dispatch"
parameters="ognl:menuItem.listenerName">
<span jwcid=" <at> Insert"
value="ognl:getMessage(menuItem.pageName)"/>
</a>
</div>
class YourPageClass {
void dispatch(IRequestCycle cycle) {
String listenerName = (String)cycle.getServiceParameters()[0];
...
}
}
--
Author of a book for learning Tapestry (http://www.agileskills2.org/EWDT)
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]