myfaces-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "K. Johnson" <i...@streetcookie.com>
Subject Re: how to access a managed bean from a button action listener ?
Date Fri, 22 Sep 2006 15:37:27 GMT

You can also use: 
FacesContext facesContext = FacesContext.getCurrentInstance();
MyBean myBean = (MyBean) FacesContext.getApplication().createValueBinding("{MyBeanAliasUsedInFacesConfig}");

This accesses the managedBean in context. 

>  -------Original Message-------
>  From: Alexandre Jaquet <a.jaquet@avintis.com>
>  Subject: Re: how to access a managed bean from a button action listener ?
>  Sent: 22 Sep '06 06:33
>  
>  actionListener="#{session.actionToExecute}"
>  
>  in your managed bean create
>  
>  public void actionToExecute(ValueChangeEvent event) {
>      //String value = ( String) event.getNewValue();
>  }
>  Legolas Woodland wrote:
>  > Hi
>  > thank you for reading my post
>  > how i can access a managed bean from a button action listener ?
>  > for example i have a managed bean named session and its scope is session
>  > , i used it to store user details until he/she logout
>  > and when he/she pressed the logout button i need to change some of that
>  > managed bean property ,
>  > can you please tell me how i can do it ?
>  > I also need it for time that user press the login button.
>  > thanks
>  >
>  >  
>  
>  

Mime
View raw message