This worked

public void dispatch(IRequestCycle cycle) {
        String listenerName = (String)cycle.getServiceParameters()[0];
((IActionListener)getListeners().getListener(listenerName)).actionTriggered(this,cycle);
        }



Kent Tong wrote:
sean gao wrote:
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 ...

Reflection should be fine.




---------------------------------------------------------------------
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]

Reply via email to