This week's book giveaways are in the Refactoring and Agile forums.
We're giving away four copies each of Re-engineering Legacy Software and Docker in Action and have the authors on-line!
See this thread and this one for details.
Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Backing Bean having Map properties

 
vaithee sub
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I've got the exact same problem.

Did you receive any hint to solve it?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic