You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ofbiz.apache.org by Avijit Bose <bo...@gmail.com> on 2022/05/23 08:31:24 UTC

Referencing form field from different table

Dear Sir,
My customer entity is as follows:
---------------------------
    <entity entity-name="AkmCustomer"
package-name="com.akm.ofbiz.import" title="Customer Entity">
        <field name="customerId" type="id"><description>primary
sequenced ID</description></field>
        <field name="customerTypeId" type="id"></field>
        <field name="companyName" type="name"></field>
        <prim-key field="customerId"/>
    </entity>
--------------------------
Then I have a customer address entity as follows:
----------------------------
    <entity entity-name="AkmCustomerAddress"
package-name="com.akm.ofbiz.import" title="Customer Address Entity">
        <field name="customerAddressId" type="id"><description>primary
sequenced ID</description></field>
        <field name="customerId" type="id">
        <field name="customerAddress" type="name"></field>
        <field name="shippingAddress" type="name"></field>
        <prim-key field="customerAddressId"/>
    </entity>
----------------------------

I have find form as follows. This find is from "AKMCustomer" entity.
-------------------------------------------
        <form name="FindCustomers" type="single"
target="FindCustomers" default-entity-name="AkmCustomer">
        <field name="noConditionFind"><hidden value="Y"/></field>
        <!-- if the above "noConditionFind" field name isn't there
then with all fields empty no query will be done -->
        <field name="customerId" title="${uiLabelMap.customerId}">
                       <drop-down allow-empty="true" current-description="">
                                    <entity-options
description="${customerId} - ${customerAddress}"
key-field-name="customerId" entity-name="AkmCustomer">
                                    <entity-order-by field-name="customerId"/>
                                    </entity-options>
                      </drop-down>
        </field>
        <field name="customerContactPerson"
title="${uiLabelMap.customerContactPerson}"><text-find/></field>
        <field name="searchButton" title="${uiLabelMap.CommonFind}"
widget-style="smallSubmit">
        <submit button-type="button"
image-location="/images/icons/magnifier.png"/>
        </field>
        </form>
-------------------------------------------
Request question 1: How do I get the '${customerAddress}' value from
'AkmCustomerAddress' entity in the above drop down list with
'customerId' as the key value?

Then I have list form as follows corresponding to the above find form:
-------------------------------------------

        <form name="ListCustomers" type="list" list-name="listIt"
paginate-target="FindCustomers"
        default-entity-name="AkmCustomer" separate-columns="true"
odd-row-style="alternate-row"
        header-row-style="header-row-2"
default-table-style="basic-table hover-bar">
        <actions>
        <!-- Preparing search results for user query by using OFBiz
stock service to perform find operations
        on a single entity or view entity -->
        <service service-name="performFind" result-map="result"
result-map-list="listIt">
<field-map field-name="inputFields" from-field="eximCtx"/>
<field-map field-name="entityName" value="AkmCustomer"/>
<field-map field-name="orderBy" from-field="parameters.sortField"/>
<field-map field-name="viewIndex" from-field="viewIndex"/>
<field-map field-name="viewSize" from-field="viewSize"/>
</service>
<field name="customerId" title="${uiLabelMap.customerId}"
sort-field="false"><display/></field>
<field name="customerTypeId" title="${uiLabelMap.customerTypeId}"
sort-field="false"><display/></field>
<field name="companyName" title="${uiLabelMap.companyName}"
sort-field="false"><display/></field>
<field name="customerAddress" title="${uiLabelMap.customerAddress}"
sort-field="false"><display/></field>
 </form>
-------------------------------------------
Request question 2: Again how do I get the 'customerAddress' field
value in the list with 'customerId' as the key?

In short how do I get a value from a second entity in a dropdown and
list form field with a first entity key value as a reference in the
second table.

regards
Avijit Bose

Re: Referencing form field from different table

Posted by Avijit Bose <bo...@gmail.com>.
Dear Sir,

No. I am not looking at 'dependent drop downs'.

To make it simple... I have a dropdown like this...
---------------------------
<field name="customerId" title="${uiLabelMap.customerId}">
<drop-down allow-empty="true" current-description="">
<entity-options description="${customerId} - ${customerAddress}"
key-field-name="customerId" entity-name="AkmCustomer">
<entity-order-by field-name="customerId"/>
</entity-options>
</drop-down>
</field>
---------------------------
In the '<entity-options description="${customerId} -
${customerAddress}" key-field-name="customerId"
entity-name="AkmCustomer">'...pls note that the entity-name is
''AkmCustomer" where 'customerId' is primary key. Getting
${customerId} from 'AkmCustomer' table. But I have to get
${customerAddress} from "AkmCustomerAddress" table which is different
from "AkmCustomer". ${customerId} and ${customerAddress} fields are
not dependent on each other.

The field "${customerAddress}" is coming from a different entity where
'customerId' is a foreign key. Its entity-name is
"AkmCustomerAddress".

Question: how do I get the  ${customerAddress} from
"AkmCustomerAddress" table name when my drop down table name is
"AkmCustomer"?

