我正在使用JSF,使用ManagedBean註釋並使用Primefaces,並且出現以下問題。使用JSF PrimeFaces - 「onerror」在<p:commandButton>不起作用
我想知道爲什麼「onerror」沒有觸發!該例外只出現在我的控制檯中。
login.xhtml
<p:commandButton value="teste" action="#{loginBean.methodTest()}" ajax="true" immediate="false" onerror="confirmation.show()" />
<p:dialog appendToBody="true" header="Atencao" widgetVar="confirmation" showEffect="bounce">
...
爲myBean
@ManagedBean(name = "loginBean")
@SessionScoped public class LoginBean {
public void methodTest() throws Exception {
System.out.println("hi");
throw new Exception("Exception Test"); }
謝謝大家!
是否可以在操作方法中使用括號'()'?取決於你使用的是什麼容器,這是行不通的...... – elias 2012-07-26 01:41:07