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 <bose.avi...@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
> <jacques.le.r...@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
> >
>

Reply via email to