Tips for using Oracle ADF (Application Development Framework)
2012-02-23 16:00
417 查看
1. 同样的方法,写到AM的实现类里与写到ManageBean里面在调用的时候效果就不一样,还不知道具体原因。比如下面代码,
当写到AM的实现类里时(通过AMClient Interface暴露给DataControl),调用后,当应用跳转到下一个页面(如显示View1的内容)时,页面的确显示的是View1的currentRow的内容;然而如果上面代码放到ManageBean中,则调用后应用跳转到下一个页面时,页面并没有显示选中的currentRow,而很奇怪的,显示的是View1正常结果集里面的第一条数据。
2.注意在调用如上的方法后,一定要在最后加上下面一句,否则会对后面的vo query产生影响,切记切记!
ViewObject vo = am.findViewObject("View1"); ViewCriteria vc = vo.createViewCriteria(); ViewCriteriaRow vcr = vc.createViewCriteriaRow(); vcr.setAttribute("ID", "123"); vc.add(vcr); vo.applyViewCriteria(vc); vo.executeQuery(); if (vo.getEstimatedRowCount() == 1) { vo.setCurrentRow(vo.first()); }
当写到AM的实现类里时(通过AMClient Interface暴露给DataControl),调用后,当应用跳转到下一个页面(如显示View1的内容)时,页面的确显示的是View1的currentRow的内容;然而如果上面代码放到ManageBean中,则调用后应用跳转到下一个页面时,页面并没有显示选中的currentRow,而很奇怪的,显示的是View1正常结果集里面的第一条数据。
2.注意在调用如上的方法后,一定要在最后加上下面一句,否则会对后面的vo query产生影响,切记切记!
vo.applyViewCriteria(null);Debug经验:关键code一定要一步一步的debug,不要想当然,比如下面这段code, vo.executeQuery()怎么知道返回的就是DafQAVerifyView表中全部的记录?!万一前面有个家伙没有做把ViewCriteria清空怎么办?!
DafQAVerifyViewImpl vo = (DafQAVerifyViewImpl)findViewObject("DafQAVerifyView1"); vo.executeQuery(); vo.findAndSetCurrentRowByKey(qaVerifyRow.getKey(), 0);
相关文章推荐
- Oracle Fusion Applications (11.1.8) Media Pack and Oracle Application Development Framework 11g (11.1.1.7.2) for Microsoft Windows x64 (64-bit)
- Shiny for Interactive Application Development using R(转)
- http://www.asp.net/mvc/overview/getting-started/getting-started-with-ef-using-mvc/creating-an-entity-framework-data-model-for-an-asp-net-mvc-application
- Oracle Application Development Framework Essentials (1Z1-554)
- Ten Tips for Android Application Development
- Using QEMU for Embedded Systems Development, Part 2
- Visual Studio Application Lifecycle Management 2010 脑图学习系列 之一 Scrum framework MSF for Agile v5.0
- Professional Office Business Application Development: Using Microsoft Office SharePoint Server 2007
- CodeIgniter for Rapid PHP Application Development
- Using Caliburn.Micro (version 2) for WPF development
- Ubuntu Hacks : Tips & Tools for Exploring, Using, and Tuning Linux
- Important parameters For Oracle BRM Application in 11gR2
- Oracle WebLogic Server Active GridLink for Oracle Real Application Clusters (RAC) - 1
- A Step-by-Step guide to create a simple FPM application using Feeder Class for FORM GUIBB
- Using Eclipse for Android C/C++ Development
- How to call Oracle function or stored procedure using spring persistence framework?
- Oracle ADF 异常:oracle.jbo.NoDefException: JBO-29114 ADFContext is not setup to process messages for t
- tips for using maven and testng/junit
- ArcIMS9.2 + Web ADF for the Microsoft .NET Framework 安装配置
- Using Single Alert For Messages And Confirmation Messages In Oracle Forms With Set_Alert_Button_Property