You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Qbyte Consulting <qb...@gmail.com> on 2016/10/01 17:58:50 UTC

running JS to attach client events to a zones content after it's rendered

Hi,

I have a zone with some conditional content so it doesn't appear when the
page is initially loaded but is added later when the zone is rerendered
with a flag set true.

There is a button in the zone that I need to attach jquery events handling
functions too from a module. How do I fire the module function each after
any time the zone is rendered?

John

Re: running JS to attach client events to a zones content after it's rendered

Posted by Chris Poulsen <ma...@nesluop.dk>.
You can bind the button listener on an enclosing element ( document for
example ) or you can bind on one of the zone update events and wire up
things from there (I think i found some tapestry js components that uses a
function called "scan" or "scanner" to initialize dynamically loaded stuff
- there are helpers for the "scanner pattern" in t5/core/dom iirc.

I tend to prefer binding the handlers on the document whenever possible.

-- 
Chris

On Sat, Oct 1, 2016 at 7:58 PM, Qbyte Consulting <qb...@gmail.com>
wrote:

> Hi,
>
> I have a zone with some conditional content so it doesn't appear when the
> page is initially loaded but is added later when the zone is rerendered
> with a flag set true.
>
> There is a button in the zone that I need to attach jquery events handling
> functions too from a module. How do I fire the module function each after
> any time the zone is rendered?
>
> John
>