OAF knowledge consolidation

1, processFormRequest can not change the properties of webBean

2、row.setNewRowState(Row.STATUS_NEW/STATUS_INITIALIZED);

The difference between the two states:

  a.STATUS_NEW new line will effectively verify and, if required, if not filled in, the new failure,
    but STATUS_INITIALIZED not be verified
  b. Set STATUS_INITIALIZED state after the new, the new row is expressed detached state, does not participate in the transaction commits, does not participate in verification,
Until the page is updated, then OA framework automatically set back to the state STATUS_NEW, in order to re-engage and validate things


Increase of VO statement:

EmployeesVOImpl vo = (EmployeesVOImpl) getEmployeesVO1 ( ); // Get VO
IF has been performed is determined whether // (vo.isPreparedForExecution ()!)
{
  Vo.executeQuery (); // must first be performed VO
}
Row Row = vo.createRow ( ); // create a new line
row.setNewRowState (Row.STATUS_NEW); // create a new row to assign types
vo.insertRow (row); // will join the newly created row in the VO
// now vo ( data cache), the state is persistent state (save after submitted directly to the database)
new column generally do not remove the icon, you need to delete the icon in the VO plus a default value, because only execute a query will be deleted
column assignment or createRow (); after setting value row.setAttribute ( "deleteFlag", true) ;



Of VO delete statement is:

1)、得到row:Row 
row = (XXXVORowImpl)deleteIter.getRowAtRangeIndex(i);
或Row[] rows = vo.getFilteredRows("OutPlanDetId", detailId);//rows[i]
2)删除并其提交
row.remove();
getTransaction().commit();



3, disable the property item is set true

Interface can not be modified, the code value can not be obtained (pageContext.getParameter ( "techTrialDate");), obtaining a value less than only gripping tab


4, drop-down box and hide the control LOV value corresponding to Value

This arrangement is not formed html tags, and therefore can not obtain the value of the input, so to set the CSS in a property or set item style where PG is formvalue

OAMessageTextInputBean sAppPropCodeValue = 
            (OAMessageTextInputBean)webBean.findChildRecursive("SAppPropCodeValue");
sAppPropCodeValue.setRendered(false);


5, naming conventions: cux.oracle.apps.inv001 (this is the abbreviation on demand) ***. 

Preceded by INV, because when run, will go to the database to find the corresponding application module INV

6, the Table Each field must have vo mapping, control has a required set to yes means is required.

7, LOV commonly used in three events: lovPrepare, lovFilter, lovUpdate 

