Struts : creation of new row problem.

I have a problem with creation of a new row, using struts.
I've created simple struts browse-edit page. From browse page I go to 'edit-new' page. My object have a primary key - ID. I'm initializing it from sequence in create() method after call to super.create().
So, when I'm forwared to 'edit-new' form from 'browse' form new row created with id taken from sequence. When I go back to 'browse' form by 'update' action it looks that another row created in View object (and onother ID is taken from sequence). Then, if I have right understanding of how it works, all attributes from first created row are copied to the second row. When ID is copied, I've got
java.lang.reflect.InvocationTargetException: oracle.jbo.TooManyObjectsException: JBO-25013: Too many objects match the primary key oracle.jbo.Key[22 ].
     oracle.jbo.server.EntityImpl oracle.jbo.server.EntityCache.add(oracle.jbo.server.EntityImpl)
          EntityCache.java:361
     void oracle.jbo.server.EntityCache.replace(oracle.jbo.server.EntityImpl, oracle.jbo.Key)
          EntityCache.java:631
     void oracle.jbo.server.EntityImpl.setAttributeValueInternal(int, java.lang.Object)
          EntityImpl.java:2048
     void oracle.jbo.server.EntityImpl.setAttributeValue(int, java.lang.Object)
          EntityImpl.java:1844
     void oracle.jbo.server.AttributeDefImpl.set(oracle.jbo.Row, java.lang.Object)
          AttributeDefImpl.java:1688
     void oracle.jbo.server.EntityImpl.setAttributeInternal(int, java.lang.Object)
          EntityImpl.java:823
     void cern.ppt.lhc.evm.struts.UnitConversionsImpl.setId(oracle.jbo.domain.Number)
          UnitConversionsImpl.java:69
     void cern.ppt.lhc.evm.struts.UnitConversionsImpl.setAttrInvokeAccessor(int, java.lang.Object, oracle.jbo.server.AttributeDefImpl)
          UnitConversionsImpl.java:154
     void oracle.jbo.server.EntityImpl.setAttribute(int, java.lang.Object)
          EntityImpl.java:750
     void oracle.jbo.server.ViewRowStorage.setAttributeValue(int, java.lang.Object)
          ViewRowStorage.java:913
     void oracle.jbo.server.ViewRowStorage.setAttributeInternal(int, java.lang.Object)
          ViewRowStorage.java:829
     void oracle.jbo.server.ViewRowImpl.setAttributeInternal(int, java.lang.Object)
          ViewRowImpl.java:984
     void oracle.jbo.server.ViewRowImpl.setAttrInvokeAccessor(int, java.lang.Object, oracle.jbo.server.AttributeDefImpl)
          ViewRowImpl.java:961
     void oracle.jbo.server.ViewRowImpl.setAttribute(int, java.lang.Object)
          ViewRowImpl.java:753
     void oracle.jbo.html.struts11.BC4JActionForm.setAttribute(oracle.jbo.AttributeDef, java.lang.Object)
          BC4JActionForm.java:91
     void oracle.jbo.html.struts11.BC4JActionForm.setAttribute(java.lang.String, java.lang.Object)
          BC4JActionForm.java:103
     void cern.ppt.lhc.evm.struts.UnitConversionsViewForm.setId(java.lang.Object)
          UnitConversionsViewForm.java:18
     java.lang.Object java.lang.reflect.Method.invoke(java.lang.Object, java.lang.Object[])
          native code
     void org.apache.commons.beanutils.PropertyUtils.setSimpleProperty(java.lang.Object, java.lang.String, java.lang.Object)
          PropertyUtils.java:1650
     void org.apache.commons.beanutils.PropertyUtils.setNestedProperty(java.lang.Object, java.lang.String, java.lang.Object)
          PropertyUtils.java:1545
     void org.apache.commons.beanutils.PropertyUtils.setProperty(java.lang.Object, java.lang.String, java.lang.Object)
          PropertyUtils.java:1574
     void org.apache.commons.beanutils.BeanUtils.setProperty(java.lang.Object, java.lang.String, java.lang.Object)
          BeanUtils.java:919
     void org.apache.commons.beanutils.BeanUtils.populate(java.lang.Object, java.util.Map)
          BeanUtils.java:726
     void oracle.jbo.html.struts11.MultipartUtil._populate(java.lang.Object, java.lang.String, java.lang.String, javax.servlet.http.HttpServletRequest)
          MultipartUtil.java:194
     void oracle.jbo.html.struts11.BC4JRequestProcessor.processPopulate(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse, org.apache.struts.action.ActionForm, org.apache.struts.action.ActionMapping)
          BC4JRequestProcessor.java:417
     void org.apache.struts.action.RequestProcessor.process(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)
          RequestProcessor.java:246
     void org.apache.struts.action.ActionServlet.process(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)
          ActionServlet.java:1292
     void org.apache.struts.action.ActionServlet.doPost(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)
          ActionServlet.java:510
     void javax.servlet.http.HttpServlet.service(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)
          HttpServlet.java:760
     void javax.servlet.http.HttpServlet.service(javax.servlet.ServletRequest, javax.servlet.ServletResponse)
          HttpServlet.java:853
     void com.evermind[Oracle9iAS (9.0.3.0.0) Containers for J2EE].server.http.ServletRequestDispatcher.invoke(javax.servlet.ServletRequest, javax.servlet.ServletResponse)
          ServletRequestDispatcher.java:724
     void com.evermind[Oracle9iAS (9.0.3.0.0) Containers for J2EE].server.http.ServletRequestDispatcher.forwardInternal(javax.servlet.ServletRequest, javax.servlet.http.HttpServletResponse)
          ServletRequestDispatcher.java:309
     boolean com.evermind[Oracle9iAS (9.0.3.0.0) Containers for J2EE].server.http.HttpRequestHandler.processRequest(com.evermind[Oracle9iAS (9.0.3.0.0) Containers for J2EE].server.ApplicationServerThread, com.evermind[Oracle9iAS (9.0.3.0.0) Containers for J2EE].server.http.EvermindHttpServletRequest, com.evermind[Oracle9iAS (9.0.3.0.0) Containers for J2EE].server.http.EvermindHttpServletResponse, java.io.InputStream, java.io.OutputStream, boolean)
          HttpRequestHandler.java:767
     void com.evermind[Oracle9iAS (9.0.3.0.0) Containers for J2EE].server.http.HttpRequestHandler.run(java.lang.Thread)
          HttpRequestHandler.java:259
     void com.evermind[Oracle9iAS (9.0.3.0.0) Containers for J2EE].server.http.HttpRequestHandler.run()
          HttpRequestHandler.java:106
     void EDU.oswego.cs.dl.util.concurrent.PooledExecutor$Worker.run()
          PooledExecutor.java:803
     void java.lang.Thread.run()
          Thread.java:484