On Mon, May 23, 2022 at 2:34 PM Jacques Le Roux
<ja...@les7arts.com> wrote:
>
> Hi Avijit,
>
> I did not read all the details. Are you looking for "dependent drop-downs"? If yes, you may have a look at
> https://demo-trunk.ofbiz.apache.org/example/control/FormWidgetExamples#DropDownFieldsExampleForm_dependendDropDownFields_title
>
> HTH
>
> Jacques
>
> Le 23/05/2022 à 10:31, Avijit Bose a écrit :
> > Dear Sir,
> > My customer entity is as follows:
> > ---------------------------
> >      <entity entity-name="AkmCustomer"
> > package-name="com.akm.ofbiz.import" title="Customer Entity">
> >          <field name="customerId" type="id"><description>primary
> > sequenced ID</description></field>
> >          <field name="customerTypeId" type="id"></field>
> >          <field name="companyName" type="name"></field>
> >          <prim-key field="customerId"/>
> >      </entity>
> > --------------------------
> > Then I have a customer address entity as follows:
> > ----------------------------
> >      <entity entity-name="AkmCustomerAddress"
> > package-name="com.akm.ofbiz.import" title="Customer Address Entity">
> >          <field name="customerAddressId" type="id"><description>primary
> > sequenced ID</description></field>
> >          <field name="customerId" type="id">
> >          <field name="customerAddress" type="name"></field>
> >          <field name="shippingAddress" type="name"></field>
> >          <prim-key field="customerAddressId"/>
> >      </entity>
> > ----------------------------
> >
> > I have find form as follows. This find is from "AKMCustomer" entity.
> > -------------------------------------------
> >          <form name="FindCustomers" type="single"
> > target="FindCustomers" default-entity-name="AkmCustomer">
> >          <field name="noConditionFind"><hidden value="Y"/></field>
> >          <!-- if the above "noConditionFind" field name isn't there
> > then with all fields empty no query will be done -->
> >          <field name="customerId" title="${uiLabelMap.customerId}">
> >                         <drop-down allow-empty="true" current-description="">
> >                                      <entity-options
> > description="${customerId} - ${customerAddress}"
> > key-field-name="customerId" entity-name="AkmCustomer">
> >                                      <entity-order-by field-name="customerId"/>
> >                                      </entity-options>
> >                        </drop-down>
> >          </field>
> >          <field name="customerContactPerson"
> > title="${uiLabelMap.customerContactPerson}"><text-find/></field>
> >          <field name="searchButton" title="${uiLabelMap.CommonFind}"
> > widget-style="smallSubmit">
> >          <submit button-type="button"
> > image-location="/images/icons/magnifier.png"/>
> >          </field>
> >          </form>
> > -------------------------------------------
> > Request question 1: How do I get the '${customerAddress}' value from
> > 'AkmCustomerAddress' entity in the above drop down list with
> > 'customerId' as the key value?
> >
> > Then I have list form as follows corresponding to the above find form:
> > -------------------------------------------
> >
> >          <form name="ListCustomers" type="list" list-name="listIt"
> > paginate-target="FindCustomers"
> >          default-entity-name="AkmCustomer" separate-columns="true"
> > odd-row-style="alternate-row"
> >          header-row-style="header-row-2"
> > default-table-style="basic-table hover-bar">
> >          <actions>
> >          <!-- Preparing search results for user query by using OFBiz
> > stock service to perform find operations
> >          on a single entity or view entity -->
> >          <service service-name="performFind" result-map="result"
> > result-map-list="listIt">
> > <field-map field-name="inputFields" from-field="eximCtx"/>
> > <field-map field-name="entityName" value="AkmCustomer"/>
> > <field-map field-name="orderBy" from-field="parameters.sortField"/>
> > <field-map field-name="viewIndex" from-field="viewIndex"/>
> > <field-map field-name="viewSize" from-field="viewSize"/>
> > </service>
> > <field name="customerId" title="${uiLabelMap.customerId}"
> > sort-field="false"><display/></field>
> > <field name="customerTypeId" title="${uiLabelMap.customerTypeId}"
> > sort-field="false"><display/></field>
> > <field name="companyName" title="${uiLabelMap.companyName}"
> > sort-field="false"><display/></field>
> > <field name="customerAddress" title="${uiLabelMap.customerAddress}"
> > sort-field="false"><display/></field>
> >   </form>
> > -------------------------------------------
> > Request question 2: Again how do I get the 'customerAddress' field
> > value in the list with 'customerId' as the key?
> >
> > In short how do I get a value from a second entity in a dropdown and
> > list form field with a first entity key value as a reference in the
> > second table.
> >
> > regards
> > Avijit Bose
>

Re: Referencing form field from different table

Posted by Avijit Bose <bo...@gmail.com>.
Dear Sir,

I got the column value from entityB in the list which was referring entityA.

thank you
Avijit

On Tue, May 24, 2022 at 6:21 AM Avijit Bose <bo...@gmail.com> wrote:

