myfaces-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "daniel ccss" <>
Subject Re: Call Backing Bean Method in onload event
Date Mon, 05 Nov 2007 21:40:04 GMT
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.


function test(){

<body on~load="test();">

<h:commandButton action="#{backingBean.methodName}" id="buttonId"
style="display: none"/>

Any other idea??

On 11/5/07, daniel ccss <> 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

View raw message