[Client-side scripting] onRezise()

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

[Client-side scripting] onRezise()

David Leangen

I just discovered client-side scripting with Tapestry.

Very nice!!


I am now going to use it extensively.


However, I am having one problem: I can't figure out how to implement the
onResize() that usually works with the body tag:

<body onResize="someFunction()">
 ...
</body>


I tried, both in the <body> and the <initialization> sections:

  window.onResize = function () { someFunction() };

and

  document.body.onResize = function () { someFunction() };


I've tried playing around with these in quite a few different ways, but
can't seem to get it to work.


Can anybody tell me how this works?


Thanks!

Dave



---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: [Client-side scripting] onRezise()

Andreas Andreou-4
David Leangen wrote:

>I just discovered client-side scripting with Tapestry.
>Very nice!!
>I am now going to use it extensively.
>However, I am having one problem: I can't figure out how to implement the
>onResize() that usually works with the body tag:
><body onResize="someFunction()">
> ...
></body>
>I tried, both in the <body> and the <initialization> sections:
>  window.onResize = function () { someFunction() };
>and
>  document.body.onResize = function () { someFunction() };
>
>  
>
Well, I usually use the Body component for outputing the body tag, so I
can just use:
<body jwcid="@Body" onResize="doSomething();">
The value of onResize can also be an ognl expression if you want that...

>I've tried playing around with these in quite a few different ways, but
>can't seem to get it to work.
>
>
>Can anybody tell me how this works?
>
>
>Thanks!
>
>Dave
>
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: [hidden email]
>For additional commands, e-mail: [hidden email]
>
>
>  
>


---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: [Client-side scripting] onRezise()

Bryan Lewis
In reply to this post by David Leangen
How about this:

    <script type="text/javascript">
      function doSomething() { alert("got here"); }
    </script>

    <body jwcid="@Body" onresize="doSomething();">  



----- Original Message -----
From: "David Leangen" <[hidden email]>
To: <[hidden email]>
Sent: Monday, May 16, 2005 11:01 AM
Subject: [Client-side scripting] onRezise()


>
> I just discovered client-side scripting with Tapestry.
>
> Very nice!!
>
>
> I am now going to use it extensively.
>
>
> However, I am having one problem: I can't figure out how to implement the
> onResize() that usually works with the body tag:
>
> <body onResize="someFunction()">
>  ...
> </body>
>
>
> I tried, both in the <body> and the <initialization> sections:
>
>   window.onResize = function () { someFunction() };
>
> and
>
>   document.body.onResize = function () { someFunction() };
>
>
> I've tried playing around with these in quite a few different ways, but
> can't seem to get it to work.
>
>
> Can anybody tell me how this works?
>
>
> Thanks!
>
> Dave
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

RE: [Client-side scripting] onRezise()

David Leangen

Hi, Bryan,

Thanks for the suggestion. So, you're suggesting that this can only be done
outside of the Tapestry scripting framework?

If so, I'll give that a try. IIUC (I don't know the internals of javascript
all that well) the contents of doSomething() will only be evaluated at
runtime, so I can still make references to functions that have not yet been
defined. All the stuff that it refers to will only be defined *after* the
body tag, as per the Tapestry approach to scripting. If that is the case,
and Tapestry doesn't support the onResize event, then I guess your approach
is the only way.


Cheers,
Dave



> -----Original Message-----
> From: Bryan Lewis [mailto:[hidden email]]
> Sent: 17 May 2005 22:55
> To: Tapestry users; [hidden email]
> Subject: Re: [Client-side scripting] onRezise()
>
>
> How about this:
>
>     <script type="text/javascript">
>       function doSomething() { alert("got here"); }
>     </script>
>
>     <body jwcid="@Body" onresize="doSomething();">
>
>
>
> ----- Original Message -----
> From: "David Leangen" <[hidden email]>
> To: <[hidden email]>
> Sent: Monday, May 16, 2005 11:01 AM
> Subject: [Client-side scripting] onRezise()
>
>
> >
> > I just discovered client-side scripting with Tapestry.
> >
> > Very nice!!
> >
> >
> > I am now going to use it extensively.
> >
> >
> > However, I am having one problem: I can't figure out how to
> implement the
> > onResize() that usually works with the body tag:
> >
> > <body onResize="someFunction()">
> >  ...
> > </body>
> >
> >
> > I tried, both in the <body> and the <initialization> sections:
> >
> >   window.onResize = function () { someFunction() };
> >
> > and
> >
> >   document.body.onResize = function () { someFunction() };
> >
> >
> > I've tried playing around with these in quite a few different ways, but
> > can't seem to get it to work.
> >
> >
> > Can anybody tell me how this works?
> >
> >
> > Thanks!
> >
> > Dave
> >
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: [hidden email]
> > For additional commands, e-mail: [hidden email]
> >


---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

RE: [Client-side scripting] onRezise()

David Leangen
In reply to this post by Andreas Andreou-4

> <body jwcid="@Body" onResize="doSomething();">
> The value of onResize can also be an ognl expression if you want that...

Ok, simple enough.

Thanks!



---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]