> Dear Sir,
>
> No. It did not got me the desired result. The drop down remains blank.
> Probably because I have to search 'AkmMasterEnquiry' table in the
> search form as shown
> " <form name="FindExportEnquiries" type="single"
> target="FindExportEnquiries" default-entity-name="AkmMasterEnquiry"> "
>
>
> To do it in another way...
>
> 1. Can we call the default search service " service-name="performFind"
> " using FTL? In other words.... how do i call 'performFind' from FTL?
> 2. And then get the return list named 'listIt' as shown in Minilang
> tag " result-map="result" result-map-list="listIt" " in the same FTL?
>
> Pls help.
> regards
> Avijit
>
> On Mon, May 23, 2022 at 10:24 PM Rishi Solanki <ri...@gmail.com>
> wrote:
> >
> > Dear Avijit,
> > <field name="customerId">
> >             <drop-down allow-empty="true">
> >                 <entity-options entity-name="AkmCustomer"
> > key-field-name="customerId" description="${customerId} -
> ${customerAddress}
> > ">
> >                     <entity-constraint name="customerId"
> > env-name="customerId" />
> >                     <entity-order-by field-name="customerId"/>
> >                 </entity-options>
> >             </drop-down>
> >         </field>
> >
> > Above is the overall signature you can pass entity name and constraints
> as
> > you wish.
> >
> > Hope that helps!
> >
> > Best Regards,
> > --
> > Rishi Solanki
> > *CTO, Mindpath Technology*
> > Intelligent Solutions
> > cell: +91-98932-87847
> > LinkedIn <https://www.linkedin.com/in/rishi-solanki-62271b7/>
> >
> >
> > On Mon, May 23, 2022 at 4:45 PM Avijit Bose <bo...@gmail.com>
> wrote:
> >
> > > Dear Sir,
> > >
> > > Second Question: How do I get ${customerAddress} from
> > > 'AkmCustomerAddress' table in list field....when the list is finding
> > > the table named "AkmCustomer".
> > >
> > > regards
> > > Avijit
> > >
> > > On Mon, May 23, 2022 at 2:34 PM Jacques Le Roux
> > > <ja...@les7arts.com> wrote:
> > > >
> > > > Hi Avijit,
> > > >
> > > > I did not read all the details. Are you looking for "dependent
> > > drop-downs"? If yes, you may have a look at
> > > >
> > >
> https://demo-trunk.ofbiz.apache.org/example/control/FormWidgetExamples#DropDownFieldsExampleForm_dependendDropDownFields_title
> > > >
> > > > HTH
> > > >
> > > > Jacques
> > > >
> > > > Le 23/05/2022 à 10:31, Avijit Bose a écrit :
> > > > > Dear Sir,
> > > > > My customer entity is as follows:
> > > > > ---------------------------
> > > > >      <entity entity-name="AkmCustomer"
> > > > > package-name="com.akm.ofbiz.import" title="Customer Entity">
> > > > >          <field name="customerId" type="id"><description>primary
> > > > > sequenced ID</description></field>
> > > > >          <field name="customerTypeId" type="id"></field>
> > > > >          <field name="companyName" type="name"></field>
> > > > >          <prim-key field="customerId"/>
> > > > >      </entity>
> > > > > --------------------------
> > > > > Then I have a customer address entity as follows:
> > > > > ----------------------------
> > > > >      <entity entity-name="AkmCustomerAddress"
> > > > > package-name="com.akm.ofbiz.import" title="Customer Address
> Entity">
> > > > >          <field name="customerAddressId"
> type="id"><description>primary
> > > > > sequenced ID</description></field>
> > > > >          <field name="customerId" type="id">
> > > > >          <field name="customerAddress" type="name"></field>
> > > > >          <field name="shippingAddress" type="name"></field>
> > > > >          <prim-key field="customerAddressId"/>
> > > > >      </entity>
> > > > > ----------------------------
> > > > >
> > > > > I have find form as follows. This find is from "AKMCustomer"
> entity.
> > > > > -------------------------------------------
> > > > >          <form name="FindCustomers" type="single"
> > > > > target="FindCustomers" default-entity-name="AkmCustomer">
> > > > >          <field name="noConditionFind"><hidden value="Y"/></field>
> > > > >          <!-- if the above "noConditionFind" field name isn't there
> > > > > then with all fields empty no query will be done -->
> > > > >          <field name="customerId" title="${uiLabelMap.customerId}">
> > > > >                         <drop-down allow-empty="true"
> > > current-description="">
> > > > >                                      <entity-options
> > > > > description="${customerId} - ${customerAddress}"
> > > > > key-field-name="customerId" entity-name="AkmCustomer">
> > > > >                                      <entity-order-by
> > > field-name="customerId"/>
> > > > >                                      </entity-options>
> > > > >                        </drop-down>
> > > > >          </field>
> > > > >          <field name="customerContactPerson"
> > > > > title="${uiLabelMap.customerContactPerson}"><text-find/></field>
> > > > >          <field name="searchButton"
> title="${uiLabelMap.CommonFind}"
> > > > > widget-style="smallSubmit">
> > > > >          <submit button-type="button"
> > > > > image-location="/images/icons/magnifier.png"/>
> > > > >          </field>
> > > > >          </form>
> > > > > -------------------------------------------
> > > > > Request question 1: How do I get the '${customerAddress}' value
> from
> > > > > 'AkmCustomerAddress' entity in the above drop down list with
> > > > > 'customerId' as the key value?
> > > > >
> > > > > Then I have list form as follows corresponding to the above find
> form:
> > > > > -------------------------------------------
> > > > >
> > > > >          <form name="ListCustomers" type="list" list-name="listIt"
> > > > > paginate-target="FindCustomers"
> > > > >          default-entity-name="AkmCustomer" separate-columns="true"
> > > > > odd-row-style="alternate-row"
> > > > >          header-row-style="header-row-2"
> > > > > default-table-style="basic-table hover-bar">
> > > > >          <actions>
> > > > >          <!-- Preparing search results for user query by using
> OFBiz
> > > > > stock service to perform find operations
> > > > >          on a single entity or view entity -->
> > > > >          <service service-name="performFind" result-map="result"
> > > > > result-map-list="listIt">
> > > > > <field-map field-name="inputFields" from-field="eximCtx"/>
> > > > > <field-map field-name="entityName" value="AkmCustomer"/>
> > > > > <field-map field-name="orderBy" from-field="parameters.sortField"/>
> > > > > <field-map field-name="viewIndex" from-field="viewIndex"/>
> > > > > <field-map field-name="viewSize" from-field="viewSize"/>
> > > > > </service>
> > > > > <field name="customerId" title="${uiLabelMap.customerId}"
> > > > > sort-field="false"><display/></field>
> > > > > <field name="customerTypeId" title="${uiLabelMap.customerTypeId}"
> > > > > sort-field="false"><display/></field>
> > > > > <field name="companyName" title="${uiLabelMap.companyName}"
> > > > > sort-field="false"><display/></field>
> > > > > <field name="customerAddress" title="${uiLabelMap.customerAddress}"
> > > > > sort-field="false"><display/></field>
> > > > >   </form>
> > > > > -------------------------------------------
> > > > > Request question 2: Again how do I get the 'customerAddress' field
> > > > > value in the list with 'customerId' as the key?
> > > > >
> > > > > In short how do I get a value from a second entity in a dropdown
> and
> > > > > list form field with a first entity key value as a reference in the
> > > > > second table.
> > > > >
> > > > > regards
> > > > > Avijit Bose
> > > >
> > >
>

