Request scope is too short.
The scope of the rendered attribute value must remain constant from
renderResponse of the first request to processing the action on the
second request.
Use t:saveState on either bean2 or on bean2.showMe.
On 12/23/06, Marek Zachara <[EMAIL PROTECTED]> wrote:
Hello,
I have a scenario which seems to be trival, so i guess i must have missed
something obvious, but still i cant seem to find a solution
on a page i have a sample form with a command button connected to the backing
beans:
<h:commandButton value="Test Me" action="#{bean1.testAction}"
rendered="#{bean2.showMe}" />
both bean1 and bean2 have scope=request
now, bean2 is created during the generation of the page,
and method isShowMe() returns true;
the button is displayed. i can click it, though to my surprise
the action is not called (i have put a log message in testAction to verify
that). Even the bean1 itself is not created.
as i have found out, this is due to the rendered attribute - when
i set it to true or bind it to a some method in session bean, everything
works fine. The bean2 is destroyed after generation of the page with the
button, so it seems as it is trying to access it nevertheless after
the button is clicked, fails and as a result the whole action fails.
I have tried it also with attribute immediate="true" , but with no
success either.
i will really be glad if anyone can help me out :)
Marek