I don't think this would work in this case. The @InvokeListener component is
called on the server side, before the rendered response is flushed to the
client. What is discussed here is having a listener invoked after the page
is rendered on the client side, typically for a wait screen that will keep
displaying an animated gif until a long database transaction completes on
the server side (at least that is why I needed this).

2006/10/26, Daniel Tabuenca <[EMAIL PROTECTED]>:

Why not just use an @InvokeListener component as the last component in
your page?


On 10/26/06, Christian Dutaret <[EMAIL PROTECTED]> wrote:
> I tried to achieve the same thing some time ago, and I couldn't find
> anything that would work with dojo and EventListeners.
> As you mentioned, this is probably due to tapestry connect events being
> called _after_ any point where we could insert any custom js.
>
> The workaround I found to work perfectly is use contrib:XTile component
> instead, with a small js script that calls the XTile generated js
function
> at the bottom of the page
>
> hth
> Ch.
>
> 2006/10/26, Peter Beshai <[EMAIL PROTECTED]>:
> >
> > Oh, I should've mentioned I tried that already. It doesn't give an
error
> > on
> > page load, but it also doesn't call the listener. It gives this error
when
> > I
> > try calling it manually:
> >
> > >>>dojo.byId("mockHidden").click()
> > Error: buildTargetProperties() Unknown target type:[object
HTMLDocument]
> >
> > I have tried making the mockHidden a Button (forgot this causes
> > EventListener to break
> > [https://issues.apache.org/jira/browse/TAPESTRY-1095]), TextField
(same
> > error), Submit button (works, but sends the page into an infinite
loop...
> > it
> > doesn't pick up that it should be asynchronous), a <span> (same
error),
> > and
> > currently a Checkbox.
> >
> > Also, onclick() -worked- after the page had loaded and I tried calling
it
> > manually.
> >
> > Peter Beshai
> >
> > >From: "Karthik N" <[EMAIL PROTECTED]>
> > >Reply-To: "Tapestry users" <users@tapestry.apache.org>
> > >To: "Tapestry users" <users@tapestry.apache.org>
> > >Subject: Re: Call listener after page appears on screen
> > >Date: Thu, 26 Oct 2006 20:25:55 +0530
> > >
> > >please try click() instead of onclick()
> > >
> > >On 10/26/06, Peter Beshai <[EMAIL PROTECTED]> wrote:
> > >>
> > >>Is there an easy way of calling a listener after the page appears
> > >>(rendered)
> > >>on screen? I couldn't think of one, and so I tried having adding an
> > event
> > >>to
> > >>the onload of the page:
> > >>
> > >><script type="text/javascript">
> > >>dojo.event.connect(window, "onload",dojo.byId
("mockHidden").onclick());
> > >></script>
> > >>
> > >>or
> > >>
> > >><script type="text/javascript">
> > >>dojo.addOnLoad(function(e){ dojo.byId("mockHidden").onclick() });
> > >></script>
> > >>
> > >>where mockHidden is a component that has an eventlistener (the
listener
> > I
> > >>want to have called after the page is loaded) attached to it in my
.java
> > >>file. If I call dojo.byId("mockHidden").onclick() from firebug's
> > console,
> > >>it
> > >>works, but when the page loads it says :: dojo.byId
> > ("mockHidden").onclick
> > >>is
> > >>not a function.
> > >>
> > >>I figured that was because tapestry connects the event at the end of
the
> > >>page (and that <script> block is somewhere before that). Is there
any
> > way
> > >>of
> > >>having the javascript called AFTER tapestry has connected the
event?? Or
> > >>is
> > >>there another way of accomplishing this goal?
> > >>
> > >>Thanks,
> > >>Peter Beshai
> > >>
> > >>_________________________________________________________________
> > >>Voyez vos amis en faisant un appel vidèo dans Windows Live Messenger
> > >>http://imagine-msn.com/messenger/launch80/default.aspx?locale=fr-ca
> > >>
> > >>
> >
>>---------------------------------------------------------------------
> > >>To unsubscribe, e-mail: [EMAIL PROTECTED]
> > >>For additional commands, e-mail: [EMAIL PROTECTED]
> > >>
> > >>
> > >
> > >
> > >--
> > >Thanks, Karthik
> >
> > _________________________________________________________________
> > Découvrez Live Search de votre PC ou de votre appareil mobile dès
> > aujourd'hui. http://www.live.com/?mkt=fr-ca
> >
> >
> > ---------------------------------------------------------------------
> > 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