Re: Referencing form field from different table

Posted by Avijit Bose <bo...@gmail.com>.
Dear Sir,

No. It did not got me the desired result. The drop down remains blank.
Probably because I have to search 'AkmMasterEnquiry' table in the
search form as shown
" <form name="FindExportEnquiries" type="single"
target="FindExportEnquiries" default-entity-name="AkmMasterEnquiry"> "


To do it in another way...

1. Can we call the default search service " service-name="performFind"
" using FTL? In other words.... how do i call 'performFind' from FTL?
2. And then get the return list named 'listIt' as shown in Minilang
tag " result-map="result" result-map-list="listIt" " in the same FTL?

Pls help.
regards
Avijit

On Mon, May 23, 2022 at 10:24 PM Rishi Solanki <ri...@gmail.com> wrote:
>
> Dear Avijit,
> <field name="customerId">
>             <drop-down allow-empty="true">
>                 <entity-options entity-name="AkmCustomer"
> key-field-name="customerId" description="${customerId} - ${customerAddress}
> ">
>                     <entity-constraint name="customerId"
> env-name="customerId" />
>                     <entity-order-by field-name="customerId"/>
>                 </entity-options>
>             </drop-down>
>         </field>
>
> Above is the overall signature you can pass entity name and constraints as
> you wish.
>
> Hope that helps!
>
> Best Regards,
> --
> Rishi Solanki
> *CTO, Mindpath Technology*
> Intelligent Solutions
> cell: +91-98932-87847
> LinkedIn <https://www.linkedin.com/in/rishi-solanki-62271b7/>
>
>
> On Mon, May 23, 2022 at 4:45 PM Avijit Bose <bo...@gmail.com> wrote:
>
> > Dear Sir,
> >
> > Second Question: How do I get ${customerAddress} from
> > 'AkmCustomerAddress' table in list field....when the list is finding
> > the table named "AkmCustomer".
> >
> > regards
> > Avijit
> >
> > On Mon, May 23, 2022 at 2:34 PM Jacques Le Roux
> > <ja...@les7arts.com> wrote:
> > >
> > > Hi Avijit,
> > >
> > > I did not read all the details. Are you looking for "dependent
> > drop-downs"? If yes, you may have a look at
> > >
> > https://demo-trunk.ofbiz.apache.org/example/control/FormWidgetExamples#DropDownFieldsExampleForm_dependendDropDownFields_title
> > >
> > > HTH
> > >
> > > Jacques
> > >
> > > Le 23/05/2022 à 10:31, Avijit Bose a écrit :
> > > > Dear Sir,
> > > > My customer entity is as follows:
> > > > ---------------------------
> > > >      <entity entity-name="AkmCustomer"
> > > > package-name="com.akm.ofbiz.import" title="Customer Entity">
> > > >          <field name="customerId" type="id"><description>primary
> > > > sequenced ID</description></field>
> > > >          <field name="customerTypeId" type="id"></field>
> > > >          <field name="companyName" type="name"></field>
> > > >          <prim-key field="customerId"/>
> > > >      </entity>
> > > > --------------------------
> > > > Then I have a customer address entity as follows:
> > > > ----------------------------
> > > >      <entity entity-name="AkmCustomerAddress"
> > > > package-name="com.akm.ofbiz.import" title="Customer Address Entity">
> > > >          <field name="customerAddressId" type="id"><description>primary
> > > > sequenced ID</description></field>
> > > >          <field name="customerId" type="id">
> > > >          <field name="customerAddress" type="name"></field>
> > > >          <field name="shippingAddress" type="name"></field>
> > > >          <prim-key field="customerAddressId"/>
> > > >      </entity>
> > > > ----------------------------
> > > >
> > > > I have find form as follows. This find is from "AKMCustomer" entity.
> > > > -------------------------------------------
> > > >          <form name="FindCustomers" type="single"
> > > > target="FindCustomers" default-entity-name="AkmCustomer">
> > > >          <field name="noConditionFind"><hidden value="Y"/></field>
> > > >          <!-- if the above "noConditionFind" field name isn't there
> > > > then with all fields empty no query will be done -->
> > > >          <field name="customerId" title="${uiLabelMap.customerId}">
> > > >                         <drop-down allow-empty="true"
> > current-description="">
> > > >                                      <entity-options
> > > > description="${customerId} - ${customerAddress}"
> > > > key-field-name="customerId" entity-name="AkmCustomer">
> > > >                                      <entity-order-by
> > field-name="customerId"/>
> > > >                                      </entity-options>
> > > >                        </drop-down>
> > > >          </field>
> > > >          <field name="customerContactPerson"
> > > > title="${uiLabelMap.customerContactPerson}"><text-find/></field>
> > > >          <field name="searchButton" title="${uiLabelMap.CommonFind}"
> > > > widget-style="smallSubmit">
> > > >          <submit button-type="button"
> > > > image-location="/images/icons/magnifier.png"/>
> > > >          </field>
> > > >          </form>
> > > > -------------------------------------------
> > > > Request question 1: How do I get the '${customerAddress}' value from
> > > > 'AkmCustomerAddress' entity in the above drop down list with
> > > > 'customerId' as the key value?
> > > >
> > > > Then I have list form as follows corresponding to the above find form:
> > > > -------------------------------------------
> > > >
> > > >          <form name="ListCustomers" type="list" list-name="listIt"
> > > > paginate-target="FindCustomers"
> > > >          default-entity-name="AkmCustomer" separate-columns="true"
> > > > odd-row-style="alternate-row"
> > > >          header-row-style="header-row-2"
> > > > default-table-style="basic-table hover-bar">
> > > >          <actions>
> > > >          <!-- Preparing search results for user query by using OFBiz
> > > > stock service to perform find operations
> > > >          on a single entity or view entity -->
> > > >          <service service-name="performFind" result-map="result"
> > > > result-map-list="listIt">
> > > > <field-map field-name="inputFields" from-field="eximCtx"/>
> > > > <field-map field-name="entityName" value="AkmCustomer"/>
> > > > <field-map field-name="orderBy" from-field="parameters.sortField"/>
> > > > <field-map field-name="viewIndex" from-field="viewIndex"/>
> > > > <field-map field-name="viewSize" from-field="viewSize"/>
> > > > </service>
> > > > <field name="customerId" title="${uiLabelMap.customerId}"
> > > > sort-field="false"><display/></field>
> > > > <field name="customerTypeId" title="${uiLabelMap.customerTypeId}"
> > > > sort-field="false"><display/></field>
> > > > <field name="companyName" title="${uiLabelMap.companyName}"
> > > > sort-field="false"><display/></field>
> > > > <field name="customerAddress" title="${uiLabelMap.customerAddress}"
> > > > sort-field="false"><display/></field>
> > > >   </form>
> > > > -------------------------------------------
> > > > Request question 2: Again how do I get the 'customerAddress' field
> > > > value in the list with 'customerId' as the key?
> > > >
> > > > In short how do I get a value from a second entity in a dropdown and
> > > > list form field with a first entity key value as a reference in the
> > > > second table.
> > > >
> > > > regards
> > > > Avijit Bose
> > >
> >

