InsertRowAtIndex

Hello,
I have a business requirement to add rows in a UIX table that is databound to a BC4J Viewobject. When we press the addRow button in the table, we write the code to do the business logic.
We tried the following 2 approaches
1. insertRow method on the viewobject: This inserts the record before the current row and promptly send the recordadded and navigated events to the table. The table now refreshes after adding the new record. But, the new record is not the last record, but last but one :-(
2. insertRowAtRangeIndex: Here we get the intended behavior. the record is added at the last of the record set. But the table is not sent the events for record addition and navigation. That means, even though the viewobject contains the new record, we do not see the record in the UIX table unless we do an explicit clicking on navigation links( next 20) on the table.
any suggestions ?
Thanks and Regards,
Ramna

Ramna:
Hello,
I have a business requirement to add rows in a UIX
table that is databound to a BC4J Viewobject. When we
press the addRow button in the table, we write the
code to do the business logic.
We tried the following 2 approaches
1. insertRow method on the viewobject: This inserts
the record before the current row and promptly send
the recordadded and navigated events to the table.
The table now refreshes after adding the new record.
But, the new record is not the last record, but last
but one :-(
2. insertRowAtRangeIndex: Here we get the intended
behavior. the record is added at the last of the
record set. But the table is not sent the events for
record addition and navigation. That means, even
though the viewobject contains the new record, we do
not see the record in the UIX table unless we do an
explicit clicking on navigation links( next 20) on
the table.
insertRowAtRangeIndex does fire rowInserted event. It does not change currency ==> You wouldn't get navigated event. Are you saying that the UIX table only refreshes on navigated() event and not on rowInserted() event? That doesn't sound right (I'm not familiar with UIX table, so I would have to defer that question to someone who's familiar with UIX stuff).
BTW, are you using UIX-JSP or UIX-XML?
Thanks.
Sung

Similar Messages

  • Programatically inserting rows of a view object trouble

    Hi,
    I'm using JDev 10.1.3.3. I'm trying to use the application module specific to my app to create rows in a viewobject. User is on page "view", goes to page "new" and fills out a form which upon submit sends the data to an Application Module method I've exposed to the client. What doesn't happen, is when I add the row of the view object programatically in my view object, it doesn't display on the "view" page until a commit is done (when navigating back from the "new" page".
    Here is some sample code of the insert into a composite (not composition) viewobject. When I insert in the new page, it returns to the view page... and the row doesn't show up until commit happens:
    //in my application module
    public void doiIt2(String name, String badge, String item){
    UserItemViewObjRowImpl row = null;
    row = (UserItemViewObjRowImpl)getUserItemViewObj1().createRow();
    row.setBadge(badge);
    row.setBadge1(badge);
    row.setItem(item);
    row.setName(name);
    row.setNewRowState(Row.STATUS_NEW);
    getUserItemViewObj1().insertRow(row);
    getUserItemViewObj1().executeQuery();
    Does anybody know how to get this row to pop in, like using a "creation form" to a table in a view page? What am i doing wrong??? Do I need to do something special in my pagedef of the "view" page?
    Thanks,
    Dan

    Chris,
    Thank you for looking at my problem. The row is not inserted into the table (on the view page) with the code I shared. The criteria for the table's VO is simply a select all, with no where clause, so I don't think I'm excluding it... Upon hitting a commit button, the new row does pop in to the table witch is further evidence that the criteria for the VO isn't excluding the new row.
    I have tried insertRowAtIndex(), even before I posted this with no luck.
    BTW, if I add to the bottom of the code I shared, getDBTransaction().commit; or getDBTransaction().postChanges(), the row does pop into the table when the "view" page is navigated to.
    Am I doing something wrong with my construction of my ViewObject? It is a composition (I got that wrong in my initial post) between two entities. The Item entity is updateable, and not a reference using an association between the two entities on the Badge attribute.
    I am trying to have new composite VO rows always show up as the first item in a table. I've read that the Row.STATUS_NEW will always do this... so I'm trying to avoid posting/committing the new row. I'm also not above inserting at a particular location, but some of the pages I hope to use this pattern with re-execute the VO every time the page is rendered, instead of just rebinding the Iterator with the VO rowsets. I'm being led to believe that if a Row is posted or committed, re-executing the query will resort all rows based on 'order by', etc.
    Also, I have setup a similar yet even more complicated example using three entities. I was able to make this work as expected. The difference is that I was using an ADF Creation Form. ( I did have some work in the model to make all the keys line up though.... posting order... etc.).
    I have gotten similar things like this to work with single entities VOs. I'm just having trouble when I do composite VOs. That is supported, isn't it?
    Dan

  • CreateInsert pushbutton at bottom of table/iterator and linenum

    ENVIRONMENT: 11gR1 / Oracle10g database
    Hi,
    I'm using pushbutton bound to createInsert for a detail iterator. In various pages, I'm using <af:table> or <af:iterator>. In both situations, it adds rows at the top of the top or above the previous row in an <af:iterator>
    Ideally I'd like to add at the bottom.
    I'm wondering how I can do that. I tried making an AM method with something as follows and binding to a button, put it doesn't refresh the page to show the new row.
    peudocode
    newRow = vo.createRow();
    newRow.setAttribute(x,y);
    vo.insertRowAtIndex(vo.getRowCount());Is this the right approach?
    I also have a LineNum attribute that I'd like to autoincrement from 1 to x for every unique key. Using a databse sequence would autoincrement from the last value regardless of a unique key, not start at 1 for each new unique key.
    Thanks in advance.

    After you add a row you can sort and refresh the table in such a way that the new row to appear at the bottom. That depends on the sql query.
    you can use af:table varStatus to have unique number.
    varStatus="vst"
    "#{vst.index}"
    Edited by: puthanampatti on Oct 28, 2009 5:05 PM

Maybe you are looking for

  • Video sync help from BB Z10 to Link - Video won't play on PC

    Please help, I am trying to sync my videos that I recorded on my Z10 to my PC using BB Link.  All of my other media files have been fine and I can view them without issue.  When I go to play a video on Link all I get is the sound, no picture.  I have

  • Process order confirmation reversal

    HI friends, I am cancelling a process order confirmation using T-code CORS. The confirmation cancellation is happening, but the goods movements are not reversed. Help in resolving will be much appreciated. Thanks in advance. Warm regards Vivek

  • Error Register with Shared Services

    Hi, I have a problem while Registering Shared Services in the Configuration Utility. It displays the following error (Jun 23, 2009, 08:56:30 AM), com.hyperion.cis.config.wizard.RunAllTasksWizardAction, ERROR, Error: java.lang.Exception: Adding follow

  • Call to form from class.

    Hello experts, In my class i call to form that exist in another program, when i push click on the form i can't  see the perform in my class, i gave message like this: " Subroutine CL_GET_STOCK_1 not found in Programs  (possibly dynamic calls!)". How

  • Error when resending traps SNMP

    In DFM- Configuration- Other configurations- SNMP trap forwarding, I put two hostnames for notification (see: DFM trap fwd.jpg) The SNMP trap receiving use the default port (see.DFM trap receiving.jpg) And I have a problem with the hostname: 10.78.33