lovPrepare: Click the Query icon (flashlight) trigger event (usually passed here parameter values customer filter condition)
lovFilter: Click the Start button pop-up pages of the triggering event, where it is often added to the client filter criteria.
lovUpdate: After selecting the query results back to the main data page trigger Page


        String Event = pageContext.getParameter ( "Event");
        IF (pageContext.isLovEvent ()) {[//// lovUpdate determines whether to select the data from this LovInput Page after returning to the main page page trigger]
            OAMessageLovInputBean SCategory = 
                (OAMessageLovInputBean) webBean.findChildRecursive ( "SCategory");
            Hashtable lovResults = 
                pageContext.getLovResultsFromSession ( "CategoryLOV");


            OAMessageLovInputBean SForm = 
                (OAMessageLovInputBean) webBean.findChildRecursive ( "SForm");
            ShapeVOImpl formVO = (ShapeVOImpl)am.findViewObject("ShapeVO1");


            if ("类别1".equals(lovResults.get("Description"))) {
                formVO.setWhereClause("FlexValue in ('形态1','形态2')");
                formVO.executeQuery();
            }
        }

8, jdeveloper database connection

Business Components和Oracle Applications

9, am am calling another method

ApplicationModule ss = am.findApplicationModule("SubInvLovAM1");
SubInvOrgLovVOImpl vo = (SubInvOrgLovVOImpl)ss.findViewObject("SubInvOrgLovVO1");



10, functions and organization of inventory view CUX_INV_USE_UNIT_V

. am.getOADBTransaction () getResponsibilityId () - Responsibilities
am.getOADBTransaction () getResponsibilityApplicationId () -. Application developers

11, call the function:

String sqlStr="{? = call cux_common_wyb_pkg.outbillcancelchecksatus(?,?)}";
CallableStatement proc = null;
String v_result = null;
OADBTransaction tr = getOADBTransaction();
proc = tr.createCallableStatement(funcStr, 1);
try {
//注册返回类型
proc.registerOutParameter(1, Types.VARCHAR);
proc.setString(2, idOne);
proc.setString(3, idTwo);
proc.execute(); //执行
v_result = proc.getString(1); //获得结果
proc.close();
} catch (SQLException e) {
throw new OAException("执行存储过程出现错误:" + funcStr, OAException.ERROR);
}

12、调用数据库存储过程用这种方式         

CallableStatement st = null;                               
String x_succ_flag;                      
String x_error_msg;
String stmt = "begin " + strImportPkg + "(p_file_id => :1," +
"p_template_id => :2, " +
"x_succ_flag => :3, " +
"x_error_msg => :4); " + "end;";    
OADBTransaction tr = getOADBTransaction();
st = tr.createCallableStatement(stmt, 1);     

try 
{
 // Bind the input parameters
 //Integer.parseInt
 st.setString(1, fileId);
 st.setString(2, templateCode);
 // Register return variables
 st.registerOutParameter(3, Types.VARCHAR);
 st.registerOutParameter(4, Types.VARCHAR);
 st.execute();
 // Assign returned values to variables
 x_succ_flag = st.getString(3);
 x_error_msg = st.getString(4);
 st.close();
} catch (SQLException e)
{
 //throw OAException.wrapperException(e);
 throw new OAException("执行存储过程出现错误:" + stmt, OAException.ERROR);

13、提示消息

EO方面字段验证抛出异常http://www.cnblogs.com/eastsea/p/4729709.html

OAException(String appShortName,//应用短名

                  String messageName, //消息名称

                    MessageToken[] messageTokens,//消息参数

                     byte messageType, //异常类型

                      Exception[] details)//异常明细

可以省略其中部分参数,例如: OAException(String messageName)

                          OAException(String messageName, byte messageType)

                          OAException(String messageName, MessageToken[],byte messagType)

OAException message =

   new OAException("messageStr", OAException.CONFIRMATION);

pageContext.putDialogMessage(message);

//提示消息(类似抛出异常消息)

String msg =am.getOADBTransaction().getMessage("CUX","CUX_SELECT_ONE_DATA",null);

//msg可以直接是中文

throw new OAException(msg,OAException.WARNING);


消息定义都建在CUX应用产品下面:

throw new OAException("AK","FWK_TBX_CATEGORY_NOT_FOUND");最简单方式



select * from fnd_application whereapplication_short_name ='CUX'

update Fnd_New_Messages set application_id=20003 where message_name like'CUX%';

一个是查application_id查到了以后就update)

 

同时消息提示可以传入参数

MessageToken[] tokens = { new MessageToken("COLNAME","仓库") };       

throw new OAException(shortName, infoName,tokens, OAException.WARNING,null);

1)、CuxMsgUtils.actWarningInfo("OP","发送

","CUX",CuxMsgConstants.CUX_MSG_OPERATE_SUCCEED);

//只有状态为1(登录)、3(待转发仓库)、A(打回采购中心)的数据可以发送                2)、CuxMsgUtils.actWarningInfo("STATUS","登录、待转发仓库、打回采购中心","CUX",CuxMsgConstants.CUX_MSG_ONLY_STATUS_OPERATE);



14、webBean子类:
OAMessageTextInputBean
OAMessageLovInputBean
OAMessageDateFieldBean
OAFormValueBean
OAMessageCheckBoxBean
OAMessageChoiceBean
OAMessageStyledTextBean
OASubmitButtonBean
OAButtonBean
OABodyBean


15、各大网站
http://www.codepub.com/源代码

http://docs.oracle.com/cd/A97337_01/ias102_otn/buslog.102/bc4j/jboerrormessages.html#55003  JBO错误上这个地址一下就知道是什么错误的还有解决办法


Guess you like

Origin www.cnblogs.com/AI-xiaocai/p/11482098.html