3
votes

I've got a problem with using p:ajax update atribute element. When I use in my code <p:ajax update="@all" /> then I am getting javax.el.PropertyNotFoundException. When I use <f:ajax render="@all" /> I don't get any. I though that thouse tags are nearly same. Can anyone explain whats happening?

I am using mojjara implementation, primefaces 3.5 and Liferay jsf portlet bridge.

Example of stacktrace:

Caused by: javax.el.PropertyNotFoundException: /pages/views/personForm.xhtml @95,99 value="#{personManagementBean.item.contact.phoneNumber}": Target Unreachable, 'null' returned null at com.sun.faces.facelets.el.TagValueExpression.getType(TagValueExpression.java:100) at org.primefaces.renderkit.InputRenderer.findImplicitConverter(InputRenderer.java:170) at org.primefaces.renderkit.InputRenderer.findConverter(InputRenderer.java:190) at org.primefaces.renderkit.InputRenderer.getConvertedValue(InputRenderer.java:196) at javax.faces.component.UIInput.getConvertedValue(UIInput.java:1030) at javax.faces.component.UIInput.validate(UIInput.java:960) at javax.faces.component.UIInput.executeValidate(UIInput.java:1233) at javax.faces.component.UIInput.processValidators(UIInput.java:698) at javax.faces.component.UIComponentBase.processValidators(UIComponentBase.java:1214) at javax.faces.component.UIComponentBase.processValidators(UIComponentBase.java:1214) at javax.faces.component.UIComponentBase.processValidators(UIComponentBase.java:1214) at javax.faces.component.UIForm.processValidators(UIForm.java:253) at javax.faces.component.UIComponentBase.processValidators(UIComponentBase.java:1214)

Two buttons:

<p:commandButton value="not working" action="#{enrollmentManagementBean.cancelEnrollment}">
    <p:ajax update="@all" />
</p:commandButton>
<h:commandButton value="working" action="#{enrollmentManagementBean.cancelEnrollment}">
    <f:ajax render="@all" />
</h:commandButton>                                                                     
1
Did you try <p:commandButton update="@all" .../> ?Rong Nguyen
Target Unreachable, 'null' returned null suggests that item or contact is null. Have you verified this?BalusC
RongNK: Initially I didn't try <p:commandButton update="@all" .../> but it works actualy. I am even more confused about what is happening here. Thought that update attribute inside commandButton has same functionality as the one in p:ajax tag. BalusC: It is null (I am not initializing it anywhere) but the code works as long as I don't use <p:ajax update.../>. I though that EL is "null-safe" (if anything like that even exists :D).svobol13

1 Answers

8
votes

OptimusPrime (main developer of Primefaces) states that update="@all" is a bad idea and primefaces does not implement it by design link to forum post.

What I do in order to get around the problem is rely on page refresh from javascript. Just put it in the oncomplete attribute of the button.

oncomplete="window.location.replace(window.location.href);"

I believe this should solve your problem if you still have it, or be here for future reference.