Category Archives: Oracle E-business Suite

[OA Framework] findIndexedChildRecursive, findChildRecursive ใช้ต่างกันอย่างไร

findIndexedChildRecursive หรือ
public OAWebBean findIndexedChildRecursive(String name)

ใช้สำหรับค้นหา component ด้วย index จาก child/grandchild ด้วยการระบุชื่อ

findChildRecursive หรือ
public OAWebBean findChildRecursive(String name)

ใช้สำหรับค้นหา component ทั้ง Index และ Name จาก child/grandchild ด้วยการระบุชื่อ

ทั้งสอง method จะคืนค่า null หากไม่พบ component ตรงกับชื่อที่ต้องการค้นหา

ปล. หากเราไม่แน่ใจว่าชื่อที่เราต้องการค้นหาเป็น Index หรือ Name ของ component ขอแนะนำให้ใช้ findChildRecursive ในการค้นหาครับ เพราะจะค้นหาทั้ง index และ name

Credit: http://www.betterdevelopers.com/article/45347312/Use+of+findChildRecursive,+findIndexedChildRecursive,+findIndexedChild

How to set Currency Format on TotalRow in OAAdvancedTable

เจอปัญหาในการใส่ Format ให้กับจำนวนเงิน สำหรับ Total Row ใน OAAdvancedTable

OAAdvancedTable
Id: showDetailTb
Id: column1

Total Value: True
Id: TrxAmount
View Attribute: TrxAmount

ถึงเราจะใส่ Format ให้กับ OAMessagedStyledTextBean id TrxAmount

Formatter formatter = new OADecimalValidater("#,###,###,##0.00;(#,###,###,##0.00)", "#,###,###,##0.00;(#,###,###,##0.00)");

OAAdvancedTableBean adTable = (OAAdvancedTableBean) webBean.findChildRecursive("showDetailTb");

OAMessageStyledTextBean trxAmountTotal = (OAMessageStyledTextBean) adTable.findChildRecursive("TrxAmount");
trxAmountTotal.setAttributeValue(ON_SUBMIT_VALIDATER_ATTR, formatter);

แต่จำนวน Total ก็ยังไม่อยู่ในรูป Format

หลังจากลองผิดลองถูก เข้าไป set format ในเกือบทุก objects ที่อยู่ภายใต้ OAAdvancedTable ก็ได้เข้าใจว่าถ้าต้องการให้เลขใน TotalRow อยู่ในรูปแบบที่จัด Format แล้วเราต้องไปตั้งค่าที่ …

Continue reading