myfaces-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Leyzerzon, Simeon" <simeon.leyzer...@credit-suisse.com>
Subject RE: javax.faces.el.PropertyNotFoundException: Base is null
Date Mon, 26 Mar 2007 20:23:00 GMT
Simon, Shawn, thanks for the pointers. 

I'm sure that facilityTable.facilities is not null as I can see the values on the screen,
it's only when I click on the command link to edit when this exception gets thrown.

Here is the sequence of the events:

--facilityTab.jsp:

<t:commandLink  action="#{facilityTable.viewFacility}"  >
	 <t:graphicImage value="../../img/edit_icon.gif"   border="0" alt="Click here to edit
the record" />
 	 <f:param name="selectedRowIndex" value="#{rowIndex}"/>
 </t:commandLink>  


In facilityTable.java:

public String  viewFacility()
	{
	     setSelectedRowIndex(Integer.parseInt((String)getParameter("selectedRowIndex")));
	     setFacility((Facility)(facilities.get(this.getSelectedRowIndex())));
         
	     setShowDetailView(true);
	     return "OK";
	     
	}



Then, based on the setShowDetailView, the following needs to be invoked in layout.jsp page:

<t:column>
				     
	        <f:subview id="ed" rendered="#{facilityTable.showDetailView}">
		 	<jsp:include page="employeeDetailTab.jsp" flush="false"/>
		 </f:subview>
</t:column>


Regarding forceId attribute, I'll try removing it and see if it still behaves the same.

Could you please give any more ideas on what could be wrong?

Thank you in advance.
Simeon


-----Original Message-----
From: Simon Kitching [mailto:simon.kitching@rhe.co.nz] 
Sent: Monday, March 26, 2007 4:15 PM
To: MyFaces Discussion
Subject: Re: javax.faces.el.PropertyNotFoundException: Base is null

Are you sure that expression "#{facilityTable.facilities}" doesn't return a collection that
contains the value NULL?

Everything else looks ok to me at first glance - though forceId really really sucks, and should
be avoided if at all possible as it totally breaks "encapsulation" of pages.

