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