Does anybody know how to work around h:commandlink problem or I have to refuse ajax rerendering if I need non-ajax commandLink?
i think you forget the <a4j:region> surround your code with it
I don't completely understand why <a4j:region> is needed, as I thought a4j:region by default is the whole page. But this code also doesn't work, after pressing button text 'Working...' doesn't fade away:
<a4j:region> <h:form id="f1"> <a4j:commandButton value="Update Non-Ajax Link" reRender="f1" /> <h:panelGrid id="panel"> <h:commandLink value="Non-Ajax Submit" action="foo" > </h:commandLink> </h:panelGrid> <a4j:status startText="Working..."/> </h:form> </a4j:region>
yes, this problem are known and about standard JSF generating hiddens for links and params for the links. And we designed a4j:form and a4j:htmlCommandLink as a solution for this case. So if you need to refresh link via ajax use these a4j component.
These component doesn't differs from standard ones (h:form and h:commandLink). So you should do nothing special to use them instead of standard ones.
To get more info check dev guide for these components.
Thank you, Ilya.
Simply as I understood from the live demo
quotation: "Along with a4j:htmlCommandLink, it(ajaxform) fixes the problem of h:commandLink component that cannot be re-rendered without re-rendering the whole form it belongs to." if I rerender the whole from all will work properly. But as you said h:commandLink rerendering doesn't work in any cases, right?
rerendering of the commandlink could cause wrong hiddens for this link generation so it the onyl safe way to replace the link and for to a4j analogous components.