AddAnotherRow of Advanced Table, does not make the new row as current row

Hi OAF Gurus,
Requirement:
When user presses 'AddAnotherRow' button on OAAvancedTable, the new row that gets added should become the current row of the underlying VO of the table.
What’s happening:
When user presses 'AddAnotherRow' button on OAAvancedTable, the new row is not the current Row(VO’s previous current row retains its current status)
What I tried by far
APPROACH #1 - when create row
In VORowImpl - override create and set this new row as current
public void create(AttributeList attributeList)
try
super.create(attributeList);
// PSUDO CODE
am = this.getApplicationModule
vo = am.findViewObject("OAAdvancedTableVO1");
vo.setCurrentRow(this) // this should set the new row to current.
But VO's current row is still the old current row and not this new row.
APPROACH #2 - when insert Row
I thought that AddAnotherRow , internally must be doing a create() then an insert() row on the VO, so i overridden the insertRow(row) of the VO
public void insertRow(Row row)
super.insertRow(row);
this.setCurrentRow(row)
System.out.println("COMMENT insert called .............................................");
But this method is never called by the framework.
***Please help me make the newly created row on the OAAdvancedTable using 'AddAnotherRow' (out of the Box) , as the currentRow of the underlying VO***
Thanks
Chaitanya

Thanks a lot Chris.
I have used your code and it works perfect.
Now I am not using the out-of-the-box AddAnotherRow, as it does not make the newly added Row as 'currentRow' of the VO
I have used the following code by Chris and it solves the issue.
1. Determine the number of already displayed rows on the table
OAAdvancedTableBean tableBean = (OAAdvancedTableBean) webBean.findChildRecursive(tableID);
int rowsDisplayed = tableBean.getNumberOfRowsDisplayed();
replace tableID with the actual value.
2. I have the following routine to create the row and set it as the current row.
OAViewObject viewObject = (OAViewObject) findViewObject(viewObjectName);
int rowCountInRange = viewObject.getRowCountInRange();
Row row = viewObject.createRow();
int insertIndex = rowCountInRange;
if (rowCountInRange == rowsDisplayed) {
insertIndex = rowCountInRange - 1;
viewObject.insertRowAtRangeIndex(insertIndex, row);
viewObject.setCurrentRow(row);
Thanks again all of you for help
Regards
Chaitanya

Similar Messages

  • Advanced Table does not refresh after database level action

    Hi,
    I have a page which has an advanced table. I update the advanced table from the page do some validations, update some DB level columns(also part of advanced table) and see that the changes are saved to the DB but the advanced table does not show the updates done at the DB level.
    I tried clearing the VO Cache and re-executing the VO but still it does not refresh the Advanced table data.
    This is very critical requirement for the client, any inputs will be greatly appreciated.
    Thanks a lot in Advance.
    Here is the code snippet from my CO's processRequest:
    OAApplicationModule am = pageContext.getApplicationModule(webBean);
    OAAdvancedTableBean tblbean = (OAAdvancedTableBean)webBean.findChildRecursive("recasttable");
    if(tblbean!=null)
    tblbean.setRendered(true);
    OAApplicationModule tblam = (OAApplicationModule)am.findApplicationModule("RecastLineAM1");
    tblam.invokeMethod("initQuery");
    tblbean.getTableData();
    Here is my AM - initQuery() code:
    public void initQuery()
    //clearVOCaches("RecastLineEO",true);
    clearVOCaches(null,true);
    getRecastLineVO1().init();
    Here is the VO - init() code:
    public void init()
    System.out.println("****************************executing...");
    OADBTransaction tx = (OADBTransaction) getApplicationModule().getTransaction();
    if (tx.getTransientValue("RECAST_ID") !=null)
    Number recastId = (Number) tx.getTransientValue("RECAST_ID");
    System.out.println("recastId: "+ recastId);
    setWhereClause("RECAST_HDR_ID = :1");
    setWhereClauseParams(null); // Always reset
    setWhereClauseParam(0, recastId);
    executeQuery();
    }

    hi,
    This is how I am calling a DB package. the package does updates on the table. once done I am issueing a commit and requerying the data, however the vo is not getting refreshed.... Can someone point out what am I missing... why is the VO not getting refreshed....
    This is very critical...
    Thanks
    Srini
    public void validateRecast(String respKey)
    OADBTransaction tx = (OADBTransaction)getApplicationModule().getTransaction();
    Number recastId = (Number) tx.getTransientValue("RECAST_ID");
    System.out.println("*********************validateRecast().RecastId: " + recastId);
    OracleCallableStatement ocs = null;
    Connection conn = tx.getJdbcConnection();
    String strOut="", strErr="";
    Number respId = null;
    try
    respId = new Number(respKey);
    catch(Exception e)
    throw new OAException("Invalid Responsibility");
    String stmt = "BEGIN " +
    "GE_RECAST_UTILS_PKG.validate_recast(:1,:2,:3,:4); " +
    "END;";
    try
    ocs = (OracleCallableStatement)conn.prepareCall(stmt);
    ocs.setNUMBER(1,recastId);
    ocs.setNUMBER(2,respId);
    ocs.registerOutParameter(3,OracleTypes.VARCHAR);
    ocs.registerOutParameter(4,OracleTypes.VARCHAR);
    ocs.execute();
    strOut = ocs.getString(3);
    strErr = ocs.getString(4);
    ocs.close();
    System.out.println("Returned with: " + strOut);
    if(strOut.equalsIgnoreCase("ERROR"))
    //throw new OAException(strErr);
    tx.putTransientValue("ERROR",strErr);
    tx.commit();
    getApplicationModule().clearVOCaches("RecastLineEO",true);
    RecastLineVOImpl lineVo = (RecastLineVOImpl)getApplicationModule().findViewObject("RecastLineVO1");
    lineVo.init();
    System.out.println("===============RecastLnId: " +lineVo.first().getAttribute("RecastLnId"));
    System.out.println("===============Product Line: " +lineVo.first().getAttribute("ProductLine"));
    catch(SQLException e)
    tx.rollback();
    if(ocs!=null)
    try
    ocs.close();
    }catch(SQLException e1)
    throw OAException.wrapperException(e1);
    throw OAException.wrapperException(e);
    }

  • InsertRow does not show the inserted row on the view

    hello:
    The code below works well and shows the row on the view when added. However, when there are several existing rows and I have to scroll to next pages. an insert button on that page does not show the new Row at all. Is there a way for me to see the row even if I scroll over to the last page and try an insert?
    ViewObject myVO = this.getMyView();
    Row newRow = myVO.createRow();
    newRow.setAttribute("Id", myId);
    myO.insertRow(newRow);
    Thanks

    Hi,
    I also have problems with code above for inserting a new row.
    When I insert a new row in a table and click on column header (to change sorting), that row (and any other new row before committing) disappears from table. And if I commit that table (without missing row), the missing row reappears with next refresh.
    Selection in that table (using SelectOne component with Autosubmit=true) also doesn't work with new rows (with existing rows it works fine). Selection allways sticks on first inserted row!
    Something weird is happening here...
    Please help.

  • I accidently deleted Safari and now I can't reinstall because it keeps telling me there is a newer version on my computer.  The issue is my system does not support the newer version.  Does anyone know how I can get around this?

    I accidently deleted Safari and now I can't reinstall because it keeps telling me there is a newer version on my computer.  The issue is my system does not support the newer version.  Does anyone know how I can get around this?

    Apple wanted to charge me 50 bucks jsut to talk to someone! 
    I believe you may be referring to the $49 ASL agreement at AppleCare? That is only when/if you are out of AppleCare Protection.
    Can you get to an AppleStore Genius Bar?
    They may be able to fix this for you. No charge.
    I highly doubt that. There is a $70 charge for troubleshooing software issues, EVEN IF there is AppleCare Warranty on the hardware.
    However, since there is no charge for an appointment at a Bar, go make one, and see what options they give you. Let us know how it goes.

  • Lock screen does not support the new panoramic feature in iOS7

    Lock screen does not support the new panoramic feature in iOS7.
    You are supposed to be able to take panoramic photos and then set them as your lock screen background.
    Then you can move your phone around to see the full photo.
    My i5 doesn't !!!!!!!!!!!!!!!!

    I believe this was removed in the later betas of IOS 7. It may make a reappearance in a future update.
    It was mentioned at WWDC when iOS 7 was announced, but there is no mention of it on the Apple website.

  • I have just bought an iPod Nano to replace my previous one which died,when I open my iTunes it does not show the new iPod, and refuses to allow me to sync my existing library, the new iPod does not show in my computer only on devices, any suggestions ?

    Question: I have just bought an iPod Nano to replace my previous one which "died" My computer does not recognize the new iPod and only shows it in devices and printers. I cannot sync my existing iTunes to the new iPod, there is no way I can do it. Any help please?

    Hey there longislandmacca,
    It sounds like your iPod is not recognized in either Explorer, or in iTunes on your PC. That can be frustrating, expecially when its a new device. I recommend you use the following article to help resolve that issue named:
    iPod not recognized in My Computer and in iTunes for Windows
    http://support.apple.com/kb/ts1369
    Thank you for using Apple Support Communities.
    Cheers,
    Sterling

  • How do I transfer music and photos from my Power Mac G5 to my new iMac. Have an old FireWire but it does not fit the new iMac

    I am trying to transfer photos, music, etc from my Power Mac G5 to my new iMac. The Power Mac is too old for the migration assistant to help. I have an old Firewire but it does not fit the new iMac. Any suggestions? If a Firewire is the best option which one do I need? Thanks.

    You need a Firewire 800 to 400 adapter or cable or a external USB 2/3 drive (self powered) it can default to the old USB the G5 uses 1 or 2.
    Format the drive info here.
    Backup and restore info
    https://discussions.apple.com/message/16276201#16276201

  • When I open iWeb it does not "Highlight" the New site or new page options. It ahs had this issue for over a year! I have tried uninstalling and re-installing it. What do I do? It opens the tutorial video, then when you close it, nothing else is clickable.

    When I open iWeb it does not "Highlight" the New site or new page options. It has had this issue for over a year! I have tried uninstalling and re-installing it. What do I do? It opens the tutorial video, then when you close it, nothing else is clickable.

    Open iPhoto, select a couple of photos and use the Share ➙ iWeb ➙ Photo page menu option.  That has jump started iWeb for others.  I could take a couple of tries.
    If that doesn't work try the following:
    1 - delete the iWeb preference file, com.apple.iiWeb.plist, that resides in your
         User/Home()/Library/ Preferences folder.
    2 - delete iWeb's cache file, Cache.db, that is located in your
         User/Home()/Library/Caches/com.apple.iWeb folder. 
    Click to view full size
    3 - launch iWeb and try again.
    OT

  • My iMac does not see the new Toshiba external drive in Finder or Disk Utility.  How can I get it to see the drive?

    My iMac does not see the new Toshiba external drive in Finder or Disk Utility.  How can I get it to see the drive?

    From the menu bar, select
               ▹ System Preferences ▹ Energy Saver ▹ Power Adapter  
    and uncheck the box labeled Put the hard disk(s) to sleep when possible, if it's checked.
    If the drive has more than one interface (USB, FireWire, Thunderbolt, eSATA), try one of the other interfaces.
    Check that the data cable is securely inserted at both ends.
    Try a different cable.
    If you're connecting the drive through a hub, connect it directly to a built-in port on the Mac.
    If you're connecting it directly, try a different port.
    Disconnect all other devices on the bus, or as many as possible.
    Test the drive with another Mac. Test another drive with this Mac.
    If the drive is bus-powered, but has an AC adapter, connect the adapter.
    Start up in Recovery mode and launch Disk Utility. Is the drive recognized?
    Start up in Safe Mode and test.
    Reset the NVRAM.
    Reset the System Management Controller.
    If the drive doesn't work under any of the above conditions, and if another drive does work with the same Mac, then the drive is malfunctioning.

  • I upgrade from LR3 to LR5 and the basic panel is the old format...does not have the new sliders that

    and the basic panel is the old format...does not have the new sliders that were introduced in LR 4. Using Windows 7 if that matters.
    still seeing fill light and recovery instead of shadows and highlights
    thanks
    jp

    You have to change the photo to Process Version 2012.
    Under the histogram in the develop module is a Lightning Bolt icon. Click on it.

  • Hi, I have Lightroom 4, but it does not support the new 10-30 pd lens for my Nikon 1. It is supported in LR5. Can I download this lens profile and install in LR4?

    Hi, I have Lightroom 4, but it does not support the new 10-30 pd lens for my Nikon 1. It is supported in LR5. Can I download this lens profile and install in LR4?

    Do you have the latest camera raw installed for Photoshop? If so, you can find the profiles in /Library/Application\ Support/Adobe/CameraRaw/LensProfiles/1.0/Nikon/ . Lightroom should recognize them if you move them into your home directory's Library folder in the exact same folder structure (but in the Library folder in your home directory). This is assuming you are using Mac OS X. No clue where these files would be on Windows. If you don't have Photoshop, you can install Camera Raw using the combined installer with DNG converter which is a free download from Adobe. This should (I think) give you the profiles in that exact location without owning Photoshop.

  • Laptop does not detect the new HDD

    Good afternoon ladies and gentlemen Gameday! I need help.
    On my laptop broke down the hard drive. According to reports, a lot of bad sectors, SMART. Decided to put a new HDD. Laptop does not see the new hard drive. In the BOOT MENU new hard drive is not detected.
    Old hard drive while still runs in the BOOT menu displays all 3 sections. On the new disk interface is similar to the interface connection on the old disk.
    laptop model: 15-e 051 sr.
    OS: Win 8
    manufacturer of the old hard drive : Hitachi
    new hard drive: seagate.
    New hard drive on another system checked for operability.
    Also, the laptop refused to work with other hard drives: Samsung, Hitachi.
    I am sorry for your Books English. For transfers using Google translator.
    I look forward to qualified support, despite the language barrier.
    Sincerely Sqwosh.

    Hi @sqwosh ,
    Thank you for your query, I will do my utmost to assist you.
    First I would like to let you know that the broken English is not a problem.  I understand that Google translation can be a a little rough in the translations.  We  will work together and I am  sure we will do fine!
    I grasp that you are trying to replace the hard drive but it is not being recognized in the bios.
    Here is a link to the HP Pavilion 15 Notebook PC Maintenance and Service Guide. please note page 57 for a list of supported hard drives.  It will also provide information on removal and replacement of the hard drive.
    You could also try this.
    Once you have the hard installed and connected and you are at the bios screen, you will notice an option to restore defaults along the bottom. ( I believe it is F5) .  This will cause it to scan for the hardware and hopefully find your new hard drive.
    Please do not hesitate to respond if you require further assistance and good luck!
    Sparkles1
    I work on behalf of HP
    Please click “Accept as Solution ” if you feel my post solved your issue, it will help others find the solution.
    Click the “Kudos, Thumbs Up" on the bottom right to say “Thanks” for helping!

  • Procedure Does not return expected new rows unless I ALTER the procedure it self

    Procedure Does not return expected new rows !!!   unless I ALTER the procedure it self

    And what exactly do you alter, the code / where clause / or ...?
    Olaf Helper
    [ Blog] [ Xing] [ MVP]

  • I installed the new version of LIghtroom (2015) from Creative Cloud.  Creative Cloud says I successfully installed the new version.  However, the shortcut icon that was installed does not start the new version.  I've also gone to the properties link itsel

    I installed the new version of LIghtroom (2015) from Creative Cloud.  Creative Cloud says I successfully installed the new version.  However, the shortcut icon that was installed does not start the new version.  I've also gone to the properties link itself but, no success in starting.  How do I launch the new version?

    Thank you, toinimj59.  I did this part and the installation completed (apparently it didn't earlier--included an acceptance of the standard terms and conditions...
    Solution 1: Sign out from Creative Cloud desktop app and sign back in
    Sign out from, and back in to, the Creative Cloud desktop app. Click here for instructions
    Launch Lightroom.

  • I changed my apple id on my computer and my iPad does not recognize the new id

    I changed my Apple id on my computer and my ipad does not recognize the new id and continues to display the old id. How can I get it to change to the new id?

    Easy Fix: On your iPad, go into Settings>Mail,Contacts,Calendars and click on your hotmail account. Simply replace the password that's already there with your new one. Then, I recommend rebooting your iPad:
    To reboot your iPad, hold down the sleep/wake button and the home button simultaneously until the screen goes black and the Apple logo appears. If, during this process, a slider appears on the screen to power it off, ignore it and keep holding the buttons down.
    If you've already tried this, then the next step would be to delet your hotmail account from your iPad (also in Settings>Mail, Contacts, Calendars) and then reboot the iPad and add the account back again.

Maybe you are looking for

  • Need to add a second hard drive. Which model?

    Hello, I would like to add a second hard drive to my G3. My current 12 Gig ATA/133 hard drive is not sufficient anymore for my projects. I would like to choose a SATA hard drive and I need some help with the selection of a model. I am choosing SATA b

  • Command not working

    Hi, Is there a reason why some command doesn't work anymore ? Like : <uitext name="LOGOCLICKURL" value="http://www.mycompanyname.com"/> or <uifont name="FONT_OUTLINE" value="Verdana,11,false,false,true"/> Thanks, Caroline

  • How  encode streaming and publish it to  youtube and livestream in one process ?

    Dears , We  start encode  to  youtube  and another process to livestreeam.com  , that conusmes   much of cpu , I want to configure to start encode to youtube and livestream.com in one process that will minimize CPU consuming for encoding  by 50% Kind

  • Can't open saved project

    Hi, I'm having problems trying to open saved encore projects. I get an error message saying "The player used to create the project could not be found. Defaulting to the Adobe player". When I click OK the program then either freezes or crashes. I'm us

  • Is that possible to remove that "," comma for year.

    Dear All, Please help me how to remove  "," comma for year.in attached analyzer report screen shot.(the year is the formula variable). Regards, shan