-
1. Re: a4j:commandButton rerender
ilya_shaikovsky Mar 26, 2007 11:04 AM (in response to maitre)what is the scope of your bean?
-
2. Re: a4j:commandButton rerender
maitre Mar 26, 2007 11:12 AM (in response to maitre)They are session bean
-
3. Re: a4j:commandButton rerender
ilya_shaikovsky Mar 26, 2007 11:34 AM (in response to maitre)Need some more info.. environment, log etc.. In my case the same
<a4j:commandButton action="#{bean.disableAction}" value="test" reRender="test"></h:commandButton> <a4j:outputPanel id="test"> <h:commandButton value="hide Mee" rendered="#{bean.property1}"></h:commandButton> <a4j:outputPanel>
works as you expect. -
4. Re: a4j:commandButton rerender
maitre Mar 26, 2007 11:41 AM (in response to maitre)
When you use action #{bean.disableAction} you reload all the page. That whay i am using actionListener.
I want to use Ajax to reload the status of my button.
Why do you disable a panel not the commandButton in your example -
5. Re: a4j:commandButton rerender
ilya_shaikovsky Mar 26, 2007 11:44 AM (in response to maitre)1) action and actionListener both doesn't reloads the whole page in Ajax action components
2) after button - isn't rendered it can't be found in tree to be correctly updated. so update some actual wrapper and all will works as you need. -
6. Re: a4j:commandButton rerender
maitre Mar 26, 2007 11:56 AM (in response to maitre)what do you put in bean.disableAction ?
my method look like this
public void movePrevious(actionevent event)
{
this->moveFirst = true;
}
public boolean moveFirst()
{
return this-»moveFirst;
}
so i whant my button to be rendered with the new value of "moveFirst" -
7. Re: a4j:commandButton rerender
ilya_shaikovsky Mar 26, 2007 12:09 PM (in response to maitre)public String disableAction() { setProperty1(!isProperty1()); return null; }
This is my code -
8. Re: a4j:commandButton rerender
maitre Mar 26, 2007 12:29 PM (in response to maitre)
Finaly it is working :)
I am re-rendering the outputPanel that contain the button and it work.
Thank you very nuch ilya_shaikovsky.
I am still wondering why I can re-render directly the button. -
9. Re: a4j:commandButton rerender
sergeysmirnov Mar 26, 2007 1:19 PM (in response to maitre)the key point is a 'rendered' attribute, but not the commandButton or any other component.
If rendered attribute is false, the component is in the component tree of the server, but has no representation in the browser DOM tree. I.e. there is no DOM node with id on the component.
When you point to such component with reRender attribute, it is rendered (if 'rendered' becomes true) and even sent to the client. However, there is nothing to replace on the client (no placeholder as I said above).
So, if the component has 'rendered' attribute always point to one of the parent with reRender