Row removal

I have created a dynamic form. In this form I have a table that duplicates. The first field is a number field that auto generates the number as you add a new row (1,2,3...etc). I have added the jave to recalculate the number field when you delete a row to keep the numbers in order. On each duplicated table there is an add and delete row. Every thing seems to function as desired except with the deleting of a row. If I have 5 rows and I wish to delete row number 3 it will delete the row above it (2). Does anyone know how make the form delete the duplicated row that the delete row button is in rather than a different row?

Hi Shane,
You need to remove the same instance of the row which is created. Try this one.
form1.page1.Table1.Row1.instanceManager.removeInstance(this.Row1.index);
This will remove the particular row.
Thanks,
Bibhu.

Similar Messages

  • Row.remove() problem

    I have problem that sometimes remove() method doesn't work (I tried viewobject.removeCurrentRow() with the same result).
    When I pass following steps:
    1) 2 rows are removed:
    vo.executeQuery();
    while ((row = vo.first()) != null) row.remove();
    2) 1 row is inserted:
    row = vo.createRow();
    row.setAttribute(attr, value);
    vo.insertRow(row);
    3) write out contents of vo (it is right - 1 inserted):
    vo.executeQuery();
    vo.reset();
    while ((row = vo.next()) != null) System.out.println(row.getSomething());
    4) commit()
    5) write out contents of vo (it is sometimes right - 1 inserted row, simetimes bad - 2 rows (1 inserted and 1 removed)):
    vo.executeQuery();
    vo.reset();
    while ((row = vo.next()) != null) System.out.println(row.getSomething());
    (6) if I get values directly from database (sqlplus) - I can see the same rows I see from point 5).)
    So the problem occures sometimes inside commit() - sometimes removed row are not removed inside database!
    My VO is second detail - master1->master2->myvo.
    My SQL dialect is SQL92 and type mapping Oracle. I use JDeveloper 9.0.5.2
    Thank you very much for any help...
    Jan

    I found that if I change SQL dialect to Oracle, then everything os OK.
    It seems there is a bug while SLQ92 dialect is set...
    Anybody has similar experiencies?
    Jan

  • Empty row removal

    I have copied and pasted information into a spreadsheet. There are blank/empty rows that are not adjacent that I would like to remove. There are 1400 pages so I don't want to do it manually. Is there a way to do it automatically?

    Open up the Reorganize window
    Filter to show only rows that are blank.
    Select all but one of the blank rows and delete them en masse.
    Unfilter
    Delete the last blank row.

  • Dynamic Table Row Removal

    I'm using LiveCycle Form Designer 8 and Acrobat Reader 7.09
    I've created a simple dynamic table that has an ADD ROW button that uses _Row1.addInstance(1); to add a new row and that works great. I then added the Delete Row button in a SubForm to the first cell of the row with the JavaScript _Row1.removeInstance(this.parent.index).
    The problem is that the Delete Row button always deletes the first row instead of the row that the button is in. So that indicates that this.parent.index = 0. If I force the value it does remove that specific line but I want the removeInstance to remove the line that has been selected.
    How do I get the index to reflect the value of the row that the removeInstance button is in? I must be missing something very basic.

    I'm having the same problem. I tried removeinstance(this.index) but that seems to resolve to index 0 no matter how many instances there are.
    Cheers,
    Al

  • BEX drilldown in rows removes records

    We have a query that initially gives us four records.  When we Drilldown in the Rows for 0POSTXT (add the column 0POSTXT), two of the records disappear.  Any ideas?

    Hi,
    Is the Query built on MP or Cube.
    First check is there any conditions on that particular char? Can you explain more on this.
    Reg
    Pra

  • RowInconsistentException JBO-25014 when trying to remove rows

    Hi All,
    In my AMImpl.java, I have written this code to delete all the rows having same 'occurrenceId' value as the current row which triggers this method :
    public void deleteRecords() {
    AssignmentRowImpl currentRow = this.getAssignment().getCurrentRow();
    Long occurrenceId = (Long)currentRow.getAttribute("OccurrenceId");
    VOImpl assignVO = this.getAssignmentVO();
    ViewCriteria vc = assignVO.getViewCriteria("findByOccurrenceId");
    assignVO.setNamedWhereClauseParam('pOccurrenceId" , occurrenceId);
    assignVO.applyViewCriteria(vc);
    assignVO.executeQuery();
    RowSetIterator iter = assignVO.createRowSetInterator(null);
    while(iter.hasNext() ) {
    AssignmentRowImpl row = (AssignmentRowImpl)iter.next();
    row.remove();
    iter.close();
    try {
    this.getTransaction.commit(); }
    catch(Exception e) {e.printStackTrace(); }
    The issue is that 'commit' is throwing RowInconsistentException. I am sure that no other user is having a lock on records.
    I have tried the following without any success :
    1. Calling row.refresh(Row.REFRESH_UNDO_CHANGES) before row.remove
    2. Calling refresh(REFRESH_WITH_DB_FORGET_CHANGES) before row.remove
    3. Making 'Refresh After Insert/Update' = 'true' for History columns and Primary key attributes in the corresponding EO.
    None of the above helped and I keep getting RowInconsistentException JBO-25014
    Please help me resolve this issue.
    Thanks in advance,
    Abhinav
    [email protected]

    ok, check this link http://matt-shanto.blogspot.in/2012/09/oraclejborowinconsistentexception-jbo.html whether it helps..
    ~Abhijit

  • Revive removed row

    Hi,
    Is there a way to revive a removed row from a ViewObject? E.g. if we remove a row from a certain ViewObject using row.remove() and then commit these changes we sometimes get a SQL exception because other rows still reference the row. We could do a rollback but that mean's rollbacking all views in the application module, it would be nice if we could simply revive the row. We tried row.refresh(REFRESH_UNDO_CHANGES), row.setNewRowState(STATUS_INITIALIZED) but we always get a oracle.jbo.DeadViewRowAccessException when doing that.
    Regards,
    Peter

    Good idea, I'd like to see something like this as well.
    In the mean time I implemented some pre-delete checks in a JUNavigationBar sub-class, which tries to make sure it's safe to delete some master row (by checking associated viewlinks). Of course this does not always work well, but it helps just a bit.

  • BC4J - how to remove invalid Row from ViewObject

    See the simplified code below. I want to insert a number of records in a table in one transaction. For every insert any occuring error is handled (stored) and after all inserts the errors are reported.
    private void insert(ViewObject vo, int id, String flag) {
    try {
    Row row = vo.createRow();
    row.setAttribute("Id", new Integer(id));
    row.setAttribute("Flag", flag);
    vo.insertRow(row);
    appMod.getTransaction().postChanges();
    catch (JboException exc) {
    handleError(exc);
    // appMod.getTransaction().rollback();
    So when inserting 3 records as below:
    insert(vo, 1, "A");
    insert(vo, 2 ,"BB");
    insert(vo, 3, "C");
    a "JBO-27010: Attribute set with value BB for Flag in Testtab has invalid precision/scale" exception will occur in the second record on the statement row.setAttribute("Flag", flag); as the Flag attribute is a varchar2(1). When the 3rd record gets inserted still an error occurs. It seems that the 2nd record is still cached somewhere; it's not been inserted into the ViewObject (from using the debugger I get the impression it's in the Entity object cache). BC4J tries to insert the 2nd row, that only has an Id attribute and no Flag attribute which is defined not null. So the 3rd record which is ok doesn't get inserted....
    How can I get rid of the second row ? Doing a rollback when an exception occurs doesn't work because then the first record which is ok is lost.
    Cheers Hans

    It turns out to be pretty simple - row.remove() does the trick.
    If only I'ld look in the right place first time everytime... :P

  • Issue in retrieving all the records from ADF Table with multiple row

    Hi,
    As per my requirement, I need to fill the table with multi selected LOV values and when user clicks on commit, I need to save them to database.
    I am using ADF 11g, Multi select table. Using the below ADD method, I am able to add the records but if user clicks on cancel, I need to remove those from view and clear the table as well.
    But the Issue I am facing is, in my cancel method, always I am getting half of the records. Lets assume table contains 100 records but in my cancel method, I am getting only 50 records.
    Please let me know what is the issue in my source code.
    ADD Method:
    public void insertRecInCMProcessParamVal(String commType, String processType, Number seqNumber){       
    try{
    Row row = this.getCmProcessParamValueView1().createRow();
    row.setAttribute("ParamValue7", commType);
    row.setAttribute("ProcessType", processType);
    row.setAttribute("CreationDate", new Date());
    row.setAttribute("CreatedBy", uid);
    row.setAttribute("ParamValueSeqNum", seqNumber);
    row.setAttribute("ProcessedFlag", "N");
    this.getCmProcessParamValueView1().insertRow(row);
    }catch(Exception e){           
    e.printStackTrace();
    Table Code:
    <af:table value="#{bindings.CmProcessParamValueView11.collectionModel}"
    var="row"
    rows="#{bindings.CmProcessParamValueView11.rangeSize}"
    emptyText="#{bindings.CmProcessParamValueView11.viewable ? 'No data to display.' : 'Access Denied.'}"
    fetchSize="#{bindings.CmProcessParamValueView11.rangeSize}"
    rowBandingInterval="1"
    selectedRowKeys="#{bindings.CmProcessParamValueView11.collectionModel.selectedRow}"
    selectionListener="#{bindings.CmProcessParamValueView11.collectionModel.makeCurrent}"
    rowSelection="multiple"
    binding="#{backingBeanScope.backing_app_RunCalcPage.t1}"
    id="t1" width="100%" inlineStyle="height:100px;" >
    <af:column sortProperty="ParamValue6"
    sortable="true"
    headerText="#{bindings.CmProcessParamValueView11.hints.ParamValue6.label}"
    id="c1" visible="false">
    <af:inputText value="#{row.bindings.ParamValue6.inputValue}"
    label="#{bindings.CmProcessParamValueView11.hints.ParamValue6.label}"
    required="#{bindings.CmProcessParamValueView11.hints.ParamValue6.mandatory}"
    columns="#{bindings.CmProcessParamValueView11.hints.ParamValue6.displayWidth}"
    maximumLength="#{bindings.CmProcessParamValueView11.hints.ParamValue6.precision}"
    shortDesc="#{bindings.CmProcessParamValueView11.hints.ParamValue6.tooltip}"
    id="it3">
    <f:validator binding="#{row.bindings.ParamValue6.validator}"/>
    </af:inputText>
    </af:column>
    <af:column sortProperty="ParamValue7"
    sortable="true"
    headerText="Comm Type"
    id="c2">
    <af:inputText value="#{row.bindings.ParamValue7.inputValue}"
    label="#{bindings.CmProcessParamValueView11.hints.ParamValue7.label}"
    required="#{bindings.CmProcessParamValueView11.hints.ParamValue7.mandatory}"
    columns="#{bindings.CmProcessParamValueView11.hints.ParamValue7.displayWidth}"
    maximumLength="#{bindings.CmProcessParamValueView11.hints.ParamValue7.precision}"
    shortDesc="#{bindings.CmProcessParamValueView11.hints.ParamValue7.tooltip}"
    id="it4">
    <f:validator binding="#{row.bindings.ParamValue7.validator}"/>
    </af:inputText>
    </af:column>
    <af:column sortProperty="ParamValue8"
    sortable="true"
    headerText="#{bindings.CmProcessParamValueView11.hints.ParamValue8.label}"
    id="c3" visible="false">
    <af:inputText value="#{row.bindings.ParamValue8.inputValue}"
    label="#{bindings.CmProcessParamValueView11.hints.ParamValue8.label}"
    required="#{bindings.CmProcessParamValueView11.hints.ParamValue8.mandatory}"
    columns="#{bindings.CmProcessParamValueView11.hints.ParamValue8.displayWidth}"
    maximumLength="#{bindings.CmProcessParamValueView11.hints.ParamValue8.precision}"
    shortDesc="#{bindings.CmProcessParamValueView11.hints.ParamValue8.tooltip}"
    id="it2">
    <f:validator binding="#{row.bindings.ParamValue8.validator}"/>
    </af:inputText>
    </af:column>
    </af:table>
    Backing Bean Code:
    DCBindingContainer dcBindings=(DCBindingContainer)getBindings();
    DCIteratorBinding dcIterator=dcBindings.findIteratorBinding("CmProcessParamValueView1Iterator");
    RowSetIterator rs = dcIterator.getRowSetIterator();
    System.out.println("In Cancel Row Count is : "+ rs.getRowCount());
    if (rs.getRowCount() > 0) {
    Row row = rs.first();
    row.refresh(Row.REFRESH_UNDO_CHANGES);
    row.remove();
    while (rs.hasNext()) {
    int count = rs.getRowCount();
    System.out.println("Count is : "+ count);
    Row row = rs.next();
    System.out.println("Row === "+ row);
    if(row != null){                   
    row.refresh(Row.REFRESH_UNDO_CHANGES);
    row.remove();
    Thanks.

    Issue resolved.
    remove selectionListener and selectedRowKeys....
    code to get all the selectedRows.
    RowSetIterator rs = dcIterator.getRowSetIterator();
    RowKeySet rks = this.t1.getSelectedRowKeys();
    Iterator rksIter = rks.iterator();
    while (rksIter.hasNext()) {
    List l = (List) rksIter.next();
    Key key = (Key)l.get(0);
    Row row = rs.getRow(key);
    Thanks.

  • Right way to delete row before insert

    I create a new row with method of ViewObject.
    Row row = viewObject.createRow();Then I want to delete this row. I found there are 4 methods. Which is the right answer?
    //1.
    row.remove();
    //2.
    row.refresh(Row.REFRESH_REMOVE_NEW_ROWS);
    //3.
    row.refresh(Row.REFRESH_FORGET_NEW_ROWS);
    //4.
    row.removeFromCollection();Thanks,

    Timo, we're having a problem when deleting as you describe, maybe you can offer some advice?
    We have a button to delete a row from an editable table, this is set to immediate=true (obviously the user should be able to skip validation when doing a delete). After deleting, if the user then clicks another button to add a new row, the values from the deleted row show in the new row :(
    If we set immediate=false this seems to fix the problem, but we then get the undesirable side effect that the user has to make sure all the values in the row are correct before it can be deleted (because the validation is firing). The user experience becomes a bit strange.

  • Deleting more than one row at a time

    Hey all,
    Im trying to be able to delete rows from my arraylist and UI table but im getting Index out of bounds exep.
    I think its because of the numbering, like counting through the i in the for loop is making it look at something different.
    Can anyone help?
    Thanks!
    selectedObjects = table.getSelectedRows();
                if (selectedObjects.length != 0)
                   for (int i = 0; i < selectedObjects.length; i++)
                        table.deleteRow(selectedObjects);
    rows.remove(selectedObjects[i]);

    I think its because of the numbering, like counting
    through the i in the for loop is making it look at
    something different.This is exactly correct.
    Personally I would look to see if those objects have a method named "clear" or "removeAll" or something like that, so you don't have to write that loop at all.
    But if you do have to write the loop, write a loop that continuously deletes the last entry until there aren't any more. This logic doesn't have the numbering problems that your code does.

  • Deleting a row from a Parent VO gives NullPointerException

    I am using JDev 11.1.1.2.0
    Deleting a row from a Parent VO gives NullPointerException raised from oracle.jbo.server.EntityImpl.vetoRemoveWithDetails(EntityImpl.java:8214)
    Here is my implementation:
    There are two Entity Objects(Named "Parent" and "Child").
    Both EO are NOT based on a database table. (These are populated from a method in the AM, the method calls a database API that returns an nested array and this array is used to populate the Parent and Child entities)
    All attributes in these entity objects are Non-persistent.
    The View Object "ParentEv" is based on "Parent" EO
    The View Object "ChildEv" is based on "Child" EO
    The View Objects "ParentEv" and "ChildEv" are linked by a view link.
    The Entities "Parent" and"Child" are linked by Entity Association ( as "Composition Association" with "Implement Cascade Delete" checked.)
    I am programatically deleting and populating the View Objects ParentEv and ChildEv from a method in the AM.
    The first time I execute the method in BC Tester, it works fine.
    The second time I execute the method it works fine.
    But on third execution, it gives the below error which seems to be NullPointerException raised from oracle.jbo.server.EntityImpl.vetoRemoveWithDetails(EntityImpl.java:8214)
    I am able to reproduce this in a test case scenario. It always works the first 2 times and fails when the method to delete and populate the VOs is executed a 3rd time.
    If we base the "Parent" and "Child" entities on some dummy database views, it works fine, the problem only occurs when the Entities are NOT based on any table.
    Can someone advise on what could be causing this issue?
    Thanks,
    Mitesh.

    Here's the method that I use in my test case to populate the VOs.
       * This method populates the VOs ParentEv and ChildEv.
       * These VOs are based on EOs Paren and Child, respectively.
       * Before populating the VOs I am deleting any existing rows.
       * The first two times this method is executed, it works fine.
       * The third time this method executes it gives a nullpointerexception raised from
       * oracle.jbo.server.EntityImpl.vetoRemoveWithDetails(EntityImpl.java:8214)
      public void populateMethod(){
        int rowCount = getParentEv().getRowCount();   
        for (int i = 0; i < rowCount; i++) {
             Row row = getParentEv().last();
             if(row!=null)
               row.remove();
        rowCount = getChildEv().getRowCount();
        for (int i = 0; i < rowCount; i++) {
         Row row = getChildEv().last();
         if(row!=null)
           row.remove();
        int k = 0;
        for (int i = 1; i < 5; i++) {   
          ParentEvRowImpl parentEvRow = (ParentEvRowImpl)getParentEv().createRow();
          parentEvRow.setParentPk("Parent " + i);
          parentEvRow.setParentDesc("Parent Desc " + i);
          getParentEv().insertRow(parentEvRow);   
          for (int j = 1; j < 5; j++) {   
         k++;
         ChildEvRowImpl childEvRow = (ChildEvRowImpl)getChildEv().createRow();
         childEvRow.setChildPk("Child " + k);
         childEvRow.setChildDesc("Child Desc " + k);
         getChildEv().insertRow(childEvRow);   
      }==============================================================================
    Here is the Parent.xml for the Parent EO:
    <?xml version="1.0" encoding="UTF-8" ?>
    <!DOCTYPE Entity SYSTEM "jbo_03_01.dtd">
    <!---->
    <Entity
      xmlns="http://xmlns.oracle.com/bc4j"
      Name="Parent"
      Version="11.1.1.55.36"
      AliasName="Parent"
      BindingStyle="OracleName"
      UseGlueCode="false"
      RowClass="oracle.jbo.server.EntityImpl"
      DefClass="oracle.jbo.server.EntityDefImpl"
      CollClass="oracle.jbo.server.EntityCache">
      <DesignTime>
        <AttrArray Name="_publishEvents"/>
      </DesignTime>
      <Attribute
        Name="ParentPk"
        IsQueriable="false"
        IsPersistent="false"
        ColumnName="PARENTPK"
        SQLType="VARCHAR"
        Type="java.lang.String"
        ColumnType="$none$"
        PrimaryKey="true"/>
      <Attribute
        Name="ParentDesc"
        IsQueriable="false"
        IsPersistent="false"
        ColumnName="$none$"
        SQLType="VARCHAR"
        Type="java.lang.String"
        ColumnType="$none$"/>
      <AccessorAttribute
        Name="Child"
        Association="model.eo.ea.ChildParentAssoc"
        AssociationEnd="model.eo.ea.ChildParentAssoc.Child"
        AssociationOtherEnd="model.eo.ea.ChildParentAssoc.Parent"
        Type="oracle.jbo.RowIterator"
        IsUpdateable="false"/>
    </Entity>==============================================================================
    Here is the Child.xml for the Child EO:
    <?xml version="1.0" encoding="UTF-8" ?>
    <!DOCTYPE Entity SYSTEM "jbo_03_01.dtd">
    <!---->
    <Entity
      xmlns="http://xmlns.oracle.com/bc4j"
      Name="Child"
      Version="11.1.1.55.36"
      AliasName="Child"
      BindingStyle="OracleName"
      UseGlueCode="false">
      <DesignTime>
        <AttrArray Name="_publishEvents"/>
      </DesignTime>
      <Attribute
        Name="ChildPk"
        IsUpdateable="while_insert"
        IsQueriable="false"
        IsPersistent="false"
        IsNotNull="true"
        ColumnName="CHILDPK"
        SQLType="VARCHAR"
        Type="java.lang.String"
        ColumnType="$none$"
        PrimaryKey="true"/>
      <Attribute
        Name="ChildDesc"
        IsQueriable="false"
        IsPersistent="false"
        ColumnName="$none$"
        SQLType="VARCHAR"
        Type="java.lang.String"
        ColumnType="$none$"/>
      <Attribute
        Name="ParentPk"
        IsQueriable="false"
        IsPersistent="false"
        IsNotNull="true"
        ColumnName="$none$"
        SQLType="VARCHAR"
        Type="java.lang.String"
        ColumnType="$none$"/>
    </Entity>==============================================================================
    Here is the ChildParentAssoc.xml for the Association between Parent and Child EOs:
    <?xml version="1.0" encoding="UTF-8" ?>
    <!DOCTYPE Association SYSTEM "jbo_03_01.dtd">
    <!---->
    <Association
      xmlns="http://xmlns.oracle.com/bc4j"
      Name="ChildParentAssoc"
      Version="11.1.1.55.36">
      <DesignTime>
        <Attr Name="_isCodegen" Value="true"/>
      </DesignTime>
      <AssociationEnd
        Name="Parent"
        Cardinality="1"
        Source="true"
        Owner="model.eo.Parent"
        DeleteContainee="true"
        LockLevel="NONE"
        ExposedAccessor="false">
        <DesignTime>
          <Attr Name="_aggregation" Value="0"/>
          <Attr Name="_finderName" Value="Parent"/>
          <Attr Name="_isUpdateable" Value="true"/>
          <Attr Name="_minCardinality" Value="1"/>
        </DesignTime>
        <AttrArray Name="Attributes">
          <Item Value="model.eo.Parent.ParentPk"/>
        </AttrArray>
      </AssociationEnd>
      <AssociationEnd
        Name="Child"
        Cardinality="-1"
        Owner="model.eo.Child"
        HasOwner="true">
        <DesignTime>
          <Attr Name="_aggregation" Value="0"/>
          <Attr Name="_finderName" Value="Child"/>
          <Attr Name="_isUpdateable" Value="true"/>
        </DesignTime>
        <AttrArray Name="Attributes">
          <Item Value="model.eo.Child.ParentPk"/>
        </AttrArray>
      </AssociationEnd>
    </Association>==============================================================================
    Here is the ParentEv.xml for the ParentEv VO:
    <?xml version="1.0" encoding="UTF-8" ?>
    <!DOCTYPE ViewObject SYSTEM "jbo_03_01.dtd">
    <!---->
    <ViewObject
      xmlns="http://xmlns.oracle.com/bc4j"
      Name="ParentEv"
      Version="11.1.1.55.36"
      BindingStyle="OracleName"
      CustomQuery="true"
      RowClass="model.vo.ev.ParentEvRowImpl"
      ComponentClass="model.vo.ev.ParentEvImpl"
      PageIterMode="Full"
      UseGlueCode="false">
      <DesignTime>
        <Attr Name="_codeGenFlag2" Value="Access|Coll"/>
        <Attr Name="_isExpertMode" Value="true"/>
        <Attr Name="_isCodegen" Value="true"/>
      </DesignTime>
      <EntityUsage
        Name="Parent"
        Entity="model.eo.Parent"/>
      <ViewAttribute
        Name="ParentDesc"
        IsSelected="false"
        IsQueriable="false"
        IsPersistent="false"
        PrecisionRule="true"
        Precision="255"
        EntityAttrName="ParentDesc"
        EntityUsage="Parent"
        AliasName="PARENTDESC"/>
      <ViewAttribute
        Name="ParentPk"
        IsQueriable="false"
        IsPersistent="false"
        PrecisionRule="true"
        EntityAttrName="ParentPk"
        EntityUsage="Parent"/>
      <ViewLinkAccessor
        Name="ChildEv"
        ViewLink="model.vo.vl.ChildEvParentEvVl"
        Type="oracle.jbo.RowIterator"
        IsUpdateable="false"/>
    </ViewObject>==============================================================================
    Here is the ChildEv.xml for the ChildEv VO:
    <?xml version="1.0" encoding="UTF-8" ?>
    <!DOCTYPE ViewObject SYSTEM "jbo_03_01.dtd">
    <!---->
    <ViewObject
      xmlns="http://xmlns.oracle.com/bc4j"
      Name="ChildEv"
      Version="11.1.1.55.36"
      BindingStyle="OracleName"
      CustomQuery="true"
      RowClass="model.vo.ev.ChildEvRowImpl"
      ComponentClass="model.vo.ev.ChildEvImpl"
      PageIterMode="Full"
      UseGlueCode="false">
      <DesignTime>
        <Attr Name="_codeGenFlag2" Value="Access|Coll"/>
        <Attr Name="_isExpertMode" Value="true"/>
        <Attr Name="_isCodegen" Value="true"/>
      </DesignTime>
      <EntityUsage
        Name="Child"
        Entity="model.eo.Child"/>
      <ViewAttribute
        Name="ChildDesc"
        IsSelected="false"
        IsQueriable="false"
        IsPersistent="false"
        PrecisionRule="true"
        Precision="255"
        EntityAttrName="ChildDesc"
        EntityUsage="Child"
        AliasName="CHILDDESC"/>
      <ViewAttribute
        Name="ChildPk"
        IsUpdateable="while_insert"
        IsQueriable="false"
        IsPersistent="false"
        IsNotNull="true"
        PrecisionRule="true"
        EntityAttrName="ChildPk"
        EntityUsage="Child"/>
      <ViewAttribute
        Name="ParentPk"
        IsQueriable="false"
        IsPersistent="false"
        IsNotNull="true"
        PrecisionRule="true"
        EntityAttrName="ParentPk"
        EntityUsage="Child"/>
    </ViewObject>==============================================================================
    Here is the ChildEvParentEvVl.xml for the view link between ParentEv and ChildEv VOs:
    <?xml version="1.0" encoding="UTF-8" ?>
    <!DOCTYPE ViewLink SYSTEM "jbo_03_01.dtd">
    <!---->
    <ViewLink
      xmlns="http://xmlns.oracle.com/bc4j"
      Name="ChildEvParentEvVl"
      Version="11.1.1.55.36">
      <DesignTime>
        <Attr Name="_isCodegen" Value="true"/>
      </DesignTime>
      <ViewLinkDefEnd
        Name="ParentEv"
        Cardinality="1"
        Owner="model.vo.ev.ParentEv"
        Source="true">
        <DesignTime>
          <Attr Name="_finderName" Value="ParentEv"/>
          <Attr Name="_isUpdateable" Value="true"/>
        </DesignTime>
        <AttrArray Name="Attributes">
          <Item Value="model.vo.ev.ParentEv.ParentPk"/>
        </AttrArray>
      </ViewLinkDefEnd>
      <ViewLinkDefEnd
        Name="ChildEv"
        Cardinality="-1"
        Owner="model.vo.ev.ChildEv">
        <DesignTime>
          <Attr Name="_finderName" Value="ChildEv"/>
          <Attr Name="_isUpdateable" Value="true"/>
        </DesignTime>
        <AttrArray Name="Attributes">
          <Item Value="model.vo.ev.ChildEv.ParentPk"/>
        </AttrArray>
      </ViewLinkDefEnd>
    </ViewLink>

  • Advanced Table delete empty rows

    Hi
    I added logic to add 10 empty rows and to delete the empty rows when the form is submitted. But somehow it only deletes the rows in current screen of the Advanced Table. if there are 15 rows and I click next to go the last 5 and submit the form it deletes only the 5 empty rows but not the other 10 rows in the previous section.
    where am I doing wrong?
    Thanks
        Row [] row = null;
        ExpAttendeesVORowImpl rowi = null;
        if( expattendeesvoimpl1 != null )
            row = expattendeesvoimpl1.getAllRowsInRange();
            System.out.println("No of items "+row.length);
        for (int i=0;i<row.length;i++)
             pageContext.writeDiagnostics(this, "in loop ", 2);
             rowi = (ExpAttendeesVORowImpl)row;
    pageContext.writeDiagnostics(this, " in loop row "+ rowi.getName(), 2);
    if((rowi.getName() == null))
    pageContext.writeDiagnostics(this, "deleting row"+ rowi.getName(), 2) ;
    rowi.remove();
    Thanks

    you could instead try using:
    expattendeesvoimpl1.getFilteredRows("Name", null);

  • Delete a row in a table

    Hi,
    My requirement in OAF is to delete a row in a table if the row doesn't have mapping to another table.
    If there is a mapping then the row must not be deleted.
    I have created two VO and formed two ROW.
    While using my code if there exists a mapping for a row in two tables, then the row doesnt get deleted.
    But i want to DELETE when there exists no reference in second table.
    The Code used in AM is
    *public void deleteOU(String ReferenceId1) {*
    OAViewObject VOB=getBLTARBOUMAPEOView1();
    Row row=VOB.getCurrentRow();
    Boolean flag=false;
    *while(row!=null) {*
    OAViewObject VOB1=getBLTINVMAPVO1();
    Row row1=VOB1.first();
    *while(row1!=null) {*
    *if((row1.getAttribute("OuReffId").equals(ReferenceId1))){*
    flag=true;
    throw new OAException("Can't delete because Inventory is Assigned for this Operating Unit",OAException.ERROR);
    *else{*
    row1=VOB1.next();
    *if(flag==false){*
    System.out.println("Remove");
    row.remove();
    Ex:
    Table1
    ReferenceId OU
    1 ABC
    2 DEF
    Table2
    ReferenceId OUID
    2 567
    In the example my code must not allow to delete the 2nd ReferenceId in Table 1.
    Please advice.
    Thanks in Advance,
    Jegan

    Hi,
    I have modified the Query, now the row deletes the next row in the table.
    For ex:
    If i click 1st row second row is deleted.
    *public void deleteOU(String ReferenceId1) {*
    OAViewObject VOB=getBLTARBOUMAPEOView1();
    Row row=VOB.getCurrentRow();
    Boolean flag=false;
    *while(row!=null) {*
    System.out.println(ReferenceId1);
    OAViewObject VOB1=getBLTINVMAPVO1();
    Row row1=VOB1.first();
    *while(row1!=null) {*
    *if((row1.getAttribute("OuReffId").equals(ReferenceId1))){*
    flag=true;
    throw new OAException("Can't delete because Inventory is Assigned for this Operating Unit",OAException.ERROR);
    *else{*
    row1=VOB1.next();
    *if(row1==null){*
    row.remove();
    *//getOADBTransaction().commit();*
    throw new OAException("Deleted Successfully",OAException.CONFIRMATION);
    Please help to solve this issue.

  • Can't delete row

    Hi,
    i am trying to implement page 664 of dev guide which is delete row of table.
    My page shows the data of one row.
    I added a delete submitbutton to my page.
    Here is my code :
    int idi = Integer.parseInt(id.toString());
    XxVOImpl vo = getXxVO1();
    XxVORowImpl row = null;
    int fetchedRowCount = vo.getFetchedRowCount();
    boolean rowFound = false;
    RowSetIterator deleteIter = vo.createRowSetIterator("deleteIter");
    if (fetchedRowCount > 0)
    deleteIter.setRangeStart(0);
    deleteIter.setRangeSize(fetchedRowCount);
    for (int i = 0; i < fetchedRowCount; i++)
    row = (XxVORowImpl)deleteIter.getRowAtRangeIndex(i);
    oracle.jbo.domain.Number primaryKey = row.getId();
    if (primaryKey.compareTo(idi) == 0)
    row.remove();
    rowFound = true;
    getTransaction().commit();
    break;
    deleteIter.closeRowSetIterator();
    my problem is that fetchedRowCount is 0. But there are about 100 rows in my table.
    And my VO is just a simple select * from mytable.
    So i do not understand why fetchedRowCount is still 0 ?
    Help thanks
    Dan

    Dan
    You need to create a dialog page with yes no button when you click on delete icon. Please refer dev guide for dialog page or you ma refer below code snippet that you may need to change little bit
       else if ("delete".equals(pageContext.getParameter(EVENT_PARAM)))
    // The user has clicked a "Delete" icon so we want to display a "Warning"
    // dialog asking if she really wants to delete the employee. Note that we
    // configure the dialog so that pressing the "Yes" button submits to
    // this page so we can handle the action in this processFormRequest( ) method.
    String employeeNumber = pageContext.getParameter("empNum");
    String employeeName = pageContext.getParameter("empName");
    MessageToken[] tokens = { new MessageToken("EMP_NAME", employeeName)};
    OAException mainMessage = new OAException("AK",
    "FWK_TBX_T_EMP_DELETE_WARN", tokens);
    // Note that even though we're going to make our Yes/No buttons submit a
    // form, we still need some non-null value in the constructor's Yes/No
    // URL parameters for the buttons to render, so we just pass empty
    // Strings for this.
    OADialogPage dialogPage = new OADialogPage(OAException.WARNING,
    mainMessage, null, "", "");
    // Always use Message Dictionary for any Strings you want to display.
    String yes = pageContext.getMessage("AK", "FWK_TBX_T_YES", null);
    String no = pageContext.getMessage("AK", "FWK_TBX_T_NO", null);
    // We set this value so the code that handles this button press is
    // descriptive.
    dialogPage.setOkButtonItemName("DeleteYesButton");
    // The following configures the Yes/No buttons to be submit buttons,
    // and makes sure that we handle the form submit in the originating
    // page (the "Employee" summary) so we can handle the "Yes"
    // button selection in this controller.
    dialogPage.setOkButtonToPost(true);
    dialogPage.setNoButtonToPost(true);
    dialogPage.setPostToCallingPage(true);
    // Now set our Yes/No labels instead of the default OK/Cancel.
    dialogPage.setOkButtonLabel(yes);
    dialogPage.setNoButtonLabel(no);
    // We need to keep hold of the employeeNumber, and the OADialogPage gives us a
    // convenient means of doing this. Note that the use of the Hashtable is
    // really more appropriate for passing multiple parameters, but we've used
    // it here for illustration purposes. See the OADialogPage javadoc for an
    // alternative when dealing with a single parameter.
    java.util.Hashtable formParams = new java.util.Hashtable(1);
    formParams.put("empNum", employeeNumber);
    formParams.put("empName", employeeName);
    dialogPage.setFormParameters(formParams);
    pageContext.redirectToDialogPage(dialogPage);
    else if (pageContext.getParameter("DeleteYesButton") != null)
    // User has confirmed that she wants to delete this employee.
    // Invoke a method on the AM to set the current row in the VO and
    // call remove() on this row.
    String employeeNumber = pageContext.getParameter("empNum");
    String employeeName = pageContext.getParameter("empName");
    Serializable[] parameters = { employeeNumber };
    OAApplicationModule am = pageContext.getApplicationModule(webBean);
    am.invokeMethod("deleteEmployee", parameters);
    // Now, redisplay the page with a confirmation message at the top. Note
    // that the deleteEmployee() method in the AM commits, and our code
    // won't get this far if any exceptions are thrown.
    MessageToken[] tokens = { new MessageToken("EMP_NAME", employeeName) };
    OAException message = new OAException("AK",
    "FWK_TBX_T_EMP_DELETE_CONFIRM", tokens, OAException.CONFIRMATION, null);
    pageContext.putDialogMessage(message);
    }Thanks
    AJ

Maybe you are looking for