You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Rohan Kalyan <rk...@indygosoft.com> on 2008/04/04 10:46:13 UTC

Passing parameter to @EventListener

hi all,

we are migrating from tapestry 4.0.2 to 4.1.5
while migrating we are using @EventListener annotation instead of
@AjaxEventSubmit,
we were passing parameter to @AjaxEventSubmit in 4.0.2,
and in @EventListener annotation we want to pass the same parameter.
I tried setting the parameter through javascript and also  tried getting it
through requestCycle and @hidden component but was in vain.
Please provide me any way to pass the parameter to @EventListener.

*Tapestry 4.0.2 code*
<span jwcid="procGroupScript@AjaxEventSubmit"
            action="listener:fillGroup"
            parameters="ognl:diag"
            updateComponents="ognl:{'selectedDiag'}" async="true"/>
      <effects="template:{highlight:{any:'[255,255,184], 500, 500'}}"/>

public void fillGroup(){
        LOG.debug("diag received " );
        setProc(null);
        setDiag(getDiag());
    }

*Tapestry 4.1.5 code*
<select jwcid="diagField" id="diagChanged" size="8"/>

@EventListener(elements = "diagChanged", events = "onchange")
    public void watchText(IRequestCycle cycle)
    {
        LOG.debug("diag received " );
        setProc(null);

        if(getDiag()== null) {
             setDiag(getDiag);
        }
        cycle.getResponseBuilder().updateComponent("selectedDiag");

    }





thanks in advance,
-- 
Rohan Kalyan
Indygo - www.indygo.in