How can I do a join for a drop-down? I need to drop down all
categories from a specific catalog, so I need to do a join ProdCatalogCategory and ProductCategory. Can this be done with an entity-constraint? What is the appropriate way to do this for a drop-down? <field name="contentTypeId" position="1"> <drop-down allow-empty="true"> <entity-options description="${categoryName}" entity-name="ProductCategory" key-field-name="productCategoryId"> <!-- need to filter on a particular productCatalogId which I need to get from ProdCatalogCategory--> </entity-options> </drop-down> </field> Thanks. Patrick |
You can do this with a view entity, like here :
<view-entity entity-name="PartyAndPerson" package-name="org.ofbiz.party.party" title="Party and Person View Entity"> <member-entity entity-alias="PTY" entity-name="Party"/> <member-entity entity-alias="PERS" entity-name="Person"/> <alias-all entity-alias="PTY"/> <alias-all entity-alias="PERS"/> <view-link entity-alias="PTY" rel-entity-alias="PERS"> <key-map field-name="partyId"/> </view-link> </view-entity> Or with a DynamicViewEntity programatically. Cimballi On Tue, Feb 2, 2010 at 10:58 AM, Patrick <[hidden email]> wrote: > How can I do a join for a drop-down? I need to drop down all > categories from a specific catalog, so I need to do a join > ProdCatalogCategory and ProductCategory. Can this be done with an > entity-constraint? What is the appropriate way to do this for a > drop-down? > > <field name="contentTypeId" position="1"> > <drop-down allow-empty="true"> > <entity-options description="${categoryName}" > entity-name="ProductCategory" key-field-name="productCategoryId"> > <!-- need to filter on a particular productCatalogId which I > need to get from ProdCatalogCategory--> > </entity-options> > </drop-down> > </field> > > Thanks. Patrick > |
Hi Cimballi,
Since <drop-down> is expecting an entity-name and you have specified a view-entity, can you be a little more specific? Instead of <drop-down> <entity-options description="${description}" entity-name="ContentType" I think I must need a different syntax for the view-entity. I noticed if I put a view-entity into the entity-name field it doesn't work. So how do I use the view-entity with the drop-down? Thanks Patrick On Tue, Feb 2, 2010 at 10:02 AM, Cimballi <[hidden email]> wrote: > You can do this with a view entity, like here : > <view-entity entity-name="PartyAndPerson" > package-name="org.ofbiz.party.party" > title="Party and Person View Entity"> > <member-entity entity-alias="PTY" entity-name="Party"/> > <member-entity entity-alias="PERS" entity-name="Person"/> > <alias-all entity-alias="PTY"/> > <alias-all entity-alias="PERS"/> > <view-link entity-alias="PTY" rel-entity-alias="PERS"> > <key-map field-name="partyId"/> > </view-link> > </view-entity> > > Or with a DynamicViewEntity programatically. > > Cimballi > > > On Tue, Feb 2, 2010 at 10:58 AM, Patrick <[hidden email]> wrote: >> How can I do a join for a drop-down? I need to drop down all >> categories from a specific catalog, so I need to do a join >> ProdCatalogCategory and ProductCategory. Can this be done with an >> entity-constraint? What is the appropriate way to do this for a >> drop-down? >> >> <field name="contentTypeId" position="1"> >> <drop-down allow-empty="true"> >> <entity-options description="${categoryName}" >> entity-name="ProductCategory" key-field-name="productCategoryId"> >> <!-- need to filter on a particular productCatalogId which I >> need to get from ProdCatalogCategory--> >> </entity-options> >> </drop-down> >> </field> >> >> Thanks. Patrick >> > |
In reply to this post by Patrick-4
Hello Patrick,
If entity-options is not your constraint then you can use list-option for drop-down with the list prepared with all condition you need. Regards -- Parimal Gain Patrick wrote: > How can I do a join for a drop-down? I need to drop down all > categories from a specific catalog, so I need to do a join > ProdCatalogCategory and ProductCategory. Can this be done with an > entity-constraint? What is the appropriate way to do this for a > drop-down? > > <field name="contentTypeId" position="1"> > <drop-down allow-empty="true"> > <entity-options description="${categoryName}" > entity-name="ProductCategory" key-field-name="productCategoryId"> > <!-- need to filter on a particular productCatalogId which I > need to get from ProdCatalogCategory--> > </entity-options> > </drop-down> > </field> > > Thanks. Patrick > |
Hi Partick,
Create a view entity(ProdCatalogAndCategory) by using two member entities ProdCatalogCategory and ProductCategory , and apply constraint on that view entity <entity-options description="${categoryName}" entity-name="ProdCatalogAndCategory" key-field-name=" productCategoryId"> <!-- filter list by productCatalogId --> </entity-options> HTH -- Awdesh Parihar HotWax Media http://www.hotwaxmedia.com ============================ Email : [hidden email] Contact : +91-98933-51789 |
Free forum by Nabble | Edit this page |