หากไม่ต้องการนำมาแสดงใน drop down list ให้ใช้คำสั่ง ignore-if-empty ต่อท้ายการ select ข้อมูลออกมา
จะเห็นว่าข้อมูลในส่วนของ group name เป็นค่าว่าง อาจเนื่องมาจากการทดสอบการเพิ่มข้อมูลและการสร้าง services ต่างๆ ในขั้นตอนการพัฒนาที่ไม่ได้ถูกลบออกจากฐานข้อมูล หากต้องการซ่อนค่าดังกล่าว ให้ทำการเพิ่มโค้ดในส่วนของ entity-constrain ดังนี้
<field name="partyIdFrom" title="${uiLabelMap.PartyGroupDepartmentName}" tooltip="${uiLabelMap.CommonRequired}"> <drop-down allow-empty="true" > <entity-options key-field-name="partyId" description="${groupName}" entity-name="PartyRoleDetailAndPartyDetail"> <entity-constraint name="roleTypeId" operator="equals" value="DEPARTMENT"/> <entity-constraint name="groupName" operator="like" value="%" ignore-if-empty="true"/> <entity-order-by field-name="groupName"/> </entity-options> </drop-down> </field>
ในส่วนของการ entity-constrain มีการ filter เอาฟิล์ด groupname ที่มีค่าเป็น empty ออก โดยใช้ property ignore-if-empty
ผลลัพธ์ที่ได้จะเป็นดังนี้
ซึ่งจะไม่แสดงค่าว่างตามเงื่อนไขที่กำหนดไว้
ไม่มีความคิดเห็น:
แสดงความคิดเห็น