How to display two product category list in the create product form

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

How to display two product category list in the create product form

Larry.Liu
Hi all,

Does anybody knows how to display two product category select-box list in
the create product form?

Here we have two questions,

First is how can we have two list of the same entity(with different
entity-constraint) in one form, we can define the field as below, but the
later one will override the first one, that's the problem.

        <field name="productCategoryId"
title="${uiLabelMap.ProductBrandName}" widget-style="selectBox"
required-field="true">
            <drop-down allow-empty="false">
                <entity-options entity-name="ProductCategoryRollup"
description="${productCategoryId}">
                    <entity-constraint name="parentProductCategoryId"
operator="equals" value="brand" />
                </entity-options>
            </drop-down>
        </field>
        <field name="productCategoryId" title="${uiLabelMap.ProductStyle}"
widget-style="selectBox" required-field="true">
            <drop-down allow-empty="false">
                <entity-options entity-name="ProductCategoryRollup"
description="${productCategoryId}">
                    <entity-constraint name="parentProductCategoryId"
operator="equals" value="gender" />
                </entity-options>
            </drop-down>
        </field>

The second question is how can we display the categoryName in the drop-down
list? the problem is  we are getting the category list from entity
ProductCategoryRollup, but there is only categoryId, no categoryName in that
entity, so how can we do that in the XML form definition?

Thanks for your great help.

Regards,
Liu Xiangqian

Wizitsoft Information Technology Ltd.
www.wizitsoft.com | (86) 010-62670653 ext 614
Reply | Threaded
Open this post in threaded view
|

Re: How to display two product category list in the create product form

BJ Freeman
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

I would step back and look at how to put one screenlets, twice into a
screen each dealing with a category. the screenlet being a form.

look at creating an entity-view that has the info you want. for viewing
purposes you can use them.



Larry.Liu sent the following on 3/23/2009 12:55 AM:

> Hi all,
>
> Does anybody knows how to display two product category select-box list in
> the create product form?
>
> Here we have two questions,
>
> First is how can we have two list of the same entity(with different
> entity-constraint) in one form, we can define the field as below, but the
> later one will override the first one, that's the problem.
>
>         <field name="productCategoryId"
> title="${uiLabelMap.ProductBrandName}" widget-style="selectBox"
> required-field="true">
>             <drop-down allow-empty="false">
>                 <entity-options entity-name="ProductCategoryRollup"
> description="${productCategoryId}">
>                     <entity-constraint name="parentProductCategoryId"
> operator="equals" value="brand" />
>                 </entity-options>
>             </drop-down>
>         </field>
>         <field name="productCategoryId" title="${uiLabelMap.ProductStyle}"
> widget-style="selectBox" required-field="true">
>             <drop-down allow-empty="false">
>                 <entity-options entity-name="ProductCategoryRollup"
> description="${productCategoryId}">
>                     <entity-constraint name="parentProductCategoryId"
> operator="equals" value="gender" />
>                 </entity-options>
>             </drop-down>
>         </field>
>
> The second question is how can we display the categoryName in the drop-down
> list? the problem is  we are getting the category list from entity
> ProductCategoryRollup, but there is only categoryId, no categoryName in that
> entity, so how can we do that in the XML form definition?
>
> Thanks for your great help.
>
> Regards,
> Liu Xiangqian
>
> Wizitsoft Information Technology Ltd.
> www.wizitsoft.com | (86) 010-62670653 ext 614
>
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFJx0sdrP3NbaWWqE4RAgVFAJ4of8NrS73Z+x+3m7uWO3llKVOETQCfeoTK
UYDnVhuEFdytCU5k2hGQbOc=
=Q5hG
-----END PGP SIGNATURE-----
Reply | Threaded
Open this post in threaded view
|

Re: How to display two product category list in the create product form

Larry.Liu
Hi BJ,

For the second problem, I think it's quite a good idea to define a view
containing all the information needed,

But for the first problem, what we are trying to do is try to list
categories based on some entity-constrain twice in the creating product
screen, but that screen was defined using entity-based xml form, so is it
possible to add screenlet directly in the xml form? can you advice where can
I found further material on this topic?

Thanks very much

Regards,
Liu Xiangqian

Wizitsoft Information Technology Ltd.
www.wizitsoft.com | (86) 010-62670653 ext 614


On Mon, Mar 23, 2009 at 4:41 PM, BJ Freeman <[hidden email]> wrote:

> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> I would step back and look at how to put one screenlets, twice into a
> screen each dealing with a category. the screenlet being a form.
>
> look at creating an entity-view that has the info you want. for viewing
> purposes you can use them.
>
>
>
> Larry.Liu sent the following on 3/23/2009 12:55 AM:
> > Hi all,
> >
> > Does anybody knows how to display two product category select-box list in
> > the create product form?
> >
> > Here we have two questions,
> >
> > First is how can we have two list of the same entity(with different
> > entity-constraint) in one form, we can define the field as below, but the
> > later one will override the first one, that's the problem.
> >
> >         <field name="productCategoryId"
> > title="${uiLabelMap.ProductBrandName}" widget-style="selectBox"
> > required-field="true">
> >             <drop-down allow-empty="false">
> >                 <entity-options entity-name="ProductCategoryRollup"
> > description="${productCategoryId}">
> >                     <entity-constraint name="parentProductCategoryId"
> > operator="equals" value="brand" />
> >                 </entity-options>
> >             </drop-down>
> >         </field>
> >         <field name="productCategoryId"
> title="${uiLabelMap.ProductStyle}"
> > widget-style="selectBox" required-field="true">
> >             <drop-down allow-empty="false">
> >                 <entity-options entity-name="ProductCategoryRollup"
> > description="${productCategoryId}">
> >                     <entity-constraint name="parentProductCategoryId"
> > operator="equals" value="gender" />
> >                 </entity-options>
> >             </drop-down>
> >         </field>
> >
> > The second question is how can we display the categoryName in the
> drop-down
> > list? the problem is  we are getting the category list from entity
> > ProductCategoryRollup, but there is only categoryId, no categoryName in
> that
> > entity, so how can we do that in the XML form definition?
> >
> > Thanks for your great help.
> >
> > Regards,
> > Liu Xiangqian
> >
> > Wizitsoft Information Technology Ltd.
> > www.wizitsoft.com | (86) 010-62670653 ext 614
> >
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.6 (MingW32)
> Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
>
> iD8DBQFJx0sdrP3NbaWWqE4RAgVFAJ4of8NrS73Z+x+3m7uWO3llKVOETQCfeoTK
> UYDnVhuEFdytCU5k2hGQbOc=
> =Q5hG
> -----END PGP SIGNATURE-----
>
Reply | Threaded
Open this post in threaded view
|

Re: How to display two product category list in the create product form

BJ Freeman
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

don't have an example off the top of my head.
however there are examples of using screenlet in ofbiz.
to clarify a form definition is included in a Screen definition, in widgets.
though what I am proposing is not ofbiz I am sure you can figure it out.
:D
Maybe some one else will jump in.


Larry.Liu sent the following on 3/23/2009 1:51 AM:

> Hi BJ,
>
> For the second problem, I think it's quite a good idea to define a view
> containing all the information needed,
>
> But for the first problem, what we are trying to do is try to list
> categories based on some entity-constrain twice in the creating product
> screen, but that screen was defined using entity-based xml form, so is it
> possible to add screenlet directly in the xml form? can you advice where can
> I found further material on this topic?
>
> Thanks very much
>
> Regards,
> Liu Xiangqian
>
> Wizitsoft Information Technology Ltd.
> www.wizitsoft.com | (86) 010-62670653 ext 614
>
>
> On Mon, Mar 23, 2009 at 4:41 PM, BJ Freeman <[hidden email]> wrote:
>
> I would step back and look at how to put one screenlets, twice into a
> screen each dealing with a category. the screenlet being a form.
>
> look at creating an entity-view that has the info you want. for viewing
> purposes you can use them.
>
>
>
> Larry.Liu sent the following on 3/23/2009 12:55 AM:
>>>> Hi all,
>>>>
>>>> Does anybody knows how to display two product category select-box list in
>>>> the create product form?
>>>>
>>>> Here we have two questions,
>>>>
>>>> First is how can we have two list of the same entity(with different
>>>> entity-constraint) in one form, we can define the field as below, but the
>>>> later one will override the first one, that's the problem.
>>>>
>>>>         <field name="productCategoryId"
>>>> title="${uiLabelMap.ProductBrandName}" widget-style="selectBox"
>>>> required-field="true">
>>>>             <drop-down allow-empty="false">
>>>>                 <entity-options entity-name="ProductCategoryRollup"
>>>> description="${productCategoryId}">
>>>>                     <entity-constraint name="parentProductCategoryId"
>>>> operator="equals" value="brand" />
>>>>                 </entity-options>
>>>>             </drop-down>
>>>>         </field>
>>>>         <field name="productCategoryId"
> title="${uiLabelMap.ProductStyle}"
>>>> widget-style="selectBox" required-field="true">
>>>>             <drop-down allow-empty="false">
>>>>                 <entity-options entity-name="ProductCategoryRollup"
>>>> description="${productCategoryId}">
>>>>                     <entity-constraint name="parentProductCategoryId"
>>>> operator="equals" value="gender" />
>>>>                 </entity-options>
>>>>             </drop-down>
>>>>         </field>
>>>>
>>>> The second question is how can we display the categoryName in the
> drop-down
>>>> list? the problem is  we are getting the category list from entity
>>>> ProductCategoryRollup, but there is only categoryId, no categoryName in
> that
>>>> entity, so how can we do that in the XML form definition?
>>>>
>>>> Thanks for your great help.
>>>>
>>>> Regards,
>>>> Liu Xiangqian
>>>>
>>>> Wizitsoft Information Technology Ltd.
>>>> www.wizitsoft.com | (86) 010-62670653 ext 614
>>>>
>>

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFJx1UArP3NbaWWqE4RAjEsAJ9y4xEz5WIbhqka8kRLv5euSPaVsACfTs5q
kA0SqJMBz+O2t/Q2k1fh/Xc=
=iX3n
-----END PGP SIGNATURE-----