Leyzerzon, Simeon wrote:
> I'm getting the following exception when clicking on paginator or 
> command link in facilityTab.jsp:
> javax.faces.el.PropertyNotFoundException: Base is null: .facility at
> org.apache.myfaces.el.ValueBindingImpl.resolveToBaseAndProperty(ValueB
> indingImpl.java:477)
> at
> org.apache.myfaces.el.ValueBindingImpl.getType(ValueBindingImpl.java:1
> 75)
> at
> org.apache.myfaces.shared_tomahawk.renderkit._SharedRendererUtils.find
> UIOutputConverter(_SharedRendererUtils.java:58)
> at
> org.apache.myfaces.shared_tomahawk.renderkit.RendererUtils.findUIOutpu
> tConverter(RendererUtils.java:333)
> at
> org.apache.myfaces.shared_tomahawk.renderkit.RendererUtils.getConverte
> dUIOutputValue(RendererUtils.java:627)
> at
> org.apache.myfaces.shared_tomahawk.renderkit.html.HtmlTextRendererBase
> .getConvertedValue(HtmlTextRendererBase.java:191)
> at javax.faces.component.UIInput.getConvertedValue(UIInput.java:402) 
> at
> javax.faces.component.UIInput.validate(UIInput.java:356) at
> javax.faces.component.UIInput.processValidators(UIInput.java:190)
> 
> 
> Here is the structure of my pages:
> 
> --layout.jsp
> <f:view>
>                                        
>         <h:form id="layoutFrm">
>         <t:div style="width:70%">
>           <s:fieldset legend="Search Results" >
>            <%-- search results tabset --%>
>            <t:panelGrid columns="1" cellpadding="2" cellspacing="2"  >
>             <t:column>
>                  <f:subview id="tabset">
>                         <jsp:include page="searchResults.jsp" 
> flush="false"/>
>                  </f:subview>
>             </t:column>
> ~~~~~~~~~~~~~~~
> 
> 
> --searchResults.jsp
> 
> <t:panelTabbedPane>
>         <t:panelTab label="Facility"  >
>                  <f:subview id="facil">
>                          <jsp:include page="facilityTab.jsp" 
> flush="false"/>
>                  </f:subview>
>         </t:panelTab>
> 
> ~~~~~~~~~~~~
> 
> --facilityTab.jsp
> <t:saveState value="#{facilityTable}" ></t:saveState>
>        
> <!-- core list table usage and tag reference -->
>                 <t:dataTable value="#{facilityTable.facilities}" 
> var="facility"
>                                                 id="facilityData"
>                         cellpadding="0" cellspacing="0" width="100%" 
> border="0"
>                         preserveDataModel="false"
>                         forceId="true"
>                         rows="6"
>                         rowClasses="even,odd,even,odd,even,odd"
>                         rowIndexVar="rowIndex"
>                         sortColumn    ="#{facilityTable.sort}"
>                         sortAscending ="#{facilityTable.ascending}"
>                 >
>                
>         <t:column>
>                                 
>             <t:graphicImage value="../../img/checkmark.gif" 
> alt="Current Selection" 
> rendered="#{rowIndex==facilityTable.selectedRowIndex && 
> facilityTable.facility!=null}">
> 
>              </t:graphicImage>
>                  </t:column>
>                  <t:column>
>                        
>                         <f:facet name="header" >
>                       <h:outputText value="Select One" id="h1"/>
>                     </f:facet>
>                    <t:commandLink
> action="#{facilityTable.viewFacility}"  >
>                  <t:graphicImage value="../../img/edit_icon.gif"   
> border="0" alt="Click here to edit the record" />
>                         <f:param name="selectedRowIndex" 
> value="#{rowIndex}"/>
>                          </t:commandLink>   
>                            
>                                
>                                 </t:column>
>                                                 <t:column id="c1">
>                                        <f:facet name="header" >
>                                                 <t:commandSortHeader 
> columnName="name" arrow="true"  id="s1">
>                                                   <h:outputText 
> value="Name" id="h2"/>
>                                                         
> </t:commandSortHeader>
>                                             </f:facet>         
>                                                         <t:inputText 
> value="#{facility.firstName}" id="p1"/>
>                                                         
> <f:verbatim>&nbsp;&nbsp;</f:verbatim>
>                                                         <t:inputText 
> value="#{facility.lastName}" id="p2"/>
>                         </t:column>
> 
>                     
> 
>                    <t:column id="c3">
>                        <f:facet name="header">
>                         <t:commandSortHeader columnName="address" 
> arrow="true"  id="s2" >
>                           <h:outputText value="Address" id="h3"/>
>                         </t:commandSortHeader> 
>                        </f:facet>
>                         <t:inputText
> value="#{facility.primaryResidentAddress.addressOne}" id="a1" size="35" 
> maxlength="100" />
> 
>                         <f:verbatim>&nbsp;&nbsp;</f:verbatim>
>                          <t:inputText 
> value="#{facility.primaryResidentAddress.city}" size="10" maxlength="20"
> id="a2"/>
> 
>                          <f:verbatim>&nbsp;&nbsp;</f:verbatim>
>                          <t:inputText 
> value="#{facility.primaryResidentAddress.state}" size="2" maxlength="2"
> id="a3"/>
> 
>                          <f:verbatim>&nbsp;&nbsp;</f:verbatim>
>                          <t:inputText 
> value="#{facility.primaryResidentAddress.zipCode}" size="5"
> maxlength="10" id="a4"/>
> 
>                    </t:column>
>                
>                
>                
>                
>                 </t:dataTable> 
>                 <!-- core pagnation reference -->
>                  <h:panelGrid columns="22"  cellpadding="0" 
> cellspacing="0" border="0" width="80" >
>                     <t:dataScroller id="facilityDataScroller"
>                             for="facilityData"
>                             fastStep="10"
>                             pageCountVar="pageCount"
>                             pageIndexVar="pageIndex"
>                             paginator="true"
>                             paginatorMaxPages="9"
>                             paginatorTableClass="paginator"
>                             paginatorActiveColumnStyle="font-weight:bold;"
>                             >
>                            
>                         <f:facet name="first" >
>                             <h:graphicImage 
> url="../../img/FirstPage.gif" style="margin-top:4pt;"/>
>                         </f:facet>
>                         <f:facet name="last">
>                             <h:graphicImage 
> url="../../img/LastPage.gif"  style="margin-top:4pt;"/>
>                         </f:facet>
>                         <f:facet name="previous">
>                             <h:graphicImage 
> url="../../img/PreviousItem.gif"  style="margin-top:4pt;"/>
>                         </f:facet>
>                         <f:facet name="next">
>                             <h:graphicImage 
> url="../../img/NextItem.gif"  style="margin-top:4pt;"/>
>                         </f:facet>
>                       
>                     </t:dataScroller>
>                    
>                 </h:panelGrid>
> 
> 
> Could someone please help.  Is this a valid structure to have a data 
> scroller or a command link inside a tab in a tabset.
> 
> Thank you,
> Simeon
> 
> ======================================================================
> ======== Please access the attached hyperlink for an important 
> electronic communications disclaimer:
> 
> http://www.credit-suisse.com/legal/en/disclaimer_email_ib.html
> ======================================================================
> ========
> 


==============================================================================
Please access the attached hyperlink for an important electronic communications disclaimer:


http://www.credit-suisse.com/legal/en/disclaimer_email_ib.html
==============================================================================


Mime
View raw message