Handling deletions from vo via service method - how?

If you create a hyperlink to delete a row (from a grid), i.e.
    <a href="MyPage.do?event=RemoveNew&Arg0=<c:out value='${Row.rowKeyStr}' />">Remove</a>
What do you do with this Row Key String? I'm reluctant to use a value (such as a PK ID#) as I like the transparency of the key string, and wouldn't really want the user issuing a URL and just changing the pk value and removing something else.
So, do I:
a) pass this rowKeyString to the service method, which I can't see how I can even look up anything in an appmodule based on a rowkeystring, I really need a oracle.jbo.Key, but creating a Key from a string is deprecated
public void onRemoveNew( DataActionContext ctx )
       log.info(userName(ctx) + "onRemoveNew **** - START");
       try
          // grab rowKeyStr from from end hyperlink (Arg0)       
          String strRowKey = ctx.getHttpServletRequest().getParameter("Arg0");      
          AppModule am = getAppModule(ctx);
          am.removeRowbyRowKeyStr( strRowKey );
       catch ( JboException jex )
         au.logException( jex, log );
         throw jex;
       log.info(userName(ctx) + "onRemoveNew **** - END");
    } // onRemoveNewthe backend service method "stub" for now:
public void removeRowbyRowKeyStr( String rowKeyStr )
    log.info(userName(ctx) + "removeRowbyRowKeyStr**** - START");
    // Since no navigation took place on front end, first let's find this row
    // what do I do with this rowKeyString
    // deprecated:    Key k = new Key( rowKeyStr );
    ViewObject vo = findMyViewObject();
    try
         Key k = new Key ( rowKeyStr, vo.getKeyAttributeDefs() );
         // proceed from here...
    catch ( Exception ex )
          au.logException( ex, log );
    log.info(userName(ctx) + "removeRowbyRowKeyStr**** - END");
} // removeRowbyRowKeyStrb) issue the setcurrentrow in the front-end to get to the correct grid row, grab the pk column# of this row, then call the service method
c) something altogether different than these ideas that escapes me right now, but is the preferred/best practice
Thanks!

You can use JboUtil.getRowFromKey(RowSetIterator rsi, String skey) to do the job.
You can pass any ViewObject, RowSet, or RowSetIterator to the first argument, and your string key to the second argument.
Out of curiosity, it's source code looks like this:
   static public Row getRowFromKey(RowSetIterator rsi, String sKey)
      Key key;
      try
         key = new Key(sKey, rsi.getRowSet().getViewObject().getKeyAttributeDefs());
      catch (Exception ex)
         ex.printStackTrace();
         return null;
      Row rows[] = rsi.findByKey(key,1);
      if (rows.length <= 0)
         return null;
      return rows[0];
   }

