Question

I'm getting the below error when I try to access my application(using JSF,RichFaces,a4j frameworks).

SEVERE: Error Rendering View[/index.xhtml]
javax.faces.FacesException: javax.faces.FacesException: javax.el.PropertyNotFoundException: /facelets/home.xhtml @448,82 rendered="#{contact.visible}": ELResolver cannot handle a null base Object with identifier 'contact'
at javax.faces.component.UIComponent.invokeOnComponent(UIComponent.java:672)
at javax.faces.component.UIComponentBase.invokeOnComponent(UIComponentBase.java:680)
at javax.faces.component.UIComponent.invokeOnComponent(UIComponent.java:678)
at javax.faces.component.UIComponentBase.invokeOnComponent(UIComponentBase.java:680)
at javax.faces.component.UIComponent.invokeOnComponent(UIComponent.java:678)
at javax.faces.component.UIComponentBase.invokeOnComponent(UIComponentBase.java:680)
at javax.faces.component.UIComponent.invokeOnComponent(UIComponent.java:678)
at javax.faces.component.UIComponentBase.invokeOnComponent(UIComponentBase.java:680)
at javax.faces.component.UIComponent.invokeOnComponent(UIComponent.java:678)
at javax.faces.component.UIComponentBase.invokeOnComponent(UIComponentBase.java:680)
at org.ajax4jsf.component.AjaxViewRoot.encodeChildren(AjaxViewRoot.java:543)
at javax.faces.component.UIComponent.encodeAll(UIComponent.java:883)
at com.sun.facelets.FaceletViewHandler.renderView(FaceletViewHandler.java:578)
at org.springframework.faces.webflow.FlowViewHandler.renderView(FlowViewHandler.java:99)
at org.ajax4jsf.application.ViewHandlerWrapper.renderView(ViewHandlerWrapper.java:100)
at org.ajax4jsf.application.AjaxViewHandler.renderView(AjaxViewHandler.java:176)
at org.springframework.faces.webflow.FlowViewHandler.renderView(FlowViewHandler.java:99)
at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:108)
at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:266)
at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:159)
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:245)

Below is piece of 'home.xhtml' page

     <h:dataTable id="contactsTable"
 value="#{agentBean.personalDetails.contactList}"
      var="contact" border="0" width="90%">
     <h:column>
     <a4j:region id="ContactTypeRegion">
     <h:selectOneMenu id="contactType"
     value="#{contact.contactType}"
required="#{param['contactValidation'] != '0'}"
requiredMessage="#{user.ContactTypeRequired}">
<f:selectItems
value="#{contact.contactTypeList}" />
<a4j:support event="onchange"
focus="contactCode"
action="#{contact.enableContactNumber}"
reRender="ContactCodePanel,ContactNumPanel,EntensionPanel" />
</h:selectOneMenu>
</a4j:region>
<a4j:outputPanel id="ContactCodePanel">
<rich:spacer height="1" width="2" />
<h:inputText id="contactCode"
label="Contact Code"
value="#{contact.contactCountryCode}"
style="width:10%" class="txtBox"
required="#{param['contactValidation'] != '0'}"
requiredMessage="#{user.ContactCodeRequired}"
maxlength="3">
<f:validator
validatorId="NumericValidator" />
<f:validateLength minimum="3" maximum="3" />
<rich:toolTip for="ContactCodePanel"
value="Area Code" direction="bottom-left"
styleClass="tooltip" />
<rich:ajaxValidator event="onblur" />
</h:inputText>
                                        <rich:spacer height="1" width="2" />
<h:outputText value="-" />
</a4j:outputPanel>
<rich:spacer height="1" width="2" />

Below is the point im getting the above error

<a4j:commandLink id="removeContact1"
value="#{contact.remove}"
rendered="#{contact.visible}"
reRender="contactsTable"
action="#{agentBean.personalDetails.removeContact}">
<a4j:actionparam name="contactValidation"
value="0" />
</a4j:commandLink>
</h:column>
</h:dataTable>
Was it helpful?

Solution

It seems that the contactList (referenced from agentBean.personalDetails.contactList in datatable) contains a null entry

Therefore the following expression can not be evaluated

rendered="#{contact.visible}"
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top