List Info

Thread: Re: Call Backing Bean Method in onload event




Re: Call Backing Bean Method in onload event
country flaguser name
Austria
2007-11-06 02:54:01
Are we talking here about running code *as part of the
server request*, or triggering code *from the browser*?

Daniel's original email was rather difficult to understand,
but it appeared to me that he wanted the *browser* to
trigger code on the *server* to run after the browser had
loaded the page. Quite why anyone would want to do this is
not clear to me, so maybe this is not what he meant, but he
does talk about javascript onload events...

Andrew, your new wiki page was not particularly clear to me.
I presume you mean to talk about "view lifecycle
events" there, executed as part of request handling?
Again, it could be confused with javascript (ie
"onload" event handling). I had to read it several
times..

Regards,

Simon

---- Andrew Robinson <andrew.rw.robinsongmail.com> schrieb:
> Look at:
> 
> jsf-comp onload
> http://jsf-comp.sourceforge.net/components/onload/in
dex.html
> 
> jboss seam pages.xml:
> http://docs.jboss.org/seam/1.2.1.GA/ref
erence/en/html/events.html#d0e3776
> 
> shale:
> http://
shale.apache.org/shale-view/index.html
> 
> 
> On 11/5/07, daniel ccss <danielccss2gmail.com> wrote:
> > In Google I find this solution:
> >
> >  you can try body on~load calls a javascript
method, then in the javascript
> > method calls a commandbutton which is hidden. that
commandbutton can then
> > call a method in your backing bean.
> >
> > code:________________________________
> >
> > function test(){
> > 
document.getElementById('formName:buttonId').click();
> >
> > }
> >
> > <body on~load="test();">
> >
> > <h:commandButton
action="#{backingBean.methodName}"
id="buttonId"
> > style="display: none"/>
> > </body>
> >
> > Any other idea??
> >
> >
> >
> >
> >
> >
> > On 11/5/07, daniel ccss <danielccss2gmail.com> wrote:
> > > Hi all,
> > >
> > > I need to call a method on my backing bean
(is in session scope) when a
> > jsp is showing. Why? Because I some cases I need
to erase some elements in
> > session before showing the jsp. So in the onload
of the JSPs I need to call
> > the method on my backing bean that erase the
elements in session.
> > >
> > > So my question is, how to call a Baccking
Bean method on the onLoad event
> > of the body in the JSP.
> > >
> > > Thanks
> > >
> >
> >


Re: Call Backing Bean Method in onload event
user name
2007-11-06 10:26:56
> Andrew, your new wiki page was not particularly clear
to me. I presume you mean to talk about "view lifecycle
events" there, executed as part of request handling?
Again, it could be confused with javascript (ie
"onload" event handling). I had to read it several
times..

I added a note on there to clarify

- Andrew

[1-2]

about | contact  Other archives ( Real Estate discussion Medical topics )