[OFBiz] Users - Tree widget sub-node entity primary key problem

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[OFBiz] Users - Tree widget sub-node entity primary key problem

Chris Juettner
Ok, I've searched the mailing list for this and not sure if I've found a
issue with tree maps.  What's happening is the sub-node definition is executing
an entity operation against a table that has a different primary key than
node-root. The application is using the primary key column from the ProjectCdrl
entity as the column to use to read EspProject and not the "projectId" field.
 

Here is stack trace snippet, the Trees.xml definition and what looks like
the suspect code in ModelTree.renderNodeString.  Anybody else encounter
this situation?

---- runtime exception report --------------------------------------------------
The field name (or key) [cdrlId] is not valid, printing IllegalArgumentException
instead of throwing it because Map interface specification does not allow
throwing that exception.
Exception: java.lang.IllegalArgumentException
Message: [GenericEntity.get] "cdrlId" is not a field of EspProject
---- stack trace ---------------------------------------------------------------
java.lang.IllegalArgumentException: [GenericEntity.get] "cdrlId" is not
a field of EspProject
org.ofbiz.entity.GenericEntity.get(GenericEntity.java:299)
org.ofbiz.entity.GenericEntity.get(GenericEntity.java:1214)
org.ofbiz.widget.tree.ModelTree$ModelNode.renderNodeString(ModelTree.java:460)


<tree name="CdrlMenu" root-node-name="node-root" default-render-style="simple"
default-wrap-style="verticalmenu" entity-name="ProjectCdrl">
  <node name="node-root" wrap-style="verticalmenu">
    <entity-one entity-name="EspProject" use-cache="false" value-name="espProject">
       <field-map field-name="projectId" env-name="projectId" />
    </entity-one>
    <sub-node node-name="node-cdrl-admin">
      <entity-and entity-name="EspProject" use-cache="false">
        <field-map env-name="projectId" field-name="projectId"/>
      </entity-and>
    </sub-node>
  </node>

String thisPkName = node.getPkName();
String thisEntityId = (String) val.get(thisPkName);


 
_______________________________________________
Users mailing list
[hidden email]
http://lists.ofbiz.org/mailman/listinfo/users