You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@myfaces.apache.org by Scott Belnap <sc...@byu.edu> on 2008/04/02 18:54:33 UTC

commandButton action not executed

I have a page that has the following commandButton.

<h:commandButton value="Update List" action="#{todoListBean.update}"
rendered="#{todoListBean.todoList.listId ne 0}" />

When I click on the button it doesn't execute the action it just
refreshes the page.  But if I remove the rendered property so the
commanButton tag looks like:

<h:commandButton value="Update List" action="#{todoListBean.update}" />

jsf will execute the action #{todoListBean.update}.  Does anyone know
why when I have the rendered property in the jsf tag the action doesn't
get executed?



Re: commandButton action not executed

Posted by Scott Belnap <sc...@byu.edu>.
Martin,

I was able to solve the issue using t:saveState.

Thanks for the help

On Tue, 2008-04-08 at 19:32 -0600, Martin Marinschek wrote:
> Hi Scott,
> 
> you need the rendered property to remain constant over requests.
> 
> What you could do:
> 
> - use t:saveState
> - use a conversation scope
> 
> regards,
> 
> Martin
> 
> On Wed, Apr 2, 2008 at 7:15 PM, Scott Belnap <sc...@byu.edu> wrote:
> > todoListBean is request scoped not session scoped.  Is there anyway to
> >  use a request scoped bean in this case?
> >
> >  Thanks.
> >
> >
> >
> >  On Wed, 2008-04-02 at 11:10 -0600, Andrew Robinson wrote:
> >  > Is todoListBean session scoped? If your todoList is not available
> >  > during decode, the rendered will fail and non-rendered components are
> >  > not decoded.
> >  >
> >  > On Wed, Apr 2, 2008 at 10:54 AM, Scott Belnap <sc...@byu.edu> wrote:
> >  > > I have a page that has the following commandButton.
> >  > >
> >  > >  <h:commandButton value="Update List" action="#{todoListBean.update}"
> >  > >  rendered="#{todoListBean.todoList.listId ne 0}" />
> >  > >
> >  > >  When I click on the button it doesn't execute the action it just
> >  > >  refreshes the page.  But if I remove the rendered property so the
> >  > >  commanButton tag looks like:
> >  > >
> >  > >  <h:commandButton value="Update List" action="#{todoListBean.update}" />
> >  > >
> >  > >  jsf will execute the action #{todoListBean.update}.  Does anyone know
> >  > >  why when I have the rendered property in the jsf tag the action doesn't
> >  > >  get executed?
> >  > >
> >  > >
> >  > >
> >
> >
> 
> 
> 
> --
> 
> http://www.irian.at
> 
> Your JSF powerhouse -
> JSF Consulting, Development and
> Courses in English and German
> 
> Professional Support for Apache MyFaces


Re: commandButton action not executed

Posted by Martin Marinschek <ma...@gmail.com>.
Hi Scott,

you need the rendered property to remain constant over requests.

What you could do:

- use t:saveState
- use a conversation scope

regards,

Martin

On Wed, Apr 2, 2008 at 7:15 PM, Scott Belnap <sc...@byu.edu> wrote:
> todoListBean is request scoped not session scoped.  Is there anyway to
>  use a request scoped bean in this case?
>
>  Thanks.
>
>
>
>  On Wed, 2008-04-02 at 11:10 -0600, Andrew Robinson wrote:
>  > Is todoListBean session scoped? If your todoList is not available
>  > during decode, the rendered will fail and non-rendered components are
>  > not decoded.
>  >
>  > On Wed, Apr 2, 2008 at 10:54 AM, Scott Belnap <sc...@byu.edu> wrote:
>  > > I have a page that has the following commandButton.
>  > >
>  > >  <h:commandButton value="Update List" action="#{todoListBean.update}"
>  > >  rendered="#{todoListBean.todoList.listId ne 0}" />
>  > >
>  > >  When I click on the button it doesn't execute the action it just
>  > >  refreshes the page.  But if I remove the rendered property so the
>  > >  commanButton tag looks like:
>  > >
>  > >  <h:commandButton value="Update List" action="#{todoListBean.update}" />
>  > >
>  > >  jsf will execute the action #{todoListBean.update}.  Does anyone know
>  > >  why when I have the rendered property in the jsf tag the action doesn't
>  > >  get executed?
>  > >
>  > >
>  > >
>
>



-- 

http://www.irian.at

Your JSF powerhouse -
JSF Consulting, Development and
Courses in English and German

Professional Support for Apache MyFaces

Re: commandButton action not executed

Posted by Scott Belnap <sc...@byu.edu>.
todoListBean is request scoped not session scoped.  Is there anyway to
use a request scoped bean in this case?

Thanks.

On Wed, 2008-04-02 at 11:10 -0600, Andrew Robinson wrote:
> Is todoListBean session scoped? If your todoList is not available
> during decode, the rendered will fail and non-rendered components are
> not decoded.
> 
> On Wed, Apr 2, 2008 at 10:54 AM, Scott Belnap <sc...@byu.edu> wrote:
> > I have a page that has the following commandButton.
> >
> >  <h:commandButton value="Update List" action="#{todoListBean.update}"
> >  rendered="#{todoListBean.todoList.listId ne 0}" />
> >
> >  When I click on the button it doesn't execute the action it just
> >  refreshes the page.  But if I remove the rendered property so the
> >  commanButton tag looks like:
> >
> >  <h:commandButton value="Update List" action="#{todoListBean.update}" />
> >
> >  jsf will execute the action #{todoListBean.update}.  Does anyone know
> >  why when I have the rendered property in the jsf tag the action doesn't
> >  get executed?
> >
> >
> >


Re: commandButton action not executed

Posted by Andrew Robinson <an...@gmail.com>.
Is todoListBean session scoped? If your todoList is not available
during decode, the rendered will fail and non-rendered components are
not decoded.

On Wed, Apr 2, 2008 at 10:54 AM, Scott Belnap <sc...@byu.edu> wrote:
> I have a page that has the following commandButton.
>
>  <h:commandButton value="Update List" action="#{todoListBean.update}"
>  rendered="#{todoListBean.todoList.listId ne 0}" />
>
>  When I click on the button it doesn't execute the action it just
>  refreshes the page.  But if I remove the rendered property so the
>  commanButton tag looks like:
>
>  <h:commandButton value="Update List" action="#{todoListBean.update}" />
>
>  jsf will execute the action #{todoListBean.update}.  Does anyone know
>  why when I have the rendered property in the jsf tag the action doesn't
>  get executed?
>
>
>