BC4J Entity object validation and JSP

Hi, I've been trying to implement BC4J best practices as per a previous thread with Steven Muench.
I've placed all my business logic/validation in the entity object create and validateEntity methods. This works perfectly in the tester utility.
In a JSP page the first time around the error raised also gets displayed properly prompting the user to go back and fix his data entry. The problem is that the error keeps reappearing even after the data has been fixed.
We use web beans to perform the save using standard create/setAttribute/InsertRow/commit logic.
The whole setup works perfectly in JSP if there are no errors in the data.
Any pointers or ideas?
Thanks.
null

productNew.jsp
<FORM NAME="saveForm" METHOD=POST ACTION="productSave.jsp">
<table align="center">
<tr>
<td>
<div align="right">Product Code:</div>
</td>
<td>
<input type="text" name="productcode" size="6" maxlength="6">
</td>
</tr>
<tr>
<td>
<div align="right">Product Sname:</div>
</td>
<td>
<input type="text" name="productsname" size="20" maxlength="20">
</td>
</tr>
<tr>
<td height="19">
<div align="right">Product Name:</div>
</td>
<td height="19">
<input type="text" name="productname" size="45" maxlength="45">
</td>
</tr>
<tr>
<td>
<div align="right">Product Type:</div>
</td>
<td>
<jsp:useBean class="com.palmtreebusiness.edms.products.jsp.LovBean" id="lov1" scope="request">
<%
lov1.setLovDefault("None Selected");
lov1.setLovKey(0);
lov1.setLovKeyDescription(1);
lov1.setJSOnChangeMethod("");
lov1.setLovHTMLField("producttypekey");
lov1.initialize(pageContext, "productsjsp_com_palmtreebusiness_edms_products_bc4j_bc4jmodule.ProducttypetbView");
lov1.render();
%>
</jsp:useBean> </td>
</tr>
<tr>
<td>
<div align="right">Product Sub Class:</div>
</td>
<td>
<jsp:useBean class="com.palmtreebusiness.edms.products.jsp.LovBean" id="lov2" scope="request">
<%
lov2.setLovDefault("All Selected");
lov2.setLovKey(0);
lov2.setLovKeyDescription(1);
lov2.setJSOnChangeMethod("");
lov2.setLovHTMLField("productsubclasskey");
lov2.initialize(pageContext, "productsjsp_com_palmtreebusiness_edms_products_bc4j_bc4jmodule.ProductsubclasstbView");
lov2.render();
%>
</jsp:useBean>
</td>
</tr>
<tr>
<td>
<div align="right">STCC DG Code:</div>
</td>
<td>
<input type="text" name="stccdgcodekey" size="10" maxlength="10">
</td>
</tr>
<tr>
<td>
<div align="right">Harmonized Code:</div>
</td>
<td>
<input type="text" name="harmonizedcode" size="20" maxlength="20">
</td>
</tr>
</table>
</form>
productSave.jsp
<%@ page language = "java" errorPage="errorpage.jsp" import = "java.util.*, oracle.jbo.*, javax.naming.*, oracle.jdeveloper.html.*, oracle.jbo.html.databeans.*" contentType="text/html;charset=ISO-8859-1"%>
<%
// make sure the application is registered
oracle.jbo.html.jsp.JSPApplicationRegistry.registerApplicationFromPropertyFile(session , "productsjsp_com_palmtreebusiness_edms_products_bc4j_bc4jmodule");
%>
<HTML>
<HEAD>
<jsp:useBean id="prod" class="com.palmtreebusiness.edms.products.jsp.productSavebean" scope="request">
<%
try {
prod.initialize(pageContext, "productsjsp_com_palmtreebusiness_edms_products_bc4j_bc4jmodule.ProducttbView");
prod.setReleaseApplicationResources(true);
prod.save();
response.sendRedirect("productList.jsp");
response.setStatus(response.SC_MOVED_TEMPORARILY);
catch (Exception ex) {
out.println("<META HTTP-EQUIV=\"Content-Type\" CONTENT=\"text/html; charset=ISO-8859-1\">");
out.println("<META NAME=\"GENERATOR\" CONTENT=\"Oracle JDeveloper\">");
out.println("<TITLE>");
out.println("Save Error");
out.println("</TITLE>");
out.println("</HEAD>");
out.println("<BODY>");
out.println("A save error occured.<br><br>");
out.println(ex.getMessage());
out.println("<br><br>Plese use the back feature of your browser to go back to the form and fix your data.");
out.println("</BODY>");
out.println("</HTML>");
%>
</jsp:useBean>
saveBean.java
public void save() throws oracle.jbo.JboException {
Row rRow;
System.out.println(request.getParameter("producttypekey"));
System.out.println(request.getParameter("productsubclasskey"));
try {
// get the rowset instance
RowSet rSet = getRowSet();
rRow = rSet.createRow();
rRow.setAttribute("Producttypekey", new Number(request.getParameter("producttypekey")));
rRow.setAttribute("Productsubclasskey", new Number(request.getParameter("productsubclasskey")));
rRow.setAttribute("Productcode", request.getParameter("productcode"));
rRow.setAttribute("Productsname", request.getParameter("productsname"));
rRow.setAttribute("Productname", request.getParameter("productname"));
rRow.setAttribute("Stccdgcodekey", new Number(request.getParameter("stccdgcodekey")));
rRow.setAttribute("Harmonizedcode", request.getParameter("harmonizedcode"));
rSet.insertRow(rRow);
rSet.getApplicationModule().getTransaction().commit();
catch (oracle.jbo.JboException jboex) {
qView.reset();
throw new oracle.jbo.JboException(jboex.getMessage());
catch (Exception ex) {
throw new oracle.jbo.JboException(ex.getMessage());
producttbimpl.java
public void create(AttributeList attributeList) {
try {
SequenceImpl s = new SequenceImpl("producttb_seq", getDBTransaction());
Integer next = (Integer)s.getData();
setProductkey(new Number(next.intValue()));
super.create(attributeList);
catch (Exception jboe) {
if (jboe instanceof oracle.jbo.JboException) {
oracle.jbo.JboException ex2 = (oracle.jbo.JboException)jboe;
if (ex2.getErrorCode().equals("25030")) {
return;
throw new oracle.jbo.JboException("Unable to create this record!\n" + jboe.getMessage());
public void validateEntity() throws oracle.jbo.JboException {
//TODO: Add custom implementation.
Number nSubclasskey, nTypekey;
Number nSubclassFkey, nTypeFkey;
try {
nSubclassFkey = getProductsubclasstb().getProductclasskey();
nTypeFkey = getProducttypetb().getProducttypekey();
nSubclasskey = getProductsubclasskey();
nTypekey = getProducttypekey();
if (!nSubclassFkey.equals(nSubclasskey) &#0124; &#0124; !nTypeFkey.equals(nTypekey)) {
throw new oracle.jbo.JboException("You need to specify a product sub class and type first!");
catch (Exception ex) {
throw new oracle.jbo.JboException("You need to specify a product sub class and type first!");
super.validateEntity();
null

Similar Messages

  • Entity Object validation for "Date" type

    I am trying to use the Entity Object validation for a Date field type, it is a required field.
    I am using the format: MM/dd/yy HH:mm:ss
    It is a simple validation where the date value must be less than or equal to the current date/time.
    I tried using "Query Result" validation where the date is LESS THAN the query SELECT SYSDATE FROM dual.
    This throws an error:
    JBO-27011: Attribute set with value 2006-07-09 14:05:53.0 for LksrSurveyDte in LCFSReportService.LeakDetailView1 failed.
    I have be unable to find help on validating dates using validation for an Entity Object and need some help.
    Thanks in advance.

    In your case you can implement a service method in the VO to check if any other reservation overlaps with the new one (which is not inserted in the db).
    I would use a an other VO (e.g. VODateCheck) for this. This VO has it's query build to check if a given roomid and a given startdate(time?) overlaps any other record for the roomid
    select * from ReservationRoom where RoomId=:bindRoomId and ReservationEnd>=:bindReservationStartIf this query returns one or more rows you have an overlapping in the schedule and throw an error.
    You call this VODateCheck from your service method in the other module before inserting the record. Set the bind variables in the VODateCheck and execute the query.
    Timo

  • Entity level validation and view level validation in programmatic approach

    I want to know entity level validation and view level validation in programmatic approach how to i start and how to fetch the data pls tell me
    am new to df

    Hi,
    did you read the documentation ? http://download.oracle.com/docs/cd/E17904_01/web.1111/b31974/toc.htm
    Frank

  • How to avoid Entity Object validations when comiting a DB transaction

    Hello,
    I have a screen that have three sections:
    1. Header
    2. First tab that contains rows, lets call it User Details  - only the ability to add records and update existing
    3. Second tab that contains rows, lets call it Roles  - ability to create, modify and delete
    -- I have a Save and Cancel button
    I have an Entity Object that covers the whole page UserDetailsEO and it has its validation methods on the implementation UserDetailsEOImpl.java.
    On the second tab when deleting the record, the delete binding method its called and it has a row to commit the transaction. By doing so the validations for the EO are called.
    However I want to avoid performing validation at this point. I can delete rows without any validation, I just want to do the validation when clicking Save.
    Is there any way to accomplish this?
    Thank you,

    Hello Timo,
    Thanks for your answer, the delete action comes from an applicationTable, here is my code:
    The deleteImmediate is set to true.
    <fnd:applicationsTable tableId="t2" id="AT1"
                                             deleteEnabled="true"
                                             createPatternType="inline"
                                             createImmediate="true"
                                             createText="#{applcoreBundle.ADD_ROW}"
                                             deleteActionListener="#{ParticipantDetailPageBean.invokeConfirmationDelete}"
                                             deleteImmediate="true"
                                             styleClass="AFStretchWidth"
                                             deleteMsg="#{applcoreBundle.DELETE_CONFIRM}"
                                             deletePartialTriggers="_ATp:t2"
                                             duplicateEnabled="false">
    The popup does not have buttons itself. Here is the code
    <af:popup id="confirmDeletePopup"
                                      binding="#{ParticipantDetailPageBean.deleteYesNoPopup}"
                                      childCreation="deferred">
                              <af:dialog id="d1" type="okCancel"
                                         dialogListener="#{ParticipantDetailPageBean.handleConfirmDeleteDialog}"
                                         title="#{IcCnSrpTopGenBundle['Header.RoleAssignmentDeleteWarning']}">
                                <af:panelGroupLayout id="pgl4">
                                  <af:panelFormLayout id="pfl2">
                                    <f:facet name="footer"/>
                                    <af:activeOutputText value="#{applcoreBundle.DELETE_CONFIRM}"
                                                         id="aot1"/>
                                  </af:panelFormLayout>
                                </af:panelGroupLayout>
                              </af:dialog>
                            </af:popup>

  • Parent/Child BC4J Entity Object Sequence # Generation

    If anyone can help us in this we greatly appreciate it. We are using DBSequence data type to poplulate the parent entity with the sequence #; however, we need to populate the child entity with the same sequence #.
    We have a DB Trigger for every insert of the parent's key and it's working great but what do we need to do for populating the child record.
    Is there a way to get the sequence # as a part of the this code for the child entity object.
    protected void create(AttributeList attributeList)
    super.create(attributeList);
    SequenceImpl mySeq = new SequenceImpl("MY_SEQ",getDBTransaction());
    setMyObjectId(mySeq.getSequenceNumber());
    Thank you,
    Kamran

    Well,
    I still can't insert the parent's primary key as a forign key automatically. Like in the Dept/Emp situation, I need to setup the supporting Impl files so it would insert the Dept No automatically as a part of the Employee creation.
    New info : Here is a sample of what I am trying to accomplish. Sorry I could
    have been more clear:
    I am sending you my Workspace using Scott's table Dept and Emp. In my JSP file,
    The user needs to input the Department information and some of the Employee
    info, but the same deptno generated for the Dept record needs to be populated
    for the Employee at the time of submit.
    Please let me know if you need anything else.
    Thank you,
    Kamran
    Creat_Emp.jsp
    <%@ taglib uri="/webapp/DataTags.tld" prefix="jbo" %>
    <%@ page contentType="text/html;charset=windows-1252"%>
    <HTML>
    <HEAD>
    <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=windows-1252">
    <TITLE>
    Hello World
    </TITLE>
    </HEAD>
    <BODY>
    <jbo:ApplicationModule id="Mypackage2Module"
    configname="mypackage2.Mypackage2Module.Mypackage2ModuleLocal"
    releasemode="Stateful" />
    <jbo:DataSource id="Dept" appid="Mypackage2Module" viewobject="DeptView" />
    <jbo:DataSource id="Emp" appid="Mypackage2Module" viewobject="EmpView" />
    <jbo:Row id="myrow" datasource="Dept" action="Create" >
    <jbo:SetAttribute dataitem="*" />
    </jbo:Row>
    <jbo:Row id="myrow5" datasource="Emp" action="Create" >
    <jbo:SetAttribute dataitem="*" />
    </jbo:Row>
    <form NAME="sForm" action="Submit.jsp" >
    <td><h3> DAAO <br> New Dept Entry Screen</h3></td>
    <tr>
    <TABLE bgColor="#c0c0c0" cellspacing="0" cellpadding="0" border="0" frame="box"
    style="WIDTH: 530px; HEIGHT: 34px" >
    <TR>
    <TD><font color=darkyellow >Dept No:<br><jbo:InputText datasource="Dept"
    dataitem="Deptno" ></jbo:InputText></TD>
    <TD><font color=darkyellow >Dept Name:<br><jbo:InputText datasource="Dept"
    dataitem="Dname" ></jbo:InputText></TD>
    <TD><font color=darkyellow >Dept Location:<br><jbo:InputText datasource="Dept"
    dataitem="Loc" ></jbo:InputText></TD>
    </TABLE>
    <TABLE bgColor="#c0c0c0" cellspacing="0" cellpadding="0" border="0" frame="box"
    style="WIDTH: 530px; HEIGHT: 34px" >
    <TR>
    <TD><font color=darkyellow >Emp Dept No:<br><jbo:InputText datasource="Emp"
    dataitem="Deptno" ></jbo:InputText></TD>
    <TD><font color=darkyellow >Emp Id<jbo:InputText datasource="Emp"
    dataitem="Empno" ></jbo:InputText>
    <TD><font color=darkyellow >Emp Name:<br><jbo:InputText datasource="Emp"
    dataitem="Ename" ></jbo:InputText></TD>
    <TD><font color=darkyellow >Emp Job:<br><jbo:InputText datasource="Emp"
    dataitem="Job" ></jbo:InputText></TD>
    </TR>
    </TABLE>
    <TABLE bgColor="#c0c0c0" cellspacing="0" cellpadding="0" border="0" frame="box"
    style="WIDTH: 530px; HEIGHT: 34px" >
    <TR>
    <TD><font color=darkyellow >Emp Mgr:<br><jbo:InputText datasource="Emp"
    dataitem="Mgr" ></jbo:InputText></TD>
    </TABLE>
    <input name="RowKeyValue" type="hidden" value="<jbo:ShowValue
    datasource="Emp" dataitem="RowKey"/>" />
    <input type="submit" value="Save" /> <input type="reset" value="Clear
    Screen"/> <input type="BUTTON" value="Q&A" onClick="Create_new_qa.jsp">
    </form>
    <form NAME="qForm" action="Create_New_Qa2.jsp" ></TD>
    <input type="submit" value="Q&A" />
    </form>
    </body>
    <jbo:ReleasePageResources releasemode="Stateless" />
    </html>
    Here is the submit.jsp
    <%@ page language="java" contentType="text/html;charset=WINDOWS-1252" %>
    <html xmlns:jbo="foo">
    <body>
    <center>
    <br>
    <%@ taglib uri="/webapp/DataTags.tld" prefix="jbo" %>
    <br>
    <jbo:ApplicationModule id="Mypackage2Module" configname="mypackage2.Mypackage2Module.Mypackage2ModuleLocal" releasemode="Stateful" />
    <jbo:DataSource id="Dept" appid="Mypackage2Module" viewobject="DeptView" />
    <jbo:DataSource id="Emp" appid="Mypackage2Module" viewobject="EmpView" />
    <jbo:Row id="myrow" datasource="Dept" action="create" >
    <jbo:SetAttribute dataitem="*" />
    </jbo:Row>
    <jbo:Row id="myrow5" datasource="Emp" action="Create" >
    <jbo:SetAttribute dataitem="*" />
    </jbo:Row>
    <%
    try
    %>
    <jbo:PostChanges appid="Mypackage2Module" />
    <jbo:Commit appid="Mypackage2Module"/>
    <p><font face="Arial, Helvetica, sans-serif"><b><font color="006699">DAAO Case Saved Successfully! </b></font></font> </p>
    <%
    catch(Exception exc)
    %>
    <title>this page will be displayed</title>
    <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
    </head>
    <body bgcolor="#FFFFFF">
    <h1> Attenion the following error has occured:</h1><br>
    <%
    String error_msg = exc.getMessage();
    if(exc instanceof oracle.jbo.JboException)
    oracle.jbo.JboException jboex = (oracle.jbo.JboException)exc;
    String sMsg = jboex.getDetailMessage();
    out.println("<center>JBO Error:" + sMsg + "</center>");
    // grab exception object. type cast to jbo object then get details
    // parse details for specific error
    Object[] details = jboex.getDetails();
    if ( sMsg.startsWith("JBO-26041") )
    if (
    (details !=null)
    && (details.length >0 )
    && (details[0] instanceof java.sql.SQLException )
    java.sql.SQLException sourceException = (java.sql.SQLException)(details[0]);
    int sqlErrorCode = sourceException.getErrorCode();
    if (sqlErrorCode == 1400)
    out.println("<br><br><b><font color=\"006699\">One or more of the following required fields (Labeled in Red) have not been entered: </b></font></center><b>");
    else
    out.println("<br><br><b><font color=\"006699\"> Already exist on our system!! </b></font></center><b>");
    if ( sMsg.startsWith("JBO-26041") )
    else // unknown JBO exception
    } //JBO exception instance
    %>
    <jbo:ReleasePageResources releasemode="Stateless"/>
    <%
    return;
    %>
    <br>
    <br>
    <form action="main.html" method= onclick><input type="submit" value="Back to Main"></form>
    </center>
    </body>
    <jbo:ReleasePageResources releasemode="Stateless"/>
    </html>

  • Error Extending the OAEntityImpl class when creating a BC4J  Entity Object

    I have created an EO based on an Oracle Apps table and extended the OAEntityDefImpl, OAEntityCache and OAEntityImpl classes as specified in the OA Framework Developers Guide when creating EO's via the BC4J wizard.
    When I build my Business Components package I recive an error stating that the Impl class should be declared abstract.
    Error(14,8): class oracle.apps.xxtpc.arinvoices.schema.TpcApInvoicesEO2Impl should be declared abstract; it does not define method setLastUpdateLogin(oracle.jbo.domain.Number) in class oracle.apps.fnd.framework.server.OAEntityImpl
    When I modify this class to declare it abstract and then try to test (via the AM test function) the VO that I created based on this EO - I receive an oracle.jbo.RowCreateException: JBO-25017.
    Do you think that this has anything to do with modifying the Impl class to make it abstract? I can create another VO against the same table by creating a SQL statement against it and not basing it off of the EO and this VO will run correctly via the AM tester.
    Thanks,
    Chris
    oracle.jbo.RowCreateException: JBO-25017: Error while creating a new entity row for TpcApInvoicesEO.
         at oracle.jbo.server.EntityDefImpl.createBlankInstance(EntityDefImpl.java:1054)
         at oracle.jbo.server.ViewRowImpl.createMissingEntities(ViewRowImpl.java:1532)
         at oracle.jbo.server.ViewRowImpl.init(ViewRowImpl.java:236)
         at oracle.jbo.server.ViewDefImpl.createBlankInstance(ViewDefImpl.java:1050)
         at oracle.jbo.server.ViewDefImpl.createInstanceFromResultSet(ViewDefImpl.java:1007)
         at oracle.jbo.server.ViewObjectImpl.createRowFromResultSet(ViewObjectImpl.java:2643)

    The problem was that there were no audit columns in the table that I was querying.

  • Entity Object Validation

    hi all,
    why and how can i use the compare validator-->View Accessor Attribute , in compare dropdown list
    thanks

    Section 7 of the JDev 11g guide gives lots of good information on EO validators.
    CM.

  • Hide columns in JClient in function to BC4J Entity

    Hi:
    I need to hide some columns dynamically in my JClient Panel in base to conditional BC4J Entity object bussiness rule.
    For example if i put my pseudocode in Oracle Forms based (i don't remeber the syntaxis well): "if my Deparment.idDepartment = 1000 then....Hide the Employee.Salary".
    Now, in JDeveloper, in my 'DepartmentImpl.java' put the condition, but i know, i can't write code to hide the column in runtime mode here. I need to do that in JClient.
    How can i do this, passing a parameter between BC4J and JClient?
    Regards
    Marco H.

    Shailesh:
    The code not works well for me. I try to explain my requieriment:
    I have a field named "Capturahoras". If "Capturahoras" is equal to "S" then, enabled mHorastrabajados, otherwise, disabled mHorastrabajados.
    My "Idconepto" is my PK and when i selected another value for my PK, my field "Capturahoras" should be changed to "S" or "N" (Yes or Not).
    Sorry, but i'm not an expert for JDev and some months ago i have been programming in Oracle Forms.
    I put my code here but not works well:
    * the JbInit method
    public void jbInit() throws Exception
    // Layout definition for this panel
    dataPanel.setLayout(panelLayout);
    dataPanel.setMinimumSize(new Dimension(100, 100));
    this.setLayout(borderLayout);
    // Code support form attribute: Concepto
    mIdconcepto.setDocument(JUTextFieldBinding.createAttributeBinding(panelBinding, mIdconcepto, "RhMovsincidendetalleView", null, "RhMovsincidendetalleViewIter", "Idconcepto"));
    mIdconcepto.setColumns(3);
    mIdconcepto.addActionListener(new ActionListener()
    public void actionPerformed(ActionEvent e)
    mIdconcepto_actionPerformed(e);
    ComboConcepto.setModel(JUComboBoxBinding.createLovBinding(panelBinding, ComboConcepto, "RhMovsincidendetalleView", null, "RhMovsincidendetalleViewIter", new String[] {"Idconcepto"}, "RhConceptoView", new String[] {"Idconcepto"}, new String[] {"Nomcorto"}, null, null));
    dataPanel.add(labelIdconcepto, new GridBagConstraints(0, 0, 1, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(0, 0, 0, 5), 1, 1));
    dataPanel.add(mIdconcepto, new GridBagConstraints(1, 0, 1, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(0, 0, 0, 5), 1, 1));
    labelIdconcepto.setLabelFor(mIdconcepto);
    mIdconcepto.setColumns(3);
    mIdconcepto.setToolTipText(panelBinding.getTooltip("RhMovsincidendetalleView", "Idconcepto", null));
    labelIdconcepto.setText(panelBinding.getLabel("RhMovsincidendetalleView", "Idconcepto", null));
    // Code support form attribute: Secuencia
    mIdsecuencia.setDocument(JUTextFieldBinding.createAttributeBinding(panelBinding, mIdsecuencia, "RhMovsincidendetalleView", null, "RhMovsincidendetalleViewIter", "Idsecuencia"));
    dataPanel.add(labelIdsecuencia, new GridBagConstraints(0, 1, 1, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(0, 0, 0, 5), 1, 1));
    dataPanel.add(mIdsecuencia, new GridBagConstraints(1, 1, 1, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(0, 0, 0, 5), 1, 1));
    labelIdsecuencia.setLabelFor(mIdsecuencia);
    mIdsecuencia.setColumns(4);
    mIdsecuencia.setToolTipText(panelBinding.getTooltip("RhMovsincidendetalleView", "Idsecuencia", null));
    labelIdsecuencia.setText(panelBinding.getLabel("RhMovsincidendetalleView", "Idsecuencia", null));
    // Code support form attribute: Dias trabajados
    mDiastrabajados.setDocument(JUTextFieldBinding.createAttributeBinding(panelBinding, mDiastrabajados, "RhMovsincidendetalleView", null, "RhMovsincidendetalleViewIter", "Diastrabajados"));
    dataPanel.add(labelDiastrabajados, new GridBagConstraints(0, 2, 1, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(0, 0, 0, 5), 1, 1));
    dataPanel.add(mDiastrabajados, new GridBagConstraints(1, 2, 1, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(0, 0, 0, 5), 1, 1));
    labelDiastrabajados.setLabelFor(mDiastrabajados);
    mDiastrabajados.setColumns(7);
    mDiastrabajados.setToolTipText(panelBinding.getTooltip("RhMovsincidendetalleView", "Diastrabajados", null));
    labelDiastrabajados.setText(panelBinding.getLabel("RhMovsincidendetalleView", "Diastrabajados", null));
    // Code support form attribute: Horas trabajadas
    mHorastrabajados.setDocument(JUTextFieldBinding.createAttributeBinding(panelBinding, mHorastrabajados, "RhMovsincidendetalleView", null, "RhMovsincidendetalleViewIter", "Horastrabajados"));
    dataPanel.add(labelHorastrabajados, new GridBagConstraints(0, 3, 1, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(0, 0, 0, 5), 1, 1));
    dataPanel.add(mHorastrabajados, new GridBagConstraints(1, 3, 1, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(0, 0, 0, 5), 1, 1));
    labelHorastrabajados.setLabelFor(mHorastrabajados);
    mHorastrabajados.setColumns(5);
    mHorastrabajados.setToolTipText(panelBinding.getTooltip("RhMovsincidendetalleView", "Horastrabajados", null));
    labelHorastrabajados.setText(panelBinding.getLabel("RhMovsincidendetalleView", "Horastrabajados", null));
    // Code support form attribute: Importe
    mImporte.setDocument(JUTextFieldBinding.createAttributeBinding(panelBinding, mImporte, "RhMovsincidendetalleView", null, "RhMovsincidendetalleViewIter", "Importe"));
    dataPanel.add(labelImporte, new GridBagConstraints(0, 4, 1, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(0, 0, 0, 5), 1, 1));
    dataPanel.add(mImporte, new GridBagConstraints(1, 4, 1, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(0, 0, 0, 5), 1, 1));
    labelImporte.setLabelFor(mImporte);
    mImporte.setColumns(11);
    mImporte.setToolTipText(panelBinding.getTooltip("RhMovsincidendetalleView", "Importe", null));
    labelImporte.setText(panelBinding.getLabel("RhMovsincidendetalleView", "Importe", null));
    // Code support form attribute: Turno
    mTurno.setDocument(JUTextFieldBinding.createAttributeBinding(panelBinding, mTurno, "RhMovsincidendetalleView", null, "RhMovsincidendetalleViewIter", "Turno"));
    dataPanel.add(labelTurno, new GridBagConstraints(0, 5, 1, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(0, 0, 0, 5), 1, 1));
    dataPanel.add(mTurno, new GridBagConstraints(1, 5, 1, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(0, 0, 0, 5), 1, 1));
    labelTurno.setLabelFor(mTurno);
    mTurno.setColumns(2);
    mTurno.setToolTipText(panelBinding.getTooltip("RhMovsincidendetalleView", "Turno", null));
    labelTurno.setText(panelBinding.getLabel("RhMovsincidendetalleView", "Turno", null));
    // Code support form attribute: Centro de costos
    mCentrocostos.setDocument(JUTextFieldBinding.createAttributeBinding(panelBinding, mCentrocostos, "RhMovsincidendetalleView", null, "RhMovsincidendetalleViewIter", "Centrocostos"));
    dataPanel.add(labelCentrocostos, new GridBagConstraints(0, 6, 1, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(0, 0, 0, 5), 1, 1));
    dataPanel.add(mCentrocostos, new GridBagConstraints(1, 6, 1, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(0, 0, 0, 5), 1, 1));
    dataPanel.add(ComboConcepto, new GridBagConstraints(2, 0, 1, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(0, 0, 0, 5), 1, 1));
    labelCentrocostos.setLabelFor(mCentrocostos);
    mCentrocostos.setColumns(20);
    mCentrocostos.setToolTipText(panelBinding.getTooltip("RhMovsincidendetalleView", "Centrocostos", null));
    // Add for Marco
    panelBinding.findIterBinding("RhMovsincidendetalleViewIter").getRowSetIterator().addListener(new oracle.jbo.RowSetListener()
    * Invoked when the range changes.
    * @param event a description of the new ranges.
    public void rangeRefreshed(oracle.jbo.RangeRefreshEvent event){}
    * Invoked when the range is scrolled.
    * @param event a description of the new range.
    public void rangeScrolled(oracle.jbo.ScrollEvent event){}
    * Invoked when a row has been inserted.
    * @param event a description of the new Row object.
    public void rowInserted(oracle.jbo.InsertEvent event){}
    * Invoked when a row has been deleted.
    * @param event a description of the deleted Row object.
    public void rowDeleted(oracle.jbo.DeleteEvent event){}
    * Invoked when an attribute of the row has been changed.
    * @param event a description of the modified Row object.
    public void rowUpdated(oracle.jbo.UpdateEvent event){}
    * Invoked when the current-row designation changes.
    * @param event a description of the new and previous current rows.
    public void navigated(oracle.jbo.NavigationEvent event)
    String str = null;
    oracle.jbo.Row r = event.getRow();
    if (r != null)
    str = (String) r.getAttribute("Capturahoras");
    if (str != null && str == "S")
    mHorastrabajados.setEnabled(true);
    labelHorastrabajados.setEnabled(true);
    else
    mHorastrabajados.setEnabled(false);
    labelHorastrabajados.setEnabled(false);
    Thanks
    Marco

  • Questions on ADF View Objects, Links and Iterators

    I have a number of questions regarding using ViewObjects in applications where there are alot of relationships between tables.
    First, lets say that I have ViewObject SomeView that was added to the App Module (AM) as VO1. And because it has a number of "detail" records that have to be iterated through in a "report like" view it has those other VO's added under it as "children" in the AM.
    So I have
    VO1 (an instance of SomeView)
    --> VO2 (an instance of some other view)
    --> VO3 (an instance of some other view)
    that is used on pages where only a single VO1 is shown at a time.
    Now because I had another page I wanted to make that had a listing of all SomeView objects. Some of the fields in SomeView are foreign keys to records in VO2 and VO3 and while I don't want to show all the fields from VO2 and VO3, I do want to show a name field from each rather than just the foreign key.
    My experience (though I've never read this anywhere) tells me that when doing a "table" that is a list of rows from a VO, you can't display info from the child VO's because the child VO's are on whatever record corresponds to the "currentRow" in the parent VO and just displaying the rows in a rangeSet doesn't make each the "currentRow" so even we display 10 records in a for loop, the "currentRow" is just one, and the child VO's iterators aren't moved as we go through the for loop. (Can someone confirm if I am correct on this conclusion????)
    So the only way I know of to show some field from a related table in each row is to make the VO have the entity objects from the related tables be part of the view as references. Is this the only way?
    If I do that on a view that didn't have other views as children defined in the AM I don't have any problem and it works like I want.
    But if I do it on a view that did have other views as children defined in the AM it makes the page(s) using that view with the children iterators behave badly. Half the information quits showing up, etc.
    For example, ... if I go to the "SomeView" which was defined with only one entity object association, and I add the entity objects (that are the basis of instances of VO2 and VO3 ) as referenceable only, it totally breaks the page where I display a single VO1 and use it's VO2 and VO3 children. IS THIS NORMAL OR AM I MISSING SOMETHING?
    So, is the solution that I have to have more view objects defined for different purposes ?
    Can anyone give any general guidelines for when/where to use different view objects vs. when to use different iterators. I'm not having much luck with using secondary RSI's and haven't found much info on them.
    Also, how about issues of naming iterators that are in various binding containers (ie. UI Model for a page). If I do and LOV it creates an iterator and gives it a default name like ViewNameIterator1. If I already have a different page that uses a regular (non LOV) iterator with that name, and the user goes back and forth between those pages, is that a clash?
    Finally, I've read a couple of Steve Muench's blogs on View Link consistency but I'm not sure what the rules are on when it applies and doesn't. How you turn it on or off, etc. One of his examples in http://radio.weblogs.com/0118231/2004/02/27.html talks about it in the context of two view objects that are NOT typically "linked" in a master/detail kind of way. Like an AllDepartments and a DepartmentsLessThan view. Do you have to create a View Link between them to have results of one be reflected in the other if they aren't used in the same page in a web app? Or does it happen automatically (with the caveat that you have to do the rowQualifies method). Just feels like I'm missing some pieces.
    Thanks in advance,
    Lynn

    Hi,
    I am also interested in a best-practice note from oracle.
    Currently we store history in seperate history tables for columns that changed. All this implemented in our BaseEoImpl overriding the EntityImpl.prepareForDML().
    Thanks

  • HELP URGENT - Entity Object Substitution not working as advertised!!!!!

    Hi All,
    I have done an entity Object substitution and in order to rule out any coding errors on my part I have generated a fresh EO with no code changes in it and uploaded the files to java top and updated the MDS with the substitution.
    The substitution is successful but I get the following error related to my substituted file:
    oracle.apps.fnd.framework.OAException: oracle.jbo.AttrValException: JBO-27019: Get method for attribute "ItemNumber" in XxEgoMtlSystemItemsVLEOEx could not be resolved. at oracle.apps.fnd.framework.OAException.wrapperException(OAException.java:912) at oracle.apps.fnd.framework.webui.OAPageErrorHandler.prepareException(OAPageErrorHandler.java:1169) at oracle.apps.fnd.framework.webui.OAPageBean.renderDocument(OAPageBean.java:3241) at oracle.apps.fnd.framework.webui.OAPageBean.renderDocument(OAPageBean.java:3036)
    ## Detail 0 ## java.lang.ClassCastException: oracle.jbo.server.EntityDefImpl incompatible with oracle.apps.fnd.framework.server.OAEntityDefImpl at oracle.apps.ego.item.eu.server.EgoMtlSystemItemsVLEOImpl.getDefinitionObject(EgoMtlSystemItemsVLEOImpl.java:562) at oracle.apps.ego.item.eu.server.EgoMtlSystemItemsVLEOImpl.getItemNumber(EgoMtlSystemItemsVLEOImpl.java:11324) at oracle.apps.ego.item.eu.server.EgoMtlSystemItemsVLEOImpl.getAttrInvokeAccessor(EgoMtlSystemItemsVLEOImpl.java:6888)
    I think the real error is Detail 0 line but I haven't seen this before. Could this be the wrong version of JDeveloper that I have used????? About this page showed 12.1.2 and I have downloaded the JDev for 12.1.2???????
    Please help I need to sort this ASAP.
    Thanks all

    I have covered everything in the above threads and followed the EO substitution scenario exactly as per area51.
    I am now getting a different error on the EO substitution, when the page loads that creates a row in the EO the following error is displayed:
    Error
    1. Attribute set for InventoryItemId in view object EgoMtlSystemItemsVO failed
    2. Attribute set for InventoryItemId in view object EgoMtlSystemItemsVO failed
    3. Attribute set for InventoryItemId in view object EgoMtlSystemItemsVO failed
    4. Attribute set for InventoryItemId in view object EgoMtlSystemItemsVO failed
    This is a caught error and thrown to the top of the page as opposed to a complete stack error which is what I was getting before? At first I thought this was due to the VO substitution I had done earlier as a test but I have deleted the substitution document for the VO sub and if I remove my EO substitution the page works fine so my EO substitution is causing the problem.
    EO substitution was as follows:
    <Substitutes>
    <Substitute OldName ="oracle.apps.ego.item.eu.server.EgoMtlSystemItemsVLEO" NewName ="xxsdg.oracle.apps.ego.item.eu.server.XxEgoMtlSystemItemsVLEOEx" />
    </Substitutes>
    Beginning of EO Code is as follows:
    package xxsdg.oracle.apps.ego.item.eu.server;
    import oracle.apps.ego.item.eu.server.EgoMtlSystemItemsVLEOImpl;
    import oracle.apps.fnd.framework.server.OAEntityDefImpl;
    import oracle.jbo.AttributeList;
    import oracle.jbo.domain.Date;
    import oracle.jbo.domain.Number;
    import oracle.jbo.domain.RowID;
    import oracle.jbo.server.AttributeDefImpl;
    import oracle.jbo.server.EntityDefImpl;
    // --- File generated by Oracle ADF Business Components Design Time.
    // --- Custom code may be added to this class.
    // --- Warning: Do not modify method signatures of generated methods.
    public class XxEgoMtlSystemItemsVLEOExImpl extends EgoMtlSystemItemsVLEOImpl {
    public static final int MAXATTRCONST = EntityDefImpl.getMaxAttrConst("oracle.apps.ego.item.eu.server.EgoMtlSystemItemsVLEO");
    public static final int GLOBALATTRIBUTE11 = MAXATTRCONST;
    public static final int GLOBALATTRIBUTE12 = MAXATTRCONST + 1;
    public static final int GLOBALATTRIBUTE13 = MAXATTRCONST + 2;
    public static final int GLOBALATTRIBUTE14 = MAXATTRCONST + 3;
    public static final int GLOBALATTRIBUTE15 = MAXATTRCONST + 4;
    public static final int GLOBALATTRIBUTE16 = MAXATTRCONST + 5;
    public static final int GLOBALATTRIBUTE17 = MAXATTRCONST + 6;
    public static final int GLOBALATTRIBUTE18 = MAXATTRCONST + 7;
    public static final int GLOBALATTRIBUTE19 = MAXATTRCONST + 8;
    public static final int GLOBALATTRIBUTE20 = MAXATTRCONST + 9;
    public static final int ROWID = MAXATTRCONST + 10;
    private static OAEntityDefImpl mDefinitionObject;
    /**This is the default constructor (do not remove)
    public XxEgoMtlSystemItemsVLEOExImpl() {
    /**Retrieves the definition object for this instance class.
    public static synchronized EntityDefImpl getDefinitionObject() {
    if (mDefinitionObject == null) {
    mDefinitionObject =
    (OAEntityDefImpl)EntityDefImpl.findDefObject("xxsdg.oracle.apps.ego.item.eu.server.XxEgoMtlSystemItemsVLEOEx");
    return mDefinitionObject;
    /**Add attribute defaulting logic in this method.
    public void create(AttributeList attributeList) {
    super.create(attributeList);
    ....

  • Entity Object ACCESSOR

    I use a view object VO1 which relies on 2 entity objects EO1 and EO2. Neither has been set to readonly in VO1.
    I set in EO2, a set metod (for one attributes) which use an accessor to EO1 (by its Association).
    When I insert an EO2 object on an existing EO1 object, everything is OK.
    When I insert by a single command both EO1 and EO2, the accessor can't reach the corresponding EO1.
    Any Idea?
    Thanks

    Hi,
    Detail Rule, copy attribute value form master.
    In DetailEOImpl:
    protected void create(AttributeList attributeList)
    setAttribute(MASTERFIELD,this.getMaster().getMasterField());
    super.create(attributeList);
    Master rule, set flag to 0 if no details else set to 1.
    In the MasterEOImpl added method to check if detail row exists based on Row Iterator => no db retrieval?
    This method also sets the flag accordingly:
    protected void checkHasOtherDetails()
    oracle.jbo.RowIterator ri = this.getRetrieveFromdetail();
    ri.last();
    // last() must be called else hasNext() returns true even on last delete ???
    Number hasDetails = Constants.NUMBER_NO; // = 1
    if (ri.hasNext() || ri.hasPrevious())
    hasDetails = Constants.NUMBER_YES; // = 0
    if (!getHasDetailsFlag().equals(hasDetails)) {
    this.setHasDetailsFlag(hasDetails);
    I call this method in the remove method of the detailEOImpl:
    public void remove()
    this.getRetrieeFromMaster().checkHasOtherDetails();
    super.remove();
    To set the flag I added follwoing code in the create method of the DetailEOImpl:
    protected void create(AttributeList attributeList)
    setAttribute(MASTERFIELD,this.getMaster().getMasterField());
    **** ADDED ***
    Number masterHasDetailsFlag = getRetrieveFromMaster().getHasDetailsFlag();
    if (!masterHasDetailsFlag.equals(Constants.NUMBER_YES)) {
    getRetrieveFromMaster().setHasDetailsFlag(Constants.NUMBER_YES));
    super.create(attributeList);
    One more question:
    Is there a danger of calling last() on row iterators in create/update/remove methods of *Impl files?
    => current row changed => any effect on display in JPanel
    Thanks
    Frederic
    PS All variable/method/class names have been manually renamed in this code so some small syntax problems may exist.

  • Entity Object's "addNewRow" Permission, how to implement?

    Hi,
    this is a generic question about an implementation strategy to be followed for ADF Authorization.
    I've been researching the definition of permissions at the entity object level, and successfully tested the 3 permission targets available: read, update, removeCurrentRow.
    However, I'd actually need the full set of permission targets for CRUD operations, which means that ADF lacks an "addNewRow" to secure row creation on EOs.
    What should be the strategy to implement that?
    Is it a planned feature so waiting till, say, 11g Release 2 should bring it to the table, or has it been left out by design and thus it just won't be added? In the latter case, how to actually implement it?
    I'd need to actually hide/disable the Create/CreateInsert button on my edit pages if the underlying EO does not allow new row creation for the current role. I gave a thought to EO's Custom Properties as a way to handle that extra permission flag, but is it a viable way? Can they be accessed through EL so that I can, say, use them directly in the Rendered/Disabled property of the button to regulate access?
    Or would you suggest another strategy altogether?
    Please share your ideas.
    thanks,
    RickyS

    Well, I can definitely see some benefits in having security at the model layer, at least in our scenario. In a complex app with many edit pages often dealing multiple times with the same EOs, having to specify a single set of policies on the EO itself and see it automatically implemented on every page seems a plus and a step ahead from 10g - not that I tried Security in 10g, but I know the approach. Seeing fields automatically become read-only or datacontrol operation buttons such as Delete become disabled without specifying anything on the page is cleaner and will speed up development a bit, too (for large numbers of pages that might be significant, on a small app it's probably irrelevant).
    Probably not as useful and powerful as model-driven lists, but still a welcome feature. You probably have a point about the double mainteinance, but that may be avoided if the BC layer security truly encompasses everything (e.g. if I can't rely on a "create" permissions, I'll certainly have to maintain additional code as well as additional BC data such as custom properties to deal with that, and this is even worse).
    Another point is that I might want to enable/disable functionality on the page via EL/backing bean based on BC permissions, and that seems useful. Being able to express a condition like "this EO is accessible" or "this attribute is accessible" is sometimes much superior to "user belongs to this role". It's better to decouple roles from the secured targets and just use the latter, IMHO. Especially becuse we'll likely won't have a fixed set of static roles defined in advance for all customers we'll deploy our webapp to.
    Just my 2 cents, anyway, you might end up being totally right :-)
    Cheers,
    RickyS

  • ADF Entity Object

    Is it true that
    1) Against every request, for data, from the screen (ViewController UI), the data is fetched from the related Entity object only and no request is fired to the database at any level.
    2) When both Application Server & database Server are up, Entity Object & the related database table are always completely synchronized (Whether data is changed manually directly at database level or through related ViewController UI).

    Hi,
    see the documentation
    http://www.oracle.com/webapps/online-help/jdeveloper/10.1.2?topic=bc_acaches_html
    and
    http://www3.nexpak.com/bc4jdoc/bc_ahowdoesbltcachedata.htm
    Frank

  • Can Designer generate ADF Entity Objects, View Objects and Apps Module ?

    Hi all,
    On what way can Designer integrate with JDeveloper (+ ADF) ?
    Can Designer generate ADF Entity Objects, View Objects and Apps Module ?
    Thank you for your help,
    xtanto

    Designer itself has no direct integration with JDeveloper. However, there are three options. First of all, you can get a JDeveloper extension (download this separately) that lets you create a Connection to a Designer repository. From that Connection you can find modules that you defined in Designer and generate Entity and View objects for the tables and columns that you used in those modules, and an Application Module. It does not create JSPs or other user interface objects.
    Another option is to buy JHeadstart from Oracle. This contains a set of code generators and ADF extensions that include an ability to get information from a Designer repository. JHeadstart works fine for non-Designer users too, but was built by the same people who wrote Designer Headstart - they know the repository API intimately.
    The third option is to download Oracle Designer Extension Builder (ODEB) which was just recently made available. This is a product of a collaboration between Designer users from the Oracle Development Tools Users Group (ODTUG) and Oracle to extend the capabilities of Designer with user written tools and utilities. You could use ODEB to write your own generators for ADF Business Components. Or you could wait and see if someone else in the user community does this. I hope that you or whoever does such a generator will be willing to share it with us all.

  • Validation at View Object level and not Enity Object

    How would you create validation logic at the view object level and not at the entity object level? I have many VOs that reference the same EO and want some validation logic to be applied only to certain VOs.
    Thanks,
    Quoc

    My use case for this is to perform form validation inputted by the user via a JSPX page.

Maybe you are looking for