If I switch off filleng ID from the sequence everething works. It looks, that it fails, when It's coping ID (it gets two rows with the same ID).
So, my question is - why two rows creating? And is there a way how to solve this problem, without switching off filling ID from a sequence (I really need this)?

After reading this I am not sure what the solution is.
I've created a VO that contains 2 EO's that are using sequence and NO trigger. I've tested this in the app module testor and it works. After using the Wizard to build a Struts/BC4J app I get the following when pressing "update" after creating a new record - "JBO-25013: Too many objects match the primary key oracle.jbo.Key[279 ]".
Charles Gayraud suggested changing the method that sets the PK but I'm not sure what to change as there are 2 sections that deal with setting the PK, neither of which match the methods in Charles suggestion. see below
So what is the solution here?
Thanks,
Bill G...
public void setParentId(Number value) {
setAttributeInternal(PARENTID, value);
and
// BG ADD
protected void create(AttributeList attributeList) {
super.create(attributeList);
SequenceImpl s = new SequenceImpl("S_PARENT", getDBTransaction());
setAttribute("ParentId", s.getSequenceNumber());
// ParentImpl.java FULL LISTING
package mypackage27;
import oracle.jbo.AttributeList;
import oracle.jbo.Key;
import oracle.jbo.RowIterator;
import oracle.jbo.domain.Number;
import oracle.jbo.server.AttributeDefImpl;
import oracle.jbo.server.EntityDefImpl;
import oracle.jbo.server.EntityImpl;
// bg add
import oracle.jbo.server.SequenceImpl;
// --- File generated by Oracle Business Components for Java.
public class ParentImpl extends EntityImpl {
protected static final int PARENTID = 0;
protected static final int PARENTDESC = 1;
protected static final int CHILD = 2;
private static EntityDefImpl mDefinitionObject;
* This is the default constructor (do not remove)
public ParentImpl() {
* Retrieves the definition object for this instance class.
public static synchronized EntityDefImpl getDefinitionObject() {
if (mDefinitionObject == null) {
mDefinitionObject = (EntityDefImpl) EntityDefImpl.findDefObject(
"mypackage27.Parent");
return mDefinitionObject;
* Gets the attribute value for ParentId, using the alias name ParentId
public Number getParentId() {
return (Number) getAttributeInternal(PARENTID);
* Sets <code>value</code> as the attribute value for ParentId
public void setParentId(Number value) {
setAttributeInternal(PARENTID, value);
* Gets the attribute value for ParentDesc, using the alias name ParentDesc
public String getParentDesc() {
return (String) getAttributeInternal(PARENTDESC);
* Sets <code>value</code> as the attribute value for ParentDesc
public void setParentDesc(String value) {
setAttributeInternal(PARENTDESC, value);
// Generated method. Do not modify.
protected Object getAttrInvokeAccessor(int index, AttributeDefImpl attrDef)
throws Exception {
switch (index) {
case PARENTID:return getParentId();
case PARENTDESC:return getParentDesc();
case CHILD:return getChild();
default:return super.getAttrInvokeAccessor(index, attrDef);
// Generated method. Do not modify.
protected void setAttrInvokeAccessor(int index, Object value,
AttributeDefImpl attrDef) throws Exception {
switch (index) {
case PARENTID:setParentId((Number) value);
return;
case PARENTDESC:setParentDesc((String) value);
return;
default:super.setAttrInvokeAccessor(index, value, attrDef);
return;
* Gets the associated entity oracle.jbo.RowIterator
public RowIterator getChild() {
return (RowIterator) getAttributeInternal(CHILD);
* Creates a Key object based on given key constituents
public static Key createPrimaryKey(Number parentId) {
return new Key(new Object[] { parentId });
// BG ADD
protected void create(AttributeList attributeList) {
super.create(attributeList);
SequenceImpl s = new SequenceImpl("S_PARENT", getDBTransaction());
setAttribute("ParentId", s.getSequenceNumber());

Similar Messages

  • Creation of new Row in Tree Table

    We are creating a new row using CreateListener which is written in Bean, after creating the row, we are adding it to the iterator and the new row is not getting highlighted and focus is not in new row in the table by default. It takes an click to make it editable. 'setActiveRowKey()' method didnot help here which is used in the af:table component to achieve the same.
    Any pointers regarding this issue would be helpful..
    Thanks,
    Shruthi

    Hi Max:
    According to what you described, it's really wierd. An ADF table is Surrounded by a panelCollection or not doesn't matter in terms of CreateInsert operations, I think. Also each step you said OK doesn't mean that step is 100% problem free towards your final goal. For example, when you drag and drop and ADF table onto a JSF page, you forget to turn on 'row selection', it will be OK, you won't get any error message, but later on when you find that you need to turn it back on, you have to go back to JSF page source, to manually added codes to do so.
    The simpliest solution and quickest one is to reinitiate a clean ADF project and do it all over again. It's simple straightforward in my view. Probably don't use PanelCollection first, just drop your ADF table on a form, or af:panelForm, but make sure your table and 'CreateInsert' button is surrounded by a form, otherwise, when you click on 'CreateInsert', nothing will happen. When everything works, then probably back it up and replace your form or af:panelForm with panelCollection. See how it goes.
    Thanks,
    Alex

  • Table Creation of new rows in editable mode

    Hello,
    I'm using Jdev11g.
    I create a JSF page with a table, I add a button connected to CreateInsert bindings.
    Everything works fine but I want that when a new row is created on the table, the new row must be in editable mode.
    Thank's

    Hi Max:
    According to what you described, it's really wierd. An ADF table is Surrounded by a panelCollection or not doesn't matter in terms of CreateInsert operations, I think. Also each step you said OK doesn't mean that step is 100% problem free towards your final goal. For example, when you drag and drop and ADF table onto a JSF page, you forget to turn on 'row selection', it will be OK, you won't get any error message, but later on when you find that you need to turn it back on, you have to go back to JSF page source, to manually added codes to do so.
    The simpliest solution and quickest one is to reinitiate a clean ADF project and do it all over again. It's simple straightforward in my view. Probably don't use PanelCollection first, just drop your ADF table on a form, or af:panelForm, but make sure your table and 'CreateInsert' button is surrounded by a form, otherwise, when you click on 'CreateInsert', nothing will happen. When everything works, then probably back it up and replace your form or af:panelForm with panelCollection. See how it goes.
    Thanks,
    Alex

  • Problem creating a new row when using tabbed regions

    I am new to JHeadstart and ADF and have been using the evaluation version of JHeadstart (in JDev 11.1.1.3) to judge its efficacy for a new significantly-sized application. As part of that evaluation I have created a small application (you can do this with HR schema using say the Departments table) with a single entity and VO. On JHeadstart I have then placed some of the fields into multiple Item regions within a Tabbed region on the same page and below the Group (layout style Table, Table Overflow Style below With Splitter). Existing rows display fine and I can view the data on the separate tabs.
    However, if I try to create a row, I can fill in the data on the main region, but if I fill in data on the first tabbed region I cannot switch to the next tab without an error being generated.
    e.g. using Departments - fill in DepartmentId and DepartmentName on main region, fill in ManagerId on first tabbed region and try to switch to second tabbed region to fill in LocationId:
    Missing mandatory attributes for a row with key null of type HRModule.DepartmentsView1
    Attribute DepartmentId in HRModule.DepartmentsView1 is required.
    Attribute DepartmentName in HRModule.DepartmentsView1 is required.
    If you save, then you can navigate.
    You can also demonstrate something similar (different error message but probably the same root cause) on the myJHSTutorial demo. If you navigate to an employee off the regions page and try and create a new employee (using the '+' button below the 'Employees' label), then the tabs are not refreshed and any attempt to change the tabs results in an error
    Failed to validate a row with key oracle.jbo.Key[999 ] in HRModule.EmployeesView3
    Attribute Salary in HRModule.EmployeesView3 is required.
    Salary must be between 6000 and 12000 for this job.
    The JHS devguide does not help. Any thoughts? I can send the HR sample if you wish.

    OK, I was able to reproduce this. The problem is that when you switch tabs, a partial page request is send to the server which does not include the items filled in the table row itself, hence these items are not updated in the underlying view object row.
    Solution is to have a partial trigger at the table or group level listening to tab events. We will add that to the next release, but you can also apply the fix yourself by adding the following lines to the stackedRegionContainer.vm template:
    #if (${JHS.current.pageComponent.tableLayout} && !(${JHS.current.pageComponent.hasOverflowInline}))
    ## when creating a new row in a table, and using overflow right/below, when switching overflow tabs
    ## the items filled in the table itself must also be processed as part of JSF model update phase, to
    ## prevent required item error when clicking another tab in overflow area
    ## we can enforce this by making the whole group listen to tab events
    #ADD_CUR_GROUP_PARTIAL_TRIGGER("#REGION_ID()Tabs")
    #end
    Add these lines just before the line starting with
    <af:${elemName}
    Steven Davelaar,
    JHeadstart team.

  • Problem with adding a new row in JTable

    Hi,
    I've created a JTable using DefaultTableModel with DefaultTableModel(Object[][] obj,Object[] col) constructor.I've written actionListener for a JButton which should add new row to the tablemodel.Now, the listener adds the row to the model.But its throwing an ArrayOutofBoundsException and the added row is not visible unless I click on any column of the table.
    Kindly help me to resolve this problem
    TIA
    Regards
    Gopi

    Thanks a lot for the reply. Here is the complete code
    TableImpl.java
    import javax.swing.*;
    import javax.swing.event.*;
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.table.*;
    import java.util.Vector;
    public class TableImpl extends JFrame {
    DefaultTableModel dataModel;     // TableModel Variable
    /* Constructor to add table and button to the frame     */
    TableImpl() {
              getContentPane().setLayout(null);
              setSize(800,600);
              myModel();
              final JTable table = new JTable(dataModel);
              JScrollPane scrollpane = new JScrollPane(table);
              getContentPane().add(scrollpane);
              scrollpane.setBounds(10,10,700,300);
              TableColumn tcCol = table.getColumnModel().getColumn(1);
              /* Adding ComboBox to the CellEditor of Column 2 of table     */
              JComboBox jcbComboBox = new JComboBox();
              final ReturnVector vctDBAccess = new ReturnVector();
              jcbComboBox.addItem(vctDBAccess.vctGetOidList().elementAt(0).toString());
              jcbComboBox.addItem(vctDBAccess.vctGetOidList().elementAt(2).toString());
              jcbComboBox.addItem(vctDBAccess.vctGetOidList().elementAt(4).toString());
              tcCol.setCellEditor(new DefaultCellEditor(jcbComboBox));
              /*     Adding Listener for Table      */
              dataModel.addTableModelListener(new TableModelListener() {
                   public void tableChanged(TableModelEvent e) {
              /* Columns Manipulation */
                        if(dataModel.getColumnName(e.getColumn()).equals("Second")) {
                        int iRow = e.getFirstRow();
                        int iColumn = e.getColumn();
                        String strColName = dataModel.getColumnName(iColumn);
                        String strData = (String)dataModel.getValueAt(iRow,iColumn);
                        String strNextColumn = dataModel.getColumnName(iColumn+1);
                        dataModel.setValueAt(vctDBAccess.vctGetOidList().elementAt(vctDBAccess.iGetIndex(strData)+1),iRow,iColumn+1);
              /* Adding button to Frame     */
              JButton jbInsert = new JButton("Insert");
              /* Adding new row to the Tablemodel -- Probelm is here     */
              jbInsert.addActionListener(new ActionListener(){
              public void actionPerformed(ActionEvent e){
                        try {
                   Object[] nrow = {"what", "ever", "you"};
                   dataModel.addRow(nrow);
                   }catch(Exception ex) {
                   System.out.println("Exception at adding row = " + ex);
    getContentPane().add(jbInsert);
    jbInsert.setBounds(100,350,100,20);
    addWindowListener(new WindowAdapter() {
              public void windowClosing(WindowEvent e) {
                   System.exit(0);
         /* Method to initialise new tablemodel     */
         public void myModel() {
              Object[][] data = { {new Integer(10),"two","three"},
                                                 {new Integer(5),"two","three"},
                                                 {new Integer(4),"two","three"},
              String[] col = { "First", "Second", "Third"};
              dataModel = new DefaultTableModel(data,col);
    public static void main(String arg[]) {
              TableImpl ct = new TableImpl();
              ct.setVisible(true);
    /* Class that returns a Vector of String for populating ComboBox entries and
              for getting the index of a particular element of the vector          */
    class ReturnVector {
                   Vector vctOidName=null;
                   ReturnVector() {
                        this.vctOidName = new Vector();
                        vAddOidList();
                   public void vAddOidList() {
                        String[] dbResult = {      "system", "1.3.6.1.2.1.1" ,
                                                      "interface", "1.3.6.1.2.1.2" ,
                                                      "snmp", "1.3.6.1.2.1.3" };
                        for(int i=0;i<dbResult.length;i++) {
                             System.out.println("Value = " + dbResult);
                             vctOidName.addElement(dbResult[i]);
                   public Vector vctGetOidList() {
                        return vctOidName;
                   public int iGetIndex(String strData) {
                        System.out.println("Index = " + vctOidName.indexOf(strData));
                        return vctOidName.indexOf(strData);

  • Problem with deleting a new row in table

    Hi
    I'm using JDev 11.1.1.2.0
    Please someone tell me if he/she experience the same issue:
    - I have an simple entity with PrimaryKey other than RowID. I have a ViewObject on top of the Entity.
    - From this view I create Editable table and add createInsert and Delete buttons.
    This is one of the most common scenarios.
    Now when I click createInsert a new blank row is added to the table. I enter it's primary key (because is mandatory) and move selection to some other row (let say X).
    When I go back and select my new Row and press Delete -> it is not deleted but the row X is deleted.
    This is because the table is not refreshed and it cant select the new row.
    How can I deal with this problem?
    Thanks
    Angel

    I tried with adding my selectionListener method like this:
            Object next = selectionEvent.getAddedSet().iterator().next();
            Object prev = selectionEvent.getRemovedSet().iterator().next();
            System.out.println(prev + " " + next);      
            DCBindingContainer bc = (DCBindingContainer)BindingContext.getCurrent().getCurrentBindingsEntry();
            DCIteratorBinding iter = (DCIteratorBinding)bc.get("TestDopSyotvIterator");
            FacesCtrlHierBinding object1 = (FacesCtrlHierBinding)bc.get("TestDopSyotv");
            FacesCtrlHierBinding.FacesModel collectionModel = (FacesCtrlHierBinding.FacesModel)object1.getCollectionModel();
            collectionModel.makeCurrent(selectionEvent);I add new row, enter data and change selection. Then the system.out prints the right keys of the rows.
    But when I go back to the new added row, the system.out prints "null" for the "next" value (that means the rowKey was lost).
    Any ideas how to fix this?

  • Some problems with af:table (new rows with presetting and autosubmit)

    Hi, I'm working with an af:table, but I'm having some troubles.
    Background:
    Jdev 11.1.1.5.0
    Firefox 6.0.2
    In the Bounded Task flow:
    ExecuteWithParams -> fragment < commit/rollback
    ExecuteWithParams: Set a bind variable with a value from bpm payload for get only rows with that value.
    In the fragment:
    An af:table with a button CreateInsert (the new rows need to use the value of the payload in the hidden column, i don't know how do this, assign the value to the #{row.bindings.IdDistribution.inputValue}) [First problem]
    The inputText of the af:table has the autoSubmit in true. The first time that I fill the cells I got this error in each entered value, after press the tab key.
    ADF-FACES- 60097... ADF_FACES-60096:Server Exception during PPR, #n (where n is 1,2,3,4 for each cell). [Second problem]
    When I press the Commit Button, all values from cells dissapears. And I got the message from validator that cells can't be null. [Third problem]
    If I fill cells again, all work right. Validations, no errors ADF_FACES-60096 and a successful commit.
    How I can solve these problems?
    Thanks in advance.

    Hi,
    you need to bind the value property of the selectOneRadio to the row variable. Say the button updates an attribute "q1" then the value property should point to #{row.bindings.q1.inputValue} assuming you use ADF and ADF BC. The question svary I assume., so you need to query thequestion for each row. For this reference a managed bean doe the f:selectItems and in the managed bean use the #{row} attribute to get a hold of the current rendered row (instance of JUCtrlHierNodeBinding if ADF is used. This has a method getRow() to obtain the Row object). The list then returns the answers to select from
    Frank

  • PROBLEM WITH NEW ROW  --- PLEASE HELP

    Hello,
    I've had it with the framework. It's been 20 hours and counting that I am trying to insert/validate a new record.
    Things just don't work as advertised.
    Here's the situation:
    I have an entity object with various validation rules in the validate() method.
    Then I have a simple JSP page to insert new records.
    At submit of button, I follow the framework's default
    create new row and fill it up, with the difference
    that i need to validate the row as soon as I fill it up
    with data from the http request:
    <jbo:OnEvent name="Create">
    <jbo:Row id="newrow" datasource="ds" action="CreateInRange" >
    <% try { %>
    <jbo:SetAttribute dataitem="*" />
    <%
    newrow.validate(); //******* NOTICE HERE THAT I VALIDATE
    } catch (JboException ex) {
    newrow.remove();
    throw ex;
    } %>
    </jbo:Row>
    </jbo:OnEvent>
    Unexpected behavior 1: If the validation fails,
    newrow DOES NOT GET REMOVED!!!! I know this
    since when I view data thru a data table component,
    the row is there WITH THE ERROR INFORMATION set!!.
    If I do a commit transaction, then the erroneous information ENDS UP IN THE DATABASE!!!!!
    Unexpected behavior 2: If I do a rollback, every
    call to subsequent pages results in a jsp error:
    java.lang.ClassCastException: oracle.jbo.html.jsp.datatags.OnEventTag
    PLEASE HELP.
    Chris Lambrou

    I have (hopefully) found a solution to my part of this problem. I was getting the ClassCastExceptions on any page with a <jbo:row> tag after doing a failed DML action. I have tested this with the delete event. (btw, I am using jdev9.0.3.3 w/ BC4J/JSP) Before what I was doing was this:
    <% try { %>
    <jbo:Row id="delrow" datasource="ds" rowkeyparam="jboRowKey" action="Delete" />
    <% } catch (JboException jboEx) { %>
    do something
    <% } catch (Exception ex) { %>
    uh-oh, this is bad
    <% } %>
    If I removed the try/catch block everything worked fine. Unfortunatlely, I need to try/catch block here. To work around the problem I changed the code to this:
    <% Row rowDelete = ds.getRowFromKey(params.getParameter("jboRowKey")); %>
    <% try { %>
    <%
    rowDelete.remove();
    %>
    <% } catch (JboException jboEx) { %>
    do something
    <% } catch (Exception ex) { %>
    uh-oh, this is bad
    <% } %>
    The second bit of code does the same thing (but it doesn't use a bean like I think <jbo:Row> does) and it doesn't cause the ClassCastError on subsequent errors.
    I really hope this helps someone else because it took me forever to get a workaround!
    ~Rob Lundeen

  • Problem in Creating new row & inserting data using CreateInsert and Commit

    Hello All,
    I have created a page there are few input text and i want to insert the data into a database table. I have created an Application Module I am using CreateInsert and Commit operation but there is one problem.
    At first it created a row in database after that it is not creating the new row instead it is updating the same row with the new values.
    In bindings of my jspx page I have created two binding for action (1) CreateInsert for the VO of that Application Module (2) Commit operation of that Application Module.
    Here is the code snippet of my application:
    BindingContainer bindings = getBindings();
    OperationBinding operationBinding = bindings.getOperationBinding("CreateInsert");
    Object result = operationBinding.execute();
    *if (!operationBinding.getErrors().isEmpty()) {*
    return null;
    OperationBinding operationBinding1 = bindings.getOperationBinding("Commit");
    Object result1 = operationBinding1.execute();
    *if (!operationBinding1.getErrors().isEmpty()) {*
    return null;
    I have tried using Execute+Commit and Insert+Commit case also in every case it is updating the same row and not inserting a new row.
    Is there anything I am missing?
    Please Help.

    hi user,
    i dono. why are trying with codes. adf provides zero lines codes.
    a wonderful drag and drop functionality provide by the framework.
    while double click the button the codes are  registered in your bean
        public String cb6_action() {
            BindingContainer bindings = getBindings();
            OperationBinding operationBinding = bindings.getOperationBinding("CreateInsert");
            Object result = operationBinding.execute();
            if (!operationBinding.getErrors().isEmpty()) {
                return null;
            return null;
        public String cb8_action() {
            BindingContainer bindings = getBindings();
            OperationBinding operationBinding = bindings.getOperationBinding("Commit");
            Object result = operationBinding.execute();
            if (!operationBinding.getErrors().isEmpty()) {
                return null;
            return null;
        public String cb7_action() {
            BindingContainer bindings = getBindings();
            OperationBinding operationBinding = bindings.getOperationBinding("Delete");
            Object result = operationBinding.execute();
            if (!operationBinding.getErrors().isEmpty()) {
                return null;
            return null;
        public String cb14_action() {
            BindingContainer bindings = getBindings();
            OperationBinding operationBinding =
                bindings.getOperationBinding("Delete4");   // some different here. after deleting usually do commit
            OperationBinding operationBinding1 =  
                bindings.getOperationBinding("Commit");    // so here commit operation.
            Object result = operationBinding.execute();
            Object result1 = operationBinding1.execute();
            if (!operationBinding.getErrors().isEmpty()) {
                return null;
            if (!operationBinding1.getErrors().isEmpty()) {
                //add error handling here
                return null;
            return null;
        }if am not understud correctly. please some more explanation need.

  • Problem in creating new row

    Hi,
    I am facing a strange problem. i have created many new rows and inserted the data, but now i am facing a strange problem.
    This is my requirement.
    I have table with table action button as create.
    when i click create it is not at all creating new row for the view object but instead it will take the row at the top of the table and replace that line with new data.
    Below is the code :
    In CO
    In PR
    if (!pageContext.isBackNavigationFired(false))
    TransactionUnitHelper.startTransactionUnit(pageContext, "RVSchematicAttributeCreateTxn");
    if (!pageContext.isFormSubmission())
    System.out.println("control entered create block");
    OAApplicationModule am = pageContext.getApplicationModule(webBean);
    System.out.println("before calling ");
    am.invokeMethod("createRVSchematicAttribute",null);
    System.out.println("after calling ");
    else
    if (!TransactionUnitHelper.isTransactionUnitInProgress(pageContext, "RVSchematicAttributeCreateTxn", true))
    OADialogPage dialogPage = new OADialogPage(NAVIGATION_ERROR);
    pageContext.redirectToDialogPage(dialogPage);
    IN PFR
    OAApplicationModule am = pageContext.getApplicationModule(webBean);
    if(pageContext.getParameter("Apply")!=null)
    System.out.println("apply button is clicked");
    OAViewObject vo = (OAViewObject)am.findViewObject("xxczVAGCSSchematicAttributeVO1");
    String schematicId = (String)vo.getCurrentRow().getAttribute("SchematicId");
    String msg= "SchematicId "+schematicId+"has been added";
    am.invokeMethod("apply");
    System.out.println("returned back to create CO");
    OAException confirmMessage = new OAException(msg,OAException.CONFIRMATION);
    pageContext.putDialogMessage(confirmMessage);
    pageContext.forwardImmediately("OA.jsp?page=/va/oracle/apps/xxcz/gcs/maintenance/webui/xxczVAGCSRVSchematicAttributeResultsPG",
    null,
    OAWebBeanConstants.KEEP_MENU_CONTEXT,
    null,
    null,
    true, // retain AM
    OAWebBeanConstants.ADD_BREAD_CRUMB_NO);
    in AM
    public void createRVSchematicAttribute()
    System.out.println("entered createRVSchematicAttribute ");
    xxczVAGCSSchematicAttributeVOImpl vo = this.getxxczVAGCSSchematicAttributeVO1();
    // OAViewObject vo = (OAViewObject)this.getxxczVAGCSSchematicAttributeVO1();
    vo.setMaxFetchSize(0);
    vo.clearCache();
    if (!vo.isPreparedForExecution())
    vo.executeQuery();
    /* Row row = vo.createRow();
    vo.insertRow(row);
    row.setNewRowState(Row.STATUS_INITIALIZED);
    System.out.println("Row.STATUS_INITIALIZED");*/
    int rowCount = vo.getRowCount();
    Row row = vo.createRow();
    vo.insertRowAtRangeIndex(rowCount, row);
    row.setNewRowState(Row.STATUS_INITIALIZED);
    Please help me i don't know where i am going wrong. i have checked so many times but didn't find any bug.
    -Mithun

    Hi Zafar,
    Ok i will explain my problem with an example.
    I have employee table with following fields.
    Empname
    Empnumber
    Salary
    Table data
    Empname EmpNumber Salary
    Jack 10 1000
    sam 20 2000
    joe 30 3000
    Above is the table structure for which i need to add another row
    I have two page one results page and another create page
    In Results page i will show the above table structure with table action button "Create" in order to insert new record to table.
    When i click Create button it will navigate to create page
    In Create page i will get the below data
    Empname : Jack
    Empnumber :10
    Salary :1000
    Instead of
    Empname :
    Empnumber :
    Salary :
    suppose now if i change the jack to jack1 , 10 to 11 , or 1000 to 10001 and click submit
    Now the result page will show
    Empname EmpNumber Salary
    Jack1 11 1001
    sam 20 2000
    joe 30 3000
    No fourth row is created it is actually behaving like update functionality and updating the top most row.
    -Mithun

  • Problem while adding a new row to the table.

    hello,
    In my ADF form i have a table. and when i click on CreateInsert it add a new to the table but at the first. i want all the new rows to be added at the end of the table in a sequence. how can i do this?....
    Thanks and Regards,
    Rakshitha

    Hi,
    Try this:
    DCIteratorBinding dciter;
    BindingContainer bindings = BindingContext.getCurrent().getCurrentBindingsEntry();
    dciter = (DCIteratorBinding) bindings.get("findAllTestAndryIter");
    ViewObjectImpl vo = dciter.getViewObject();
    if (vo != null)
    Row row = vo.createRow();
    int rangeSize = vo.getRangeSize();
    int rowsInRange = vo.getAllRowsInRange().length;
    int insertPos = rowsInRange < rangeSize? rowsInRange: rangeSize - 1;
    vo.insertRowAtRangeIndex(insertPos, row);
    vo.setCurrentRow(row);
    }

  • Problem while creating a new row

    I am trying to create a new row in FulfillmentLineEntryResultVORowImpl which will be within the CheckAvailabilityOutputVORowImpl.
    For that I am trying to do the following coding and I am getting the "NullPointerException" while creating the "flrow".
    Please look in the code and suggest me the correct way.
    CheckAvailabilityOutputVOImpl outputVO = getCheckAvailabilityOutput1();
    CheckAvailabilityOutputVORowImpl outputRow = null;
    outputRow = (CheckAvailabilityOutputVORowImpl)outputVO.createRow();
    FulfillmentLineEntryResultVOImpl fle = getFulfillmentLineEntryResult1();
    FulfillmentLineEntryResultVORowImpl flrow = (FulfillmentLineEntryResultVORowImpl)fle.createRow();
    flrow.setErrorCode("26");
    fle.insertRowAtRangeIndex(0, flrow);
    and
    public CheckAvailabilityOutputVOImpl getCheckAvailabilityOutput1() {
    return (CheckAvailabilityOutputVOImpl)findViewObject("CheckAvailabilityOutput1");
    public FulfillmentLineEntryResultVOImpl getFulfillmentLineEntryResult1() {
    return (FulfillmentLineEntryResultVOImpl)findViewObject("FulfillmentLineEntryResult1");
    }

    Hi,
    I am using transient VO.
    The code that i mentioned earlier is to create the dummy response for the web service in error condition.
    For normal condition we are getting data from XML and by using readXML I am generating row nicely.
    The piece of code for normal scenario where it is working nicely is...
    Document doc = sendMessage("CheckAvailabilityInput", headerNode);
    CheckAvailabilityOutputVOImpl outputVO = getCheckAvailabilityOutput1();
    outputVO.readXML(doc.getDocumentElement(), -1, getXslForReadXML());
    if (AppsLogger.isEnabled(AppsLogger.FINE)) {
    Node headerNode1 = (XMLNode)outputVO.writeXML(-1, XMLInterface.XML_OPT_ALL_ROWS | XMLInterface.XML_OPT_ASSOC_CONSISTENT);
    try {
    Writer sw = new StringWriter();
    ((XMLNode)headerNode1).print(sw);
    } catch (IOException e) {
    AppsLogger.write(this.getClass(),
    "Couldn't convert the VO to xml",
    AppsLogger.FINE);
    outputRow = (CheckAvailabilityOutputVORowImpl)outputVO.getRowAtRangeIndex(0);
    And The xml that I am using is like below....
    <?xml version="1.0" encoding="utf-8"?>
    <checkAvailabilityOutput xmlns:op="http://xmlns.oracle.com/apps/scm/orderPromising/orderPromising/promisingServices/types/">
    <PromisingSystem>DOO-OP</PromisingSystem>
    <PromisingInstance>Instance</PromisingInstance>
    <PromiseDate>2012-08-22</PromiseDate>
    <FulfillmentLineEntryResult>
    <FulfillmentLineReply>
    <FulfillmentLineIdentifier>FID-003</FulfillmentLineIdentifier>
    <NumberOfAltOptions>0</NumberOfAltOptions>
    <DefaultAvailabilityOption>
    <OptionRank>0</OptionRank>
    <OptionSummary>0</OptionSummary>
    <FulfillmentLineResult>
    <FulfillmentLineIdentifier>FID-003</FulfillmentLineIdentifier>
    <TotalPrice>8000</TotalPrice>
    <TotalProfit>-392000</TotalProfit>
    <TotalMargin>-98</TotalMargin>
    <TotalValue>-392000</TotalValue>
    <NumberOfSplits>0</NumberOfSplits>
    <NumberOfSubstitutions>0</NumberOfSubstitutions>
    <FillRate>100</FillRate>
    <NumberOfAtpItems>1</NumberOfAtpItems>
    <NumberOfCtpItems>0</NumberOfCtpItems>
    <SourcingRule></SourcingRule>
    <ResultDetail>
    <SplitLineIdentifier></SplitLineIdentifier>
    <Customer>CUST_ID_001</Customer>
    <CustomerSite>CUST_SITE_001</CustomerSite>
    <InternalSalesOrderDestOrg>
    <OrgId></OrgId>
    </InternalSalesOrderDestOrg>
    <PromisingStatus></PromisingStatus>
    <RequestedDate>2012-06-02</RequestedDate>
    <PromisingType>Ship</PromisingType>
    <ExpectedArrivalDate>2012-06-01</ExpectedArrivalDate>
    <ExpectedShipDate>2012-06-01</ExpectedShipDate>
    <ExpectedPickDate>2012-06-01</ExpectedPickDate>
    <RequestedItem>ITEM_CODE_001</RequestedItem>
    <ExpectedAvailableItem>ITEM_CODE_001</ExpectedAvailableItem>
    <ExpectedAvailabilityOnRequestedDate>0</ExpectedAvailabilityOnRequestedDate>
    <ExpectedAvailableQuantity>200</ExpectedAvailableQuantity>
    <ExpectedAvailableQuantityUOM>EA</ExpectedAvailableQuantityUOM>
    <ExpectedShipFromOrg>
    <InstanceId></InstanceId>
    <OrgId>HYDERABAD</OrgId>
    </ExpectedShipFromOrg>
    <ExpectedDropShipSupplier></ExpectedDropShipSupplier>
    <ExpectedDropShipSupplierSite></ExpectedDropShipSupplierSite>
    <ExpectedMode></ExpectedMode>
    <ExpectedService></ExpectedService>
    <ExpectedCarrier></ExpectedCarrier>
    <CarrierCalendar></CarrierCalendar>
    <ExpectedDemandClass></ExpectedDemandClass>
    <ExpectedTotalFulfilmentCost>400000</ExpectedTotalFulfilmentCost>
    <ExpectedShippingCost>0</ExpectedShippingCost>
    <ExpectedMargin>-98</ExpectedMargin>
    <Price>8000</Price>
    <Profit>-392000</Profit>
    <Value>-392000</Value>
    <LineFillRate>100</LineFillRate>
    <ErrorCode></ErrorCode>
    <ErrorMessage></ErrorMessage>
    <PeggingDetail>
    <ItemId>ITEM_CODE_001</ItemId>
    <OrgInfo>
    <InstanceId></InstanceId>
    <OrgId>HYDERABAD</OrgId>
    </OrgInfo>
    <ShippingCalendar>Calendar1</ShippingCalendar>
    <ReceivingCalendar>Calendar2</ReceivingCalendar>
    <ManufacturingCalendar>Calendar3</ManufacturingCalendar>
    <ATPDetail>
    <Quantity>200</Quantity>
    <QuantityUom>EA</QuantityUom>
    <ATPCost>400000</ATPCost>
    <ATPMode>3</ATPMode>
    <LeadTime>0</LeadTime>
    <RequiredQuantity>200</RequiredQuantity>
    <RequiredDate>2012-06-01</RequiredDate>
    <AllocationRule></AllocationRule>
    <DemandClass></DemandClass>
    </ATPDetail>
    </PeggingDetail>
    </ResultDetail>
    </FulfillmentLineResult>
    </DefaultAvailabilityOption>
    </FulfillmentLineReply>
    </FulfillmentLineEntryResult>
    </checkAvailabilityOutput>

  • Problems with adding a new row in my table

    Im an ADF beginner but I thought it would be simple to to do some basic CRUD stuff in ADF. Im now even struggling when i try to add a new row to my table.
    Seems that the primary key id is not set correctly...
    could someone help?

    Hi,
    Have a look to this page CREATE SEQUENCE
    Regards,
    Sébastien
    Creating a Sequence: Example
    The following statement creates the sequence customers_seq in the sample schema oe. This sequence could be used to provide customer ID numbers when rows are added to the customers table.
    CREATE SEQUENCE customers_seq START WITH     1000 INCREMENT BY   1 NOCACHE NOCYCLE;

  • Problem in adding a new row in a table.. plsss hlppp

    Hi Friends,
    I have a table defaulted to 4 rows. I have a add button to add a new row in the table.
    When i have already 4 rows in table, and when i click add its adding that 5th row correctly( and i used set_lead_selection for this new row ).
    But i want to automatically make a next page once i hit the ADD button here. Each time now i m hitting next page then only  able to see hte 5th row. I need once ADD is clicked, i want to see the 5th row visible..
    Can someone tell me how to code or do this
    thanks friends,,,
    Niraja

    hi niraja,
    Plz refer to the following code:
    method onactiononadd .
    node_material type ref to if_wd_context_node.
    elem_material type ref to if_wd_context_element.
    stru_material type sflight.
    node_material =  wd_context->get_child_node( name = 'ANNA' ).
    elem_material = node_material->get_element(  ).
    if ( elem_material is initial ).
    call method node_material->create_element
    receiving
    element = elem_material.
    endif.
    call method elem_material->get_static_attributes
    importing
    static_attributes = stru_material .
    call method node_material->bind_structure
    exporting
    new_item = stru_material
    set_initial_elements = abap_false.
    endmethod.
    i hope it helps
    regards
    arjun

  • New row creation in value change event

    I used this code for to create new empty for adf table in value change listener
    public void valchaag(ValueChangeEvent valueChangeEvent) {
    OperationBinding oper = (OperationBinding ) bindings.get("Create");
    oper.execute();
    AdfFacesContext.getCurrentInstance().addPartialTarget(<table UI reference ttt>);
    but its creating new empty row when i changing the value of last column of current row and along with some error ....such as
    JBO-27027: Missing mandatory attributes for a row with key null of type AppModule.PmmpropfacilityView1
    JBO-27014: Attribute Propertycode in AppModule.PmmpropfacilityView1 is required
    JBO-27014: Attribute Facilitycode in AppModule.PmmpropfacilityView1 is required
    JBO-29000: Unexpected exception caught: java.lang.NullPointerException, msg=null
    java.lang.NullPointerException

    Hi,
    appears as if you submit a row that misses attribute values. I am not sure this is related to creating the new row. Try adding a call to responseComplete (from the FacesContext) after creating the row.
    Frank

Maybe you are looking for

  • Migration of weblogic 8.1 from solaris to 10.3 in Linux

    Hello All, We want migrate our WebLogic 8.1 from Solaris to 10.3 in linux, i am unable to find any documents on this. Can any one help me on this. Thanks, Nkhil

  • How to use lookup in xquery(OSB)

    Hi In xquery , I have hardcoded the value and compare the hard coded value against input payload and fetch the corresponding value for hard coded value . In this way, I have hardcoded around 35 values in Xquery . But the client wants to use lookup or

  • T60 Rescue and Recovery Workspace Login - need help!!

    Im attempting to use the rescue and recover CD that came with my T60, and i keep getting a login screen that propmpts me to enter my Windows Password. After i enter my password, am am getting a error message stating "The Requested operation requires

  • Simulator freeze/crash - PLEASE HELP!

    I have a major problem: for some reason, I have a Menu items that crashes compressor. I can't explain any further... I just click to that menu, and Simulator locks up. Here is a link to a video of what's going on: http://www.piecebypiecemovie.com/sim

  • Habra ios 7 para ipod touch 4g?

    Creo Que deberia HACER en Una Actualizacion De ios 6.1.5 o Inventar Algoritmo si tan si Quiera ONU 6.1.8 deberian Inventar Para Los ipods