Re: Referencing form field from different table

Posted by Rishi Solanki <ri...@gmail.com>.
Dear Avijit,
<field name="customerId">
            <drop-down allow-empty="true">
                <entity-options entity-name="AkmCustomer"
key-field-name="customerId" description="${customerId} - ${customerAddress}
">
                    <entity-constraint name="customerId"
env-name="customerId" />
                    <entity-order-by field-name="customerId"/>
                </entity-options>
            </drop-down>
        </field>

Above is the overall signature you can pass entity name and constraints as
you wish.

Hope that helps!

Best Regards,
--
Rishi Solanki
*CTO, Mindpath Technology*
Intelligent Solutions
cell: +91-98932-87847
LinkedIn <https://www.linkedin.com/in/rishi-solanki-62271b7/>


On Mon, May 23, 2022 at 4:45 PM Avijit Bose <bo...@gmail.com> wrote:

> Dear Sir,
>
> Second Question: How do I get ${customerAddress} from
> 'AkmCustomerAddress' table in list field....when the list is finding
> the table named "AkmCustomer".
>
> regards
> Avijit
>
> On Mon, May 23, 2022 at 2:34 PM Jacques Le Roux
> <ja...@les7arts.com> wrote:
> >
> > Hi Avijit,
> >
> > I did not read all the details. Are you looking for "dependent
> drop-downs"? If yes, you may have a look at
> >
> https://demo-trunk.ofbiz.apache.org/example/control/FormWidgetExamples#DropDownFieldsExampleForm_dependendDropDownFields_title
> >
> > HTH
> >
> > Jacques
> >
> > Le 23/05/2022 à 10:31, Avijit Bose a écrit :
> > > Dear Sir,
> > > My customer entity is as follows:
> > > ---------------------------
> > >      <entity entity-name="AkmCustomer"
> > > package-name="com.akm.ofbiz.import" title="Customer Entity">
> > >          <field name="customerId" type="id"><description>primary
> > > sequenced ID</description></field>
> > >          <field name="customerTypeId" type="id"></field>
> > >          <field name="companyName" type="name"></field>
> > >          <prim-key field="customerId"/>
> > >      </entity>
> > > --------------------------
> > > Then I have a customer address entity as follows:
> > > ----------------------------
> > >      <entity entity-name="AkmCustomerAddress"
> > > package-name="com.akm.ofbiz.import" title="Customer Address Entity">
> > >          <field name="customerAddressId" type="id"><description>primary
> > > sequenced ID</description></field>
> > >          <field name="customerId" type="id">
> > >          <field name="customerAddress" type="name"></field>
> > >          <field name="shippingAddress" type="name"></field>
> > >          <prim-key field="customerAddressId"/>
> > >      </entity>
> > > ----------------------------
> > >
> > > I have find form as follows. This find is from "AKMCustomer" entity.
> > > -------------------------------------------
> > >          <form name="FindCustomers" type="single"
> > > target="FindCustomers" default-entity-name="AkmCustomer">
> > >          <field name="noConditionFind"><hidden value="Y"/></field>
> > >          <!-- if the above "noConditionFind" field name isn't there
> > > then with all fields empty no query will be done -->
> > >          <field name="customerId" title="${uiLabelMap.customerId}">
> > >                         <drop-down allow-empty="true"
> current-description="">
> > >                                      <entity-options
> > > description="${customerId} - ${customerAddress}"
> > > key-field-name="customerId" entity-name="AkmCustomer">
> > >                                      <entity-order-by
> field-name="customerId"/>
> > >                                      </entity-options>
> > >                        </drop-down>
> > >          </field>
> > >          <field name="customerContactPerson"
> > > title="${uiLabelMap.customerContactPerson}"><text-find/></field>
> > >          <field name="searchButton" title="${uiLabelMap.CommonFind}"
> > > widget-style="smallSubmit">
> > >          <submit button-type="button"
> > > image-location="/images/icons/magnifier.png"/>
> > >          </field>
> > >          </form>
> > > -------------------------------------------
> > > Request question 1: How do I get the '${customerAddress}' value from
> > > 'AkmCustomerAddress' entity in the above drop down list with
> > > 'customerId' as the key value?
> > >
> > > Then I have list form as follows corresponding to the above find form:
> > > -------------------------------------------
> > >
> > >          <form name="ListCustomers" type="list" list-name="listIt"
> > > paginate-target="FindCustomers"
> > >          default-entity-name="AkmCustomer" separate-columns="true"
> > > odd-row-style="alternate-row"
> > >          header-row-style="header-row-2"
> > > default-table-style="basic-table hover-bar">
> > >          <actions>
> > >          <!-- Preparing search results for user query by using OFBiz
> > > stock service to perform find operations
> > >          on a single entity or view entity -->
> > >          <service service-name="performFind" result-map="result"
> > > result-map-list="listIt">
> > > <field-map field-name="inputFields" from-field="eximCtx"/>
> > > <field-map field-name="entityName" value="AkmCustomer"/>
> > > <field-map field-name="orderBy" from-field="parameters.sortField"/>
> > > <field-map field-name="viewIndex" from-field="viewIndex"/>
> > > <field-map field-name="viewSize" from-field="viewSize"/>
> > > </service>
> > > <field name="customerId" title="${uiLabelMap.customerId}"
> > > sort-field="false"><display/></field>
> > > <field name="customerTypeId" title="${uiLabelMap.customerTypeId}"
> > > sort-field="false"><display/></field>
> > > <field name="companyName" title="${uiLabelMap.companyName}"
> > > sort-field="false"><display/></field>
> > > <field name="customerAddress" title="${uiLabelMap.customerAddress}"
> > > sort-field="false"><display/></field>
> > >   </form>
> > > -------------------------------------------
> > > Request question 2: Again how do I get the 'customerAddress' field
> > > value in the list with 'customerId' as the key?
> > >
> > > In short how do I get a value from a second entity in a dropdown and
> > > list form field with a first entity key value as a reference in the
> > > second table.
> > >
> > > regards
> > > Avijit Bose
> >
>

