You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jetspeed-dev@portals.apache.org by Brad Gardner <bg...@gmail.com> on 2008/04/02 19:49:19 UTC

Event on portlet load

Is there a way to automatically run a script from a portlet when it loads on
the screen?  In a normal JSP page, I use the Javascript call: <body
onload="autosubmit();"> but in a portlet I'm not sure where I can place the
Javascript call to get it to fire off as the portlet loads since it is only
an html fragment instead of the entire page.

-- 
Brad Gardner

Re: Event on portlet load

Posted by Brad Gardner <bg...@gmail.com>.
That works perfectly, thanks!

On Wed, Apr 2, 2008 at 2:50 PM, David Sean Taylor <da...@bluesunrise.com>
wrote:

>
> On Apr 2, 2008, at 10:49 AM, Brad Gardner wrote:
>
>  Is there a way to automatically run a script from a portlet when it loads
> > on
> > the screen?  In a normal JSP page, I use the Javascript call: <body
> > onload="autosubmit();"> but in a portlet I'm not sure where I can place
> > the
> > Javascript call to get it to fire off as the portlet loads since it is
> > only
> > an html fragment instead of the entire page.
> >
> >  You can put the script "inline" in your portlet and it will execute
> whenever the portlet is rendered
> Or, if this script is shared across portlets, you can add it to the
> Jetspeed-1 layout
>
> In Jetspeed-2, we have support for adding content to the header phase of
> rendering, but that is not possible in Jetspeed-1
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: jetspeed-dev-unsubscribe@portals.apache.org
> For additional commands, e-mail: jetspeed-dev-help@portals.apache.org
>
>


-- 
Brad Gardner

Re: Event on portlet load

Posted by David Sean Taylor <da...@bluesunrise.com>.
On Apr 2, 2008, at 10:49 AM, Brad Gardner wrote:

> Is there a way to automatically run a script from a portlet when it  
> loads on
> the screen?  In a normal JSP page, I use the Javascript call: <body
> onload="autosubmit();"> but in a portlet I'm not sure where I can  
> place the
> Javascript call to get it to fire off as the portlet loads since it  
> is only
> an html fragment instead of the entire page.
>
You can put the script "inline" in your portlet and it will execute  
whenever the portlet is rendered
Or, if this script is shared across portlets, you can add it to the  
Jetspeed-1 layout

In Jetspeed-2, we have support for adding content to the header phase  
of rendering, but that is not possible in Jetspeed-1

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