1. ใน form ทำการสร้าง drop down list ดังนี้
<select id="ProductTypeInventory" name="ProductTypeInventory" dojoType="dijit.form.ComboBox" autocomplete="false" >
<option value="">${uiLabelMap.CommonSelect}</option>
<#list productTypeList as productTypeListMap>
<option value="${productTypeListMap.productTypeId}">${productTypeListMap.description}</option>
</#list>
</select>2. สร้าง screen ดังนี้
<screen name="ProductSummaryDialog">
<section>
<actions>
<property-map resource="iMAS-ReportUiLabels" map-name="uiLabelMap" global="true"/>
<property-map resource="iMAS-AccountingUiLabels" map-name="uiLabelMap" global="true"/>
<property-map resource="CommonUiLabels" map-name="uiLabelMap" global="true"/>
<property-map resource="iMAS-InventoryUiLabels" map-name="uiLabelMap" global="true"/>
<set field="headerItem" value="ProductSummaryDialog"/>
<entity-condition list="productTypeList" entity-name="ProductType">
</entity-condition>
</actions>
<widgets>
<platform-specific>
<html>
<html-template location="component://imas-report/webapp/imas-report/report/inventory/page/ProductSummaryDialog.ftl"/>
</html>
</platform-specific>
</widgets>
</section>
</screen>
อธิบายโค้ด
กำหนดว่าจะดึงข้อมูลจาก entity ไหน โดยใช้คำสั่ง
<entity-condition list="productTypeList" entity-name="ProductType"></entity-condition>จากตัวอย่าง จะเป็นการเลือกข้อมูลจาก entity ชื่อ ProductType
จะได้ฟอร์มที่สามารถเลือกข้อมูลจาก drop down list ของ ProductType ได้ดังนี้

ไม่มีความคิดเห็น:
แสดงความคิดเห็น