How to implement one to many relation in ofbiz

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

How to implement one to many relation in ofbiz

naveen.ara@gmail.com
How can I implement one to many relationship in ofbiz between two entities, I have a entity Plan which can have many number of Items(other entity), I have defined relation in entityModel.xml :

     <entity entity-name="Plan"
        package-name="org.ofbiz.webapp.terp.plan" title="plan entity">
        <field name="planId" type="id-ne"> <description>Primary sequence ID</description> </field>
        <field name="divisionId" type="id-ne"></field>
        <field name="transactionTypeId" type="id-ne"></field>
        <field name="planCode" type="very-short"></field>
        <field name="planName" type="short-varchar"></field>
                <relation rel-entity-name="Item" type="many" fk-name="item_id">
        <key-map field-name="itemId"/>
        </relation>               
      </entity>

In the add form of plan given by entity engine item is a simple text box, so how can I add multiple items for a plan?

Is there a UI widget in ofbiz which allows us to select multiple items for one plan while we are adding new plan.

If there is no widget, any online tutorial on implementing something like this.