File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JSF and the fly likes Backing Bean having Map properties Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Java » JSF
Bookmark "Backing Bean having Map properties" Watch "Backing Bean having Map properties" New topic
Author

Backing Bean having Map properties

vaithee sub
Greenhorn

Joined: Mar 12, 2004
Posts: 20
Hi,
My Faces managed bean is Session scoped and the properties are as List & Map.
I am using hx:dataTableEx to iterage over a property this is declared as follows
List<Map<String, List<CareerDescrAtomicType>>> practiceAreaList;

I am able to iterate over the property and display the value. But when I submit the form, it throws an Exception saying cannot test property property name in bean type null. There seems to be an issue setting properties of Map.

Code snippet

<hx:dataTableEx id="tableEx2"
value="#{careerDisplayBean.practiceAreaList}" var="varpracticeArea"
styleClass="dataTableEx" headerClass="dataTableHeaderClass"
footerClass="footerClass" rowClasses="oddRowClass, evenRowClass"
columnClasses="dataValueColumnClass,dataValueColumnClass"
cellpadding="2" cellpadding="0" rules="all" border="0">
<hx:columnEx id="columnEx2a" width="60%">
<f:facet name="header">
<hutputText styleClass="outputText" value="Practice Area"
id="header2a"></hutputText>
</f:facet>
<hutputText id="textSpecialty"
value='#{practiceAreaList.paMapvarpracticeArea\"401\"http://0.practiceArea}'
rendered="#{!sessionScope.isEditable}">
</hutputText>

<h:panelGroup id="paIDPG">
<h:selectOneMenu id="pa" styleClass="selectOneMenu"
value='#{varpracticeArea\"401\"[0].practiceArea}'
rendered="#{sessionScope.isEditable}">
<f:selectItems value="#{practiceAreaList.paList}" />
</h:selectOneMenu>
<h:message for="pa" errorClass="errorMessageStyleClass"
fatalClass="errorMessageStyleClass"></h:message>
</h:panelGroup>

</hx:columnEx>

<hx:columnEx id="columnEx2b" width="40%">
<f:facet name="header">
<hutputText styleClass="outputText" value="% of Your Time"
id="header2b"></hutputText>
</f:facet>
<hutputText id="textPercentage"
value='#{varpracticeArea\"401\"[0].estimatedAmount}'
rendered="#{!sessionScope.isEditable}">
</hutputText>
<h:panelGroup id="paValuePG">
<h:inputText id="estimatedAmount"
value='#{varpracticeArea\"401\"[0].estimatedAmount}'
rendered="#{sessionScope.isEditable}"
styleClass="inputText">
</h:inputText>
<h:message for="estimatedAmount"
errorClass="errorMessageStyleClass"
fatalClass="errorMessageStyleClass"></h:message>
</h:panelGroup>
</hx:columnEx>
</hx:dataTableEx>
To be precise, I get the following error when I submit the form
javax.faces.el.PropertyNotFoundException: Error testing property 'practiceArea' in bean of type null
at com.sun.faces.el.PropertyResolverImpl.getType(PropertyResolverImpl.java:343)
at com.ibm.faces.databind.SelectItemsPropResolver.getType(SelectItemsPropResolver.java:107)
at com.sun.faces.el.impl.ArraySuffix.getType(ArraySuffix.java:240)
at com.sun.faces.el.impl.ComplexValue.getType(ComplexValue.java:208)
at com.sun.faces.el.ValueBindingImpl.getType(ValueBindingImpl.java:292)
Stephane Legendre
Greenhorn

Joined: Jun 04, 2008
Posts: 1
Hi,

I've got the exact same problem.

Did you receive any hint to solve it?
 
Consider Paul's rocket mass heater.
 
subject: Backing Bean having Map properties