แสดงบทความที่มีป้ายกำกับ OA Framework แสดงบทความทั้งหมด
แสดงบทความที่มีป้ายกำกับ OA Framework แสดงบทความทั้งหมด

วันพุธที่ 2 พฤศจิกายน พ.ศ. 2559

[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

วันพุธที่ 7 มกราคม พ.ศ. 2558

OAF: วิธีการใส่ Format ให้กลับจำนวนเงิน

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


OAAdvancedTable
Id: showDetailTb

Id: column1
Total Value: True

Id: TrxAmount
View Attribute: TrxAmount

ถึงเราจะใส่ Format ให้กับ OAMessagedStyledTextBean id TrxAmount
แต่จำนวน Total ก็ยังไม่อยู่ในรูป Format
หลังจากลองผิดลองถูก เข้าไป set format ในเกือบทุก objects ที่อยู่ภายใต้ OAAdvancedTable 
ก็ได้เข้าใจว่าถ้าต้องการให้เลขใน TotalRow อยู่ในรูปแบบที่จัด Format แล้วเราต้องไปตั้งค่าที่...

วันพฤหัสบดีที่ 17 มกราคม พ.ศ. 2556

Populate current date use getCurrentDBDate()

SimpleAMImpl am = (SimpleAMImpl) pageContext.getApplicationModule(webBean);
SimpleDateFormat format = new SimpleDateFormat(“yyyy-MM-dd hh:mm:ss.S”);
SimpleDateFormat formatDate = new SimpleDateFormat(“yyyy-MM-dd hh:mm:ss”);
oracle.jbo.domain.Date convertDate = applicationModule.getOADBTransaction().getCurrentDBDate();
java.util.Date date = format.parse(convertDate.toString());
String convStr = formatDate.format(date);
System.out.println(“Date from database:  ”+convertDate.toString());
System.out.println(“java.util.Date: “+date.toString());
System.out.println(“String date: “+convStr);
ขอแปะ code ไว้ก่อนแล้วจะมาอธิบายนะครับ

วันอังคารที่ 4 กันยายน พ.ศ. 2555

OAF ลิงค์แบบ Popup Window

วิธีการตั้งค่าให้เปิด OAF page ให้เป็นแบบ popup windows 
ให้เราไปตั้งค่าที่ Desination URI property ของวัตถุที่ต้องการให้เป็นลิงค์ 
จากนั้นเพิ่มลิงค์ตามข้างล่างนี้ลงไป
javascript:var a = window.open('OA.jsp?page=/xxx/oracle/apps/seafa/sams/storage/server/xxxPG&reqId={@ReqId}&assetId={@AssetId}', 'a','height=800,width=500,status=yes,toolbar=no,menubar=no,location=no');a.focus();

และให้ตั้งค่าที่ Target Frame property ให้เป็น "_blank"

และถ้าหากต้องการสร้างปุ่มปิด Windows ด้วยก็ใช้คำสั่งในการปิดหน้าต่างต่อไปนี้

javascript:window.close();