Re: Referencing form field from different table

Posted by Avijit Bose <bo...@gmail.com>.
Dear Sir,

Second Question: How do I get ${customerAddress} from
'AkmCustomerAddress' table in list field....when the list is finding
the table named "AkmCustomer".

regards
Avijit

On Mon, May 23, 2022 at 2:34 PM Jacques Le Roux
<ja...@les7arts.com> wrote:
>
> Hi Avijit,
>
> I did not read all the details. Are you looking for "dependent drop-downs"? If yes, you may have a look at
> https://demo-trunk.ofbiz.apache.org/example/control/FormWidgetExamples#DropDownFieldsExampleForm_dependendDropDownFields_title
>
> HTH
>
> Jacques
>
> Le 23/05/2022 à 10:31, Avijit Bose a écrit :
> > Dear Sir,
> > My customer entity is as follows:
> > ---------------------------
> >      <entity entity-name="AkmCustomer"
> > package-name="com.akm.ofbiz.import" title="Customer Entity">
> >          <field name="customerId" type="id"><description>primary
> > sequenced ID</description></field>
> >          <field name="customerTypeId" type="id"></field>
> >          <field name="companyName" type="name"></field>
> >          <prim-key field="customerId"/>
> >      </entity>
> > --------------------------
> > Then I have a customer address entity as follows:
> > ----------------------------
> >      <entity entity-name="AkmCustomerAddress"
> > package-name="com.akm.ofbiz.import" title="Customer Address Entity">
> >          <field name="customerAddressId" type="id"><description>primary
> > sequenced ID</description></field>
> >          <field name="customerId" type="id">
> >          <field name="customerAddress" type="name"></field>
> >          <field name="shippingAddress" type="name"></field>
> >          <prim-key field="customerAddressId"/>
> >      </entity>
> > ----------------------------
> >
> > I have find form as follows. This find is from "AKMCustomer" entity.
> > -------------------------------------------
> >          <form name="FindCustomers" type="single"
> > target="FindCustomers" default-entity-name="AkmCustomer">
> >          <field name="noConditionFind"><hidden value="Y"/></field>
> >          <!-- if the above "noConditionFind" field name isn't there
> > then with all fields empty no query will be done -->
> >          <field name="customerId" title="${uiLabelMap.customerId}">
> >                         <drop-down allow-empty="true" current-description="">
> >                                      <entity-options
> > description="${customerId} - ${customerAddress}"
> > key-field-name="customerId" entity-name="AkmCustomer">
> >                                      <entity-order-by field-name="customerId"/>
> >                                      </entity-options>
> >                        </drop-down>
> >          </field>
> >          <field name="customerContactPerson"
> > title="${uiLabelMap.customerContactPerson}"><text-find/></field>
> >          <field name="searchButton" title="${uiLabelMap.CommonFind}"
> > widget-style="smallSubmit">
> >          <submit button-type="button"
> > image-location="/images/icons/magnifier.png"/>
> >          </field>
> >          </form>
> > -------------------------------------------
> > Request question 1: How do I get the '${customerAddress}' value from
> > 'AkmCustomerAddress' entity in the above drop down list with
> > 'customerId' as the key value?
> >
> > Then I have list form as follows corresponding to the above find form:
> > -------------------------------------------
> >
> >          <form name="ListCustomers" type="list" list-name="listIt"
> > paginate-target="FindCustomers"
> >          default-entity-name="AkmCustomer" separate-columns="true"
> > odd-row-style="alternate-row"
> >          header-row-style="header-row-2"
> > default-table-style="basic-table hover-bar">
> >          <actions>
> >          <!-- Preparing search results for user query by using OFBiz
> > stock service to perform find operations
> >          on a single entity or view entity -->
> >          <service service-name="performFind" result-map="result"
> > result-map-list="listIt">
> > <field-map field-name="inputFields" from-field="eximCtx"/>
> > <field-map field-name="entityName" value="AkmCustomer"/>
> > <field-map field-name="orderBy" from-field="parameters.sortField"/>
> > <field-map field-name="viewIndex" from-field="viewIndex"/>
> > <field-map field-name="viewSize" from-field="viewSize"/>
> > </service>
> > <field name="customerId" title="${uiLabelMap.customerId}"
> > sort-field="false"><display/></field>
> > <field name="customerTypeId" title="${uiLabelMap.customerTypeId}"
> > sort-field="false"><display/></field>
> > <field name="companyName" title="${uiLabelMap.companyName}"
> > sort-field="false"><display/></field>
> > <field name="customerAddress" title="${uiLabelMap.customerAddress}"
> > sort-field="false"><display/></field>
> >   </form>
> > -------------------------------------------
> > Request question 2: Again how do I get the 'customerAddress' field
> > value in the list with 'customerId' as the key?
> >
> > In short how do I get a value from a second entity in a dropdown and
> > list form field with a first entity key value as a reference in the
> > second table.
> >
> > regards
> > Avijit Bose
>

