[ 
https://issues.apache.org/jira/browse/OFBIZ-4971?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13422600#comment-13422600
 ] 

Daniel Riquelme commented on OFBIZ-4971:
----------------------------------------

Sorry for the delay, here is a test tree that will fail when the patch is not 
applied.
NOTE: entity-name must be provided for each node tag for this patch to work.

Create the file:

/ofbiz/specialpurpose/example/widget/example/ExampleTrees.xml


With the following content:
{code:title=ExampleTrees.xml|borderStyle=solid}
<trees xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
        
xsi:noNamespaceSchemaLocation="http://ofbiz.apache.org/dtds/widget-tree.xsd";>

        <tree name="ExampleTree" entity-name="ExampleFeatureAppl" 
root-node-name="node-root" default-render-style="expand-collapse" 
default-wrap-style="accountItem" expand-collapse-request="GlAccountNavigate">
        <node name="node-root" render-style="simple" 
entity-name="ExampleFeatureAppl">
            <sub-node node-name="node-body">
                <entity-condition entity-name="ExampleFeatureAppl">
                        <condition-expr field-name="exampleId" 
operator="not-equals" from-field="nullValue"/>
                </entity-condition>
            </sub-node>
        </node>
        <node name="node-body" entity-name="ExampleFeatureAppl">
            <entity-one entity-name="ExampleFeatureAppl" 
value-field="glAccount"></entity-one>
            <link target="EditExampleFeatureAppl" text="asd">
                <parameter param-name="exampleId"/>
                <parameter param-name="exampleFeatureId"/>
                <parameter param-name="fromDate"/>
            </link>
            <sub-node node-name="node-body">
                <entity-and entity-name="ExampleFeatureAppl">
                    <field-map field-name="exampleId" from-field="exampleId"/>
                    
                </entity-and>
            </sub-node>
        </node>
    </tree>
</trees>
{code}


Include the tree in any Screen, for example:
{code:title=ExampleScreens.xml#FindExample|borderStyle=solid}
...
<decorator-section name="search-results">
    <include-form name="ListExamples" 
location="component://example/widget/example/ExampleForms.xml"/>
    <include-tree 
location="component://example/widget/example/ExampleTrees.xml" 
name="ExampleTree"/>
...
</decorator-section>
{code}
                
> Improve Tree Widget to support Multiple PK Entities
> ---------------------------------------------------
>
>                 Key: OFBIZ-4971
>                 URL: https://issues.apache.org/jira/browse/OFBIZ-4971
>             Project: OFBiz
>          Issue Type: Improvement
>          Components: framework
>    Affects Versions: SVN trunk
>            Reporter: Daniel Riquelme
>              Labels: patch
>             Fix For: SVN trunk
>
>         Attachments: OFBIZ-4971.patch
>
>
> The PKs are used to keep track of which nodes have been rendered when 
> performing recursion inside Tree Widget rendering code.
> Currently Multiple PKs Entities can't be used as nodes in a Tree Widget 
> because the rendering code does not handle them.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to