a4j:commandButton doesn't execute action
spinacz Sep 19, 2012 5:07 AMHi,
I am new with RichFaces and JSF, i have to update librares in a project.
I updated JSF from 1.2 to 2.1.12 and RichFaces form 3.3.3 to 4.2.2, but after that, ajax stop working.
I read migration guide, and i chnged tags and attributes as described, but ajax stil doesn't work.
I have one large file where, is a few a4j:commandButton, this buttons navigate through form pages, some of them execute action at bean, but other not. I spent many hours trying to solve it, but it fell.
my buttons are as follows:
<a4j:commandButton value=" " action="#{mybean.page0}" render="pages" oncomplete="SomeAction(); AnotherAxtion();" execute="@this" /> <a4j:commandButton id="button-prev" styleClass="button-prev prev" value="<< Wstecz" image="/layout/img/mr/scoring/scoring-sg-button-prev.jpg" action="#{mybean.page0}" render="pages" oncomplete="SomeAction(); AnotherAxtion();" execute="@this" />
the first works, second doesn't, both are in the same file,a4j:region, a4j:outputPanel
pages is id for <a4j:outputPanel>
button is rendered if <c:if> condition is true, on page button is corectly rendered, but after click, doesn't exectute page0 action
mybean is configured in faces-config:
@ViewScoped public class Mybean implements Serializable { private static final long serialVersionUID = 1L; private int page; public int getPage() { // System.err.println("getPage działa, to co z AJAX?"); return page; } public void setPage(int page) { // System.err.println("setPage działa, to co z AJAX?"); if (page<=0) page = 1; this.page = page; } public String page0() { page = 1; // return "ok"; System.err.println("page0 działa, to co z AJAX?"); return null; } public String page1() { page = 2; // return "ok"; System.err.println("page1 działa, to co z AJAX?"); return null; } public String page2() { page = 3; // return "ok"; System.err.println("page2 działa, to co z AJAX?"); return null; } public String page3() { page = 4; // return "ok"; System.err.println("page3 działa, to co z AJAX?"); return null; } public String page4() { page = 5; // return "ok"; return null; } }
after click on button it do something cause i see it in server log, but i don't see a println with corect page.
any clues what i miss, or what should i look for?
Thanks, Krzysiek
sory for my english;)