Re: Referencing form field from different table

Posted by Jacques Le Roux <ja...@les7arts.com>.
Hi Avijit,

I did not read all the details. Are you looking for "dependent drop-downs"? If yes, you may have a look at
https://demo-trunk.ofbiz.apache.org/example/control/FormWidgetExamples#DropDownFieldsExampleForm_dependendDropDownFields_title

HTH

Jacques

Le 23/05/2022 à 10:31, Avijit Bose a écrit :
> Dear Sir,
> My customer entity is as follows:
> ---------------------------
>      <entity entity-name="AkmCustomer"
> package-name="com.akm.ofbiz.import" title="Customer Entity">
>          <field name="customerId" type="id"><description>primary
> sequenced ID</description></field>
>          <field name="customerTypeId" type="id"></field>
>          <field name="companyName" type="name"></field>
>          <prim-key field="customerId"/>
>      </entity>
> --------------------------
> Then I have a customer address entity as follows:
> ----------------------------
>      <entity entity-name="AkmCustomerAddress"
> package-name="com.akm.ofbiz.import" title="Customer Address Entity">
>          <field name="customerAddressId" type="id"><description>primary
> sequenced ID</description></field>
>          <field name="customerId" type="id">
>          <field name="customerAddress" type="name"></field>
>          <field name="shippingAddress" type="name"></field>
>          <prim-key field="customerAddressId"/>
>      </entity>
> ----------------------------
>
> I have find form as follows. This find is from "AKMCustomer" entity.
> -------------------------------------------
>          <form name="FindCustomers" type="single"
> target="FindCustomers" default-entity-name="AkmCustomer">
>          <field name="noConditionFind"><hidden value="Y"/></field>
>          <!-- if the above "noConditionFind" field name isn't there
> then with all fields empty no query will be done -->
>          <field name="customerId" title="${uiLabelMap.customerId}">
>                         <drop-down allow-empty="true" current-description="">
>                                      <entity-options
> description="${customerId} - ${customerAddress}"
> key-field-name="customerId" entity-name="AkmCustomer">
>                                      <entity-order-by field-name="customerId"/>
>                                      </entity-options>
>                        </drop-down>
>          </field>
>          <field name="customerContactPerson"
> title="${uiLabelMap.customerContactPerson}"><text-find/></field>
>          <field name="searchButton" title="${uiLabelMap.CommonFind}"
> widget-style="smallSubmit">
>          <submit button-type="button"
> image-location="/images/icons/magnifier.png"/>
>          </field>
>          </form>
> -------------------------------------------
> Request question 1: How do I get the '${customerAddress}' value from
> 'AkmCustomerAddress' entity in the above drop down list with
> 'customerId' as the key value?
>
> Then I have list form as follows corresponding to the above find form:
> -------------------------------------------
>
>          <form name="ListCustomers" type="list" list-name="listIt"
> paginate-target="FindCustomers"
>          default-entity-name="AkmCustomer" separate-columns="true"
> odd-row-style="alternate-row"
>          header-row-style="header-row-2"
> default-table-style="basic-table hover-bar">
>          <actions>
>          <!-- Preparing search results for user query by using OFBiz
> stock service to perform find operations
>          on a single entity or view entity -->
>          <service service-name="performFind" result-map="result"
> result-map-list="listIt">
> <field-map field-name="inputFields" from-field="eximCtx"/>
> <field-map field-name="entityName" value="AkmCustomer"/>
> <field-map field-name="orderBy" from-field="parameters.sortField"/>
> <field-map field-name="viewIndex" from-field="viewIndex"/>
> <field-map field-name="viewSize" from-field="viewSize"/>
> </service>
> <field name="customerId" title="${uiLabelMap.customerId}"
> sort-field="false"><display/></field>
> <field name="customerTypeId" title="${uiLabelMap.customerTypeId}"
> sort-field="false"><display/></field>
> <field name="companyName" title="${uiLabelMap.companyName}"
> sort-field="false"><display/></field>
> <field name="customerAddress" title="${uiLabelMap.customerAddress}"
> sort-field="false"><display/></field>
>   </form>
> -------------------------------------------
> Request question 2: Again how do I get the 'customerAddress' field
> value in the list with 'customerId' as the key?
>
> In short how do I get a value from a second entity in a dropdown and
> list form field with a first entity key value as a reference in the
> second table.
>
> regards
> Avijit Bose