Similar Messages

  • I accidentally deleted a folder of music from iTunes.  I have Match, and now it seems deleted from all my devices.  How can I get it back?

    I accidentally deleted a folder of music from iTunes.  I have Match, and now it seems deleted from all my devices.  How can I get it back?

    Were you in iTunes or the Finder? If you were in iTunes what exactly did you click? You say "a folder" but the only "folders" in iTunes contain Playlists and deleting a playlist will not delete tracks from the iTunes library.
    When you deleted the music were you prompted to delete the tracks from the cloud? If so, did you do so?
    Were you prompted to move the files to the Trash. If so did you do so? If you did have you emptied the Trash?

  • I used my appleid on my husband's phone.  Our contacts merged and our phones both ring and he sees my texts. I deleted his contacts from my phone and they deleted from his phone also.  How can I get my appleid off his phone and restore his contacts?

    I used my appleid on my husband's phone.  Our contacts merged, both phones ring and he sees my texts.  I deleted his contacts from my phone and they deleted from his phone also. How can I get my appleid off his phone and retrieve his contacts?

    Teacher48 wrote:
    I used my appleid on my husband's phone.  Our contacts merged, both phones ring and he sees my texts.  I deleted his contacts from my phone and they deleted from his phone also. How can I get my appleid off his phone and retrieve his contacts?
    Bad mistake. You shouldn't have used your Apple ID on his phone. And you made it worse because now the contacts are gone, as you deleted them from your phone, they got deleted on iCloud. Your husband should have his Apple ID.
    There is really no way of recovering the deleted contacts unless you backed up using iTunes and even then you will only be able to recover those contacts that were on a call list. Read here:
    iTunes: About iOS backups

  • HT204408 Can I delete files in "All My Files" under Finder and Favorites without deleting them in the actual folders?  If they will be deleted from the original folders then how do I put them on the external hard drive to save the documents, photos, and v

    Can I delete files in "All My Files" under Finder and Favorites without deleting them in the actual folders?  If they will be deleted from the original folders then how do I put them on the external hard drive to save the documents, photos, and videos?

    Switch to the Finder app and open its preferences.
    Remove the check mark on the items you don't want displayed in the Sidebar tab.
    The originals are not removed from the machine.

  • If I delete any message from email account it gets deleted from thunderbird as well so how can i keep back up

    If I delete any message from email account it gets deleted from thunder bird as well so how can i keep back up

    either use the pop protocol to get your mails, or move mail into a "local Folder" from your mail account and it will delete on the server as well as from the account in Thunderbird.

  • I want to look at a text I haven't deleted from about 7 months ago, how do I do this without pressing "load earlier" over and over?

    I am trying to remember the reason behind something that happened around November and cannot for the life of me do so! Is there a way to retrieve a text I never deleted from this time without scrolling up and loading earlier messages over and over for hours on end?

    Okay. Awesome! I feel like such a dodo that was so freaking simple!
    Now I have another simple person question that feels stupid too but oh well apparently my brain doesn't like to work at 5 a.m. when I am in bad pain but...
    Okay, so I've deleted them from my phone manually, they are already ALL on my mac, when I plug my phone back into my mac to sync music and any New photos, will the old photos that I deleted that are on the mac, go back on the phone? Der. I feel like I already know the answer, but I'm asking anyways...
    Please, thank you, and sorry in advance!

  • I have two iphones and the two got sync'd contacts were deleted from 1 phone and now were deleted from other via wireless on icloud the last back up was 2 months ago how do i retrieve and reinstall that backup? or can I do this from an old icloud back up

    Hi this is my first time using this service and I am having a huge problem with two of my iphones. I have two phones that were sync'd accidently on itunes and both were sync'd to icloud too apparently. The one phone then deleted some of the contacts - now both phones have lost those contacts. What would be the steps to get the phone contacts (not from the computer) back on one of the iphones. it does show the phone was backed up over two months ago - can I restore to that back up and how? Any help would be very appreciated <")))><

    Please read before going through with this procedure.
    If you really want your contact back and you did not do another iCloud backap since you deleted some of your contacts, you can do a hard reboot on both devices with iClouded contacts by holding down the home and lock buttons on each of them for 10 seconds ignoring the slide to turn off thing. Make sure you have iCloud contact services off before doing so. You can then go through the whole set up process until you get up to the backup part. You then press to restore from an iCloud backup (make sure you choose the right backup for the right phone). If you didn't make an iCloud backup before the contact incident, you will have to use your two-month-old iTunes backups. Each phone should have their contacts the way they were from your last backup. You then go into Settings>iCloud>and turn off contacts. You then can choose if you want to keep your current contacts or not. Turn this off on both phones just incase you add another iCloud device to the mix later on. Now your contact lists are no longer linked (Caution: side effect may include lack of edit button). You may now add and delete contacts as you please without it happening on your other phone.
    Thank you for choosing Apple.

  • Handling result ciontaining xml nodes from  c# web service method call in flex

    I have read a article headed: Handling results as XML with
    the e4x result format
    Using this I have build a test application.But facing lot of
    problems.
    Here are the details of my code.I have used first example of
    using namespace.
    private namespace tempNamespace = "TEST1.WebServices";
    use namespace tempNamespace;
    I have specified result type as 'e4x' :
    <mx:WebService id="myTestService" showBusyCursor="true"
    wsdl="
    http://localhost/TEST/TestFlexWS.asmx?WSDL"
    useProxy="false">
    <mx:operation name="HelloWorldEx" resultFormat="e4x"
    result="Hello_Result_New(event);"
    fault="Hello_fault_New(event);">
    <mx:request>
    <strProductName>Test</strProductName>
    </mx:request>
    </mx:operation>
    </mx:WebService>
    In result handler:
    o/p of myTestService.HelloWorldEx.lastResult is:
    <HelloWorldExResponse xmlns:xsi="
    http://www.w3.org/2001/XMLSchema-instance"
    xmlns:xsd="
    http://www.w3.org/2001/XMLSchema"
    xmlns="TEST1.WebServices" xmlns:soap="
    http://schemas.xmlsoap.org/soap/envelope/">
    <HelloWorldExResult>&lt;PRODUCTCOLLECTION&gt;
    &lt;PRODUCT&gt;
    &lt;PRODUCTNAME&gt;Test Product
    121&lt;/PRODUCTNAME&gt;
    &lt;/PRODUCT&gt;&lt;/PRODUCTCOLLECTION&gt;</HelloWorldExResult>
    <TestResult></TestResult>
    </HelloWorldExResponse>
    When I display alert for :
    Alert.show(
    myTestService.HelloWorldEx.lastResult.HelloWorldExResult);
    It's showing me result as:
    <PRODUCTCOLLECTION>
    <PRODUCT>
    <PRODUCTNAME>NEW DAM</PRODUCTNAME>
    </PRODUCT>
    </PRODUCTCOLLECTION>
    But when I display alert for inner node it doesn't show me
    anything:
    Alert.show(
    myTestService.HelloWorldEx.lastResult.HelloWorldExResult.PRODUCTCOLLECTION.PRODUCT.PRODUC TNAME);
    Can anybody help me out?
    It will be gr8 help for me.

    I have read a article headed: Handling results as XML with
    the e4x result format
    Using this I have build a test application.But facing lot of
    problems.
    Here are the details of my code.I have used first example of
    using namespace.
    private namespace tempNamespace = "TEST1.WebServices";
    use namespace tempNamespace;
    I have specified result type as 'e4x' :
    <mx:WebService id="myTestService" showBusyCursor="true"
    wsdl="
    http://localhost/TEST/TestFlexWS.asmx?WSDL"
    useProxy="false">
    <mx:operation name="HelloWorldEx" resultFormat="e4x"
    result="Hello_Result_New(event);"
    fault="Hello_fault_New(event);">
    <mx:request>
    <strProductName>Test</strProductName>
    </mx:request>
    </mx:operation>
    </mx:WebService>
    In result handler:
    o/p of myTestService.HelloWorldEx.lastResult is:
    <HelloWorldExResponse xmlns:xsi="
    http://www.w3.org/2001/XMLSchema-instance"
    xmlns:xsd="
    http://www.w3.org/2001/XMLSchema"
    xmlns="TEST1.WebServices" xmlns:soap="
    http://schemas.xmlsoap.org/soap/envelope/">
    <HelloWorldExResult>&lt;PRODUCTCOLLECTION&gt;
    &lt;PRODUCT&gt;
    &lt;PRODUCTNAME&gt;Test Product
    121&lt;/PRODUCTNAME&gt;
    &lt;/PRODUCT&gt;&lt;/PRODUCTCOLLECTION&gt;</HelloWorldExResult>
    <TestResult></TestResult>
    </HelloWorldExResponse>
    When I display alert for :
    Alert.show(
    myTestService.HelloWorldEx.lastResult.HelloWorldExResult);
    It's showing me result as:
    <PRODUCTCOLLECTION>
    <PRODUCT>
    <PRODUCTNAME>NEW DAM</PRODUCTNAME>
    </PRODUCT>
    </PRODUCTCOLLECTION>
    But when I display alert for inner node it doesn't show me
    anything:
    Alert.show(
    myTestService.HelloWorldEx.lastResult.HelloWorldExResult.PRODUCTCOLLECTION.PRODUCT.PRODUC TNAME);
    Can anybody help me out?
    It will be gr8 help for me.

  • Facebook photos will be deleted from iPhoto?  Why and How do I stop it?

    How can I prevent my photos and albums on iPhoto from being deleted on Facebook?
    I am using my iphoto offline and deleting photos but there is a warning about facebook photos wil be deleted as well.
    I don´t want to lose all my photos that I posted while traveling.

    Thaty is the way it works  --  changes in albums posted to Facebook from iPhoto or kept in sync - changes made in either place are reflected in the other
    to avoid this you can change your factboo password and quit using iPhoto to post to Facebook
    You can upload diretly to Facebook using Safari rather that iPhto in the future
    LN

  • I have two iphones sharing the same e-mail and if one deletes an incoming email, it is deleted from the other iphone.  How can I stop that?

    I have two Iphones that share the same email.  we got new 4s phones.  Now if one person checks/deletes email, it does not show up on the other phone
    and it is taken off the server.
    How can I fix that?
    I want it to go to both phones and to remain on the server even if I delete it off my phone.
    Thanks

    You must be using a POP3 account like verizon.net
    using IMAP like gmail will help some of your problem, not all...
    even on IMAP accounts once one person checks the email it will not show as a "new" message anymore... and if deleted it will still be gone from both phones...
    There are settings you can change in the advanced section of the IMAP account settings that designate the phone NOT to delete messages at all as well... thought this is also an option on POP3 account settings too.

  • Music was deleted from my Ipod (5000) songs how do I get it back?

    I had 5000 songs on My Ipod classic. I was trying to down load them to a friend of mine`s library.In the process his songs (500),were downloaded on my Ipod and I lost my songs. when I went back to my library to sync up my Ipod to my songs I got a: "the device is not recognized" error? I got a different download source and when I try and sync up my library to my Ipod it recognizes the songs on the Ipod not in the library. Once the Ipod is disconnected then it recognizes the library. I was told that my songs are still on my Ipod if so great, that should make it easier. If not hoew do I redowm the somgs in my library to the Ipod. Someone please help me. Thank you

    Only if you backed up the iPod before it was deleted. To restore from backup see that topic here:
    iOS: How to back up

  • The contacts icon was deleted from my iPhone 5.  How do I get it back?

    My granddaughter played with my phone and deleted the Contacts icon. The information is still on the phone under Phone.  How do I add the icon back?

    Well, it's impossible to delete Apple's Contact app. Swipe the home screen to the right and type in a search bar for 'CONTACTS' and it should find the app. She may have put it into a folder or it's on page 9/screen. It's there, you may need to do a little searching and that may take time on your part.
    (Apple apps can't be deleted.)

  • After my photo in photo stream exceeded 1000photos, what happen to the old photos? Is it automatically deleted from my photo stream? How do i get it back those photos?

    can anyone help me on this matter?

    Once they're deleted, you can't get them back.  You're supposed to save them before this happens.  To do this, save them to your camera roll (by tapping Edit, tap all the photos, tap Share, tap Save to Camera Roll), then import them to your computer as explained here: http://support.apple.com/kb/HT4083.
    If the missing photo stream photos were in your camera roll when you last backed up, then would be included in the backup.  Restoring the backup should recover them.

  • How to return a service method result to JSF Page w/ request-scope bean?

    From a .jspx page, I call a request-scoped backing bean which in turn calls an AM service method. The AM service method will return an object with multiple values. Based on the results, I will set the navigation case and then call another .jspx page.
    How can I pass the result values from the AM service method to the next .jspx page? Note I will only use request-scoped beans and do not want to use session-scope bean.
    Thanks.

    Ok - I can set a new processScope var in the backing bean and then reference it in the next .jspx page:
    backing bean:
    EL.setBCVal("#{processScope.newcustidhex}", svcresult);
    where EL is utility class
    public static void setBCVal(String expr, Object value) {
    FacesContext fc = FacesContext.getCurrentInstance();
    ValueBinding vb = fc.getApplication().createValueBinding(expr);
    vb.setValue(fc,value);
    return;
    }

  • How do you delete files from iCloud WITHOUT having them deleted from devices?

    I need to delete files from iCloud WITHOUT having those files deleted from all my devices.  How do I do that?

    Just got off the phone with Apple customer service.  It seems there is no around this problem.  Once you use iCloud, you're screwed. The day you decide you don't want to have certain files store in iCloud, but you still want the files accessible on your computer, you have to spend valuable time copying/hiding a set of files on each device, and then re-setting up those same files in each device they way they should be once you delete them out of iCloud.  Same thing if you decide to cancel your lCloud account. 
    No software should have the ability to hijack your data this way.   

Maybe you are looking for

  • Jabber for Windows 9.2.0 on VXC

    I've upgraded to 9.2.0 Jabber for Windows. I was previously on Beta drop 2. Since upgrading to 9.2.0 I've lost all video capability. I've tried this with the Tandberg Precision HD bullet cam and the Logitech C920-C. I am running VXC image 8.7 voice v

  • Memory upgrade on a macbook pro 13 mid 2012

    Hello all, I am a proud owner of a new MBP 13 2012 and the installed memory on it is 4gb. I would like to know if the max memory it supports is 8gb or 16gb. I have seen on this forum both options. The information on the Apple site states that the max

  • How to use prepared statement - For Everyone Help

    public String count() int count = 0; String fetchsize = ""; try Connection conn = getOADBTransaction().getJdbcConnection(); Statement statement = conn.createStatement(); String Query = "select count(*) count from fnd_lookups where lookup_type like 'S

  • Using Skype number as caller ID

    I have a skype number that works great. One question, the phone number people see on their caller i.d. is different than my number. How do I get my skype number to show up on someone's caller i.d.?

  • Notification center "grayed out" and will not open. Any ideas on how to fix?

    I purchased Mountain Lion this morning and updated from Lion. Everything worked smoothly. As I was looking through various new features, I see that Notification Center is "grayed out" and won't let me open it. When I go to System Settings, Notificati