Simon, Not sure if this matters or not, but I'm initializing the facilities via the following mechanism for now:
I have 2 faces-config.xml's:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE faces-config PUBLIC "-//Sun Microsystems, Inc.//DTD JavaServer Faces
Config 1.0//EN"
"http://java.sun.com/dtd/web-facesconfig_1_0.dtd">
<faces-config>
<managed-bean>
<managed-bean-name>facilityTable</managed-bean-name>
<managed-bean-class>com.csfb.fao.clr.maintenance.controller.FacilityTable</managed-bean-class>
<managed-bean-scope>session</managed-bean-scope>
<managed-property>
<property-name>facilities</property-name>
<property-class>java.util.List</property-class>
<list-entries>
<value-class>com.csfb.fao.clr.maintenance.model.Facility</value-class>
<value>#{facility1}</value>
<value>#{facility2}</value>
<value>#{facility3}</value>
<value>#{facility4}</value>
<value>#{facility5}</value>
<value>#{facility6}</value>
<value>#{facility7}</value>
<value>#{facility8}</value>
<value>#{facility9}</value>
<value>#{facility10}</value>
</list-entries>
</managed-property>
</managed-bean>
</faces-config>
And then data-config.xml:
<faces-config>
<managed-bean>
<managed-bean-name>facility1</managed-bean-name>
<managed-bean-class>com.csfb.fao.clr.maintenance.model.Facility</managed-bean-class>
<managed-bean-scope>session</managed-bean-scope>
<managed-property>
<property-name>primaryResidentAddress</property-name>
<property-class>com.csfb.fao.clr.maintenance.model.Address</property-class>
<value>#{address1}</value>
</managed-property>
<managed-property>
<property-name>firstName</property-name>
<property-class>java.lang.String</property-class>
<value>Peter</value>
</managed-property>
<managed-property>
<property-name>lastName</property-name>
<property-class>java.lang.String</property-class>
<value>Wang</value>
</managed-property>
<managed-property>
<property-name>middleName</property-name>
<property-class>java.lang.String</property-class>
<value/>
</managed-property>
<managed-property>
<property-name>cellPhone</property-name>
<property-class>java.lang.String</property-class>
<value>678-923-2719</value>
</managed-property>
<managed-property>
<property-name>workPhone</property-name>
<property-class>java.lang.String</property-class>
<value>678-923-2719</value>
</managed-property>
<managed-property>
<property-name>title</property-name>
<property-class>java.lang.String</property-class>
<value>IT Manager</value>
</managed-property>
<managed-property>
<property-name>SSN</property-name>
<property-class>java.lang.String</property-class>
<value>678-93-2719</value>
</managed-property>
<managed-property>
<property-name>emailAddress</property-name>
<property-class>java.lang.String</property-class>
<value>[EMAIL PROTECTED]</value>
</managed-property>
etc., for all the facilities in the first file.
I've put some logging and it looks like the getters on the facility property of
facilityTable.java are being called, but not the setters:
FacilityTable -> setFacilities() [EMAIL PROTECTED], [EMAIL PROTECTED], [EMAIL
PROTECTED], [EMAIL PROTECTED], [EMAIL PROTECTED], [EMAIL PROTECTED], [EMAIL
PROTECTED], [EMAIL PROTECTED], [EMAIL PROTECTED], [EMAIL PROTECTED]
FacilityTable.java -> getFacility() is called...
FacilityTable.java -> getFacility() is called...
FacilityTable.java -> getFacility() is called...
FacilityTable.java -> getFacility() is called...
FacilityTable.java -> getFacility() is called...
FacilityTable.java -> getFacility() is called...
FacilityTable.java -> getFacility() is called...
FacilityTable.java -> getFacility() is called...
FacilityTable.java -> getFacility() is called...
FacilityTable.java -> getFacility() is called...
FacilityTable.java -> getFacility() is called...
FacilityTable.java -> getFacility() is called...
FacilityTable.java -> getFacility() is called...
FacilityTable.java -> getFacility() is called...
FacilityTable.java -> getFacility() is called...
FacilityTable.java -> getFacility() is called...
FacilityTable.java -> getFacility() is called...
FacilityTable.java -> getFacility() is called...
FacilityTable.java -> getFacility() is called...
<Mar 26, 2007 5:24:32 PM EDT> <Error> <HTTP> <BEA-101017> <[EMAIL PROTECTED] -
appName: 'GISWeb', name: 'GISWeb.war', context-path: '/GISWeb'] Root cause of
ServletException.
javax.faces.el.PropertyNotFoundException: Base is null: .facility
at
org.apache.myfaces.el.ValueBindingImpl.resolveToBaseAndProperty(ValueBindingImpl.java:477)
at
org.apache.myfaces.el.ValueBindingImpl.getType(ValueBindingImpl.java:175)
at
org.apache.myfaces.shared_tomahawk.renderkit._SharedRendererUtils.findUIOutputConverter(_SharedRendererUtils.java:58)
at
org.apache.myfaces.shared_tomahawk.renderkit.RendererUtils.findUIOutputConverter(RendererUtils.java:333)
at
org.apache.myfaces.shared_tomahawk.renderkit.RendererUtils.getConvertedUIOutputValue(RendererUtils.java:627)
Truncated. see log file for complete stacktrace
I can clearly see all the data on the screen being populated. setFacility()
never gets called, even when the data changes. In fact
facilityTable.viewFacility() never gets called. Also there are more
getFailitiy() calls then there are facilities. Strange...
I'm attaching the backing bean.
Thanks for the pointers,
Simeon
-----Original Message-----
From: Simon Kitching [mailto:[EMAIL PROTECTED]
Sent: Monday, March 26, 2007 4:35 PM
To: MyFaces Discussion
Subject: Re: javax.faces.el.PropertyNotFoundException: Base is null
Leyzerzon, Simeon wrote:
> 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.
Ahh..but what does that method return at postback?
When the form is submitted, JSF walks the tree of components and calls the
"processDecodes" method on each one, so that the component can look into the
posted set of parameters and grab the data that belongs to it.
It then makes another pass across the tree and calls the validate method on
each component, which requires that component to fetch its value from the
backing bean to know whether the submitted value is different from the
"current" value or not.
In order to do this for components within a table, the table must fetch its
"value" and iterate over the contents.
You clearly have correct contents for this when the page is rendered because,
as you say, you can see the output on the screen. However what is returned by
that expression when the page is posted back? Checking this using logging or
breakpoints would be a good idea...
Regards,
Simon
==============================================================================
Please access the attached hyperlink for an important electronic communications
disclaimer:
http://www.credit-suisse.com/legal/en/disclaimer_email_ib.html
==============================================================================
FacilityTable.java
Description: Binary data

