I have a table region and there are multiple records fetching from a Entity based VO. Now I have updated one row or any of row, I require to display once changed records on next page. How can I display? I want to capture row status type thing while pressing the save button.
if(row.getEntity(0).getPostState()==2){
//your logic
}
xxPerPhonesVORowImpl updatedRow = (xxPerPhonesVORowImpl)EmpContactsVO.getCurrentRow();
System.out.println("Row Status : " + updatedRow.getxxPerPhonesEO().getEntityState());
if(updatedRow.getxxPerPhonesEO().getEntityState() == EntityImpl.STATUS_NEW ) {
System.out.println("Row Status : Row # " + i + " : Modified value : " + updatedRow.getEntity(0).getEntityState());
}
最佳答案:
ssue resolved by creating a new field (IS_SUBMITTED) in database table to Flag the record status with the default value as N (update all the existing records if there are any in the table);
Step 1 : Go to properties on your EO and navigate to Java and check Data Manipulation
Step 2 : Go to your EOImpl class and search for doDML method
Step 3 : Under doDML method add below code to set EO Attribute value;
if (getIsSubmitted().equals("N")) {
setIsSubmitted("M"); //where as M stands for Modified
}
Step 4 : Under your Controller Class @ PFR, write code for loop and set the attribute status like below;
OAApplicationModule am = pageContext.getApplicationModule(webBean);
if (pageContext.getParameter("SubmitButton") != null ) {
am.invokeMethod("apply"); //saving the records so the EOImpl will set the is_submitted to 'M' wherever the record modified state found
OAViewObject EmpPhoneVO = (OAViewObject)am.findViewObject("xxPerPhonesVO1");
int empPhoneRowCnt = EmpPhoneVO.getRowCount();
EmpPhoneVO.first();
for (int i=1; i<=empPhoneRowCnt; i++){
OARow empPhoneRow = (OARow)EmpPhoneVO.getCurrentRow();
String lPhoneValidated = "Y";
// your validation if any
if (lPhoneValidated.equals("Y")) {
System.out.println("IsSubimtted After Get : " + empPhoneRow.getAttribute("IsSubmitted"));
if (empPhoneRow.getAttribute("IsSubmitted").equals("M")){
empPhoneRow.setAttribute("IsSubmitted","S");
}
System.out.println("IsSubimtted After Set : " + empPhoneRow.getAttribute("IsSubmitted"));
OAException submitMessage = new OAException("Employee Contact Details : Row # " + i + " : Submitted for Approval to Employee Relation Officer.",
OAException.CONFIRMATION );
pageContext.putDialogMessage(submitMessage);
}
EmpPhoneVO.next();
}
}
参考资料:
How to get Row Status of VO Rows
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· go语言实现终端里的倒计时
· 如何编写易于单元测试的代码
· 10年+ .NET Coder 心语,封装的思维:从隐藏、稳定开始理解其本质意义
· .NET Core 中如何实现缓存的预热?
· 从 HTTP 原因短语缺失研究 HTTP/2 和 HTTP/3 的设计差异
· 分享一个免费、快速、无限量使用的满血 DeepSeek R1 模型,支持深度思考和联网搜索!
· 基于 Docker 搭建 FRP 内网穿透开源项目(很简单哒)
· ollama系列1:轻松3步本地部署deepseek,普通电脑可用
· 按钮权限的设计及实现
· Apache Tomcat RCE漏洞复现(CVE-2025-24813)