You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tapestry.apache.org by Swapna <sw...@yahoo.com> on 2014/03/11 14:09:59 UTC

Event link gets changed after outer zone/table refresh

I have an eventLink inside the table, the event link id gets changed once the table zone is refreshed. once zone refreshed, event handler doesn't get called.
  For what I have seen, is the event link id getting changed.

Any help is appreciated.

<t:zone t:id="tableZone" id="tableZone">
 <t:jquery.datatable ........
         rowIndex = "currentIndex"
      ---------------------
      <p:btnCell>
                <t:eventLink t:event="balExpand" t:zone="balZone" t:context="${currentIndex}" ></t:eventLink>
      </p:btnCell>
</t:jquery.datatable>
</t:zone>

<t:zone t:id = "balZone" id="balZone">
......
</t:zone>


public Object onBalExpand(String currentIndex) {
    return balZone;
}

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tapestry.apache.org
For additional commands, e-mail: dev-help@tapestry.apache.org


Re: Event link gets changed after outer zone/table refresh

Posted by Luke Wilson-Mawer <lu...@gmail.com>.
Tapestry puts some random chars at the end of the id when there's an in
place update. This is to stop id clashes as far as I understand.


On Tue, Mar 11, 2014 at 1:09 PM, Swapna <sw...@yahoo.com> wrote:

> I have an eventLink inside the table, the event link id gets changed once
> the table zone is refreshed. once zone refreshed, event handler doesn't get
> called.
>   For what I have seen, is the event link id getting changed.
>
> Any help is appreciated.
>
> <t:zone t:id="tableZone" id="tableZone">
>  <t:jquery.datatable ........
>          rowIndex = "currentIndex"
>       ---------------------
>       <p:btnCell>
>                 <t:eventLink t:event="balExpand" t:zone="balZone"
> t:context="${currentIndex}" ></t:eventLink>
>       </p:btnCell>
> </t:jquery.datatable>
> </t:zone>
>
> <t:zone t:id = "balZone" id="balZone">
> ......
> </t:zone>
>
>
> public Object onBalExpand(String currentIndex) {
>     return balZone;
> }
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: dev-help@tapestry.apache.org
>
>

Re: Event link gets changed after outer zone/table refresh

Posted by Thiago H de Paula Figueiredo <th...@gmail.com>.
Answering in the users mailing list, as it's the right place for this  
discussion.

On Tue, 11 Mar 2014 10:09:59 -0300, Swapna <sw...@yahoo.com> wrote:

> I have an eventLink inside the table, the event link id gets changed  
> once the table zone is refreshed. once zone refreshed, event handler  
> doesn't get called.

You can provide an id yourself to avoid problems, but I don't think that's  
related to the problem.

>   For what I have seen, is the event link id getting changed.
>
> Any help is appreciated.
>
> <t:zone t:id="tableZone" id="tableZone">
>  <t:jquery.datatable ........
>          rowIndex = "currentIndex"
>       ---------------------
>       <p:btnCell>
>                 <t:eventLink t:event="balExpand" t:zone="balZone"  
> t:context="${currentIndex}" ></t:eventLink>

Never, never, never ever use ${} expansions to bind parameters. It's wrong  
or useless in 100% of the times. It should have been  
t:context="currentIndex".

> public Object onBalExpand(String currentIndex) {
>     return balZone;
> }

Never return a zone instance directly: return zone.getBody(). That's  
probably the source of your problem.

-- 
Thiago H. de Paula Figueiredo
Tapestry, Java and Hibernate consultant and developer
http://machina.com.br

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org