You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ofbiz.apache.org by Patrick <pa...@gmail.com> on 2010/02/02 16:58:35 UTC
How to make an inner join for a drop down?
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
Re: How to make an inner join for a drop down?
Posted by Awdesh Parihar <aw...@gmail.com>.
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 : awdesh.parihar@hotwaxmedia.com
Contact : +91-98933-51789
Re: How to make an inner join for a drop down?
Posted by Parimal Gain <pa...@hotwaxmedia.com>.
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
>
Re: How to make an inner join for a drop down?
Posted by Patrick <pa...@gmail.com>.
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 <ci...@gmail.com> 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 <pa...@gmail.com> 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
>>
>
Re: How to make an inner join for a drop down?
Posted by Cimballi <ci...@gmail.com>.
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 <pa...@gmail.com> 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
>