Update as a part of Delete action

Hi,
I'm using Jdev11g, ADF BC and ADF faces RC.
I have a table of records in the UI. In the toolbar I have dragged and dropped Delete method as a button.
What I want to implement is when a user selects a row and clicks Delete button, I dont want the real delete to execute but instead I want to update a column( called 'Status' ) of that row to 'DELETED'.
Also, same time the Delete button click should do a commit. Plz assist.
Thanks,
Anu

Hi,
Here is an approach.
Basically you dont want to delete at all.
1) create a method in your Application Module java class e.g. changeStatusOfViewObjectNameHere()
Inside the method, get the ViewObject you want and get the currentRow.
For this current row, change the attribute value you want with the new value you want
e.g: getVO().getCurrentRow().setAttribute("attnameHere",yourValueHere);
2) expose this method in the client interface of your AM.
3) in your jspx pageDef, create a methodAction in your bindings and point to the previously created method in your AM.
4) in your jspx pageDef, add the commit action as well.
5) In the Delete button, remove the ActionListener that is created by default.
6) In the ActionListener of that button, through the wizard, create a new method in your backing bean ( If the backing bean does not exist, create one).
7) In your backing bean, do the following:
First you need to change the status value of the current row. So, you need to call the AM method already exposed in the bindings:
OperationBinding oper = ADFUtils.getDCBindingContainer().getOperationBinding("*changeStatusOfViewObjectNameHere*");
you can find the ADFUtils in the sample applications in the JDev I think. Or search the Web.
After this call, you have to commit the changes:
So, another OperationBinding should be called:
OperationBinding oper = ADFUtils.getDCBindingContainer().getOperationBinding("*commit*");
make the Delete button to be partialSubmit=false, in order to refresh the whole page.
Hope this will help you.
Regards,
Dimitris.

Similar Messages

  • How to Implement basic Insert ,Update and delete Actions

    Hi all,
              i want to implement 1)INSERT 2)UPDATE 3)DELETE actions in webdynpro application means i have to add a new record to my R/3 backend and update and delete records from my database
    can anyone tell me how to do these actions
    Regards
    Padma N

    Hi Murtuza ,
                           I have 2 views in my application.In the first view i enterd some purchaseorder number and clicked serarch button.The items regarding that purchaseorder gets populated in the table which is in second view.All the data is in R/3 backend system.
    the code i used to get the details of that particular purchaseorder is
    try {
    wdcontext.currentZ_Matrls_For_Inputlement().modelObiect.execte();
    catch(RFCException e){
    /* Catch the Exception Here */
    Here now i want to delete one record of that particular purchaseorder from the database.So Wat should be the code to delete record from R/3 Model
    Regards
    Padma N

  • Toplink "update" descriptor event firing on deletion

    I've got a class for which I've defined actions for the pre-update, pre-insert, and post-delete descriptor events. Strangely, I see that when deleting an instance of this class, my pre-update action is called before the deletion is performed, then my post-delete action is called.
    The ordering makes sense, but I'm wondering why the pre-update event fires at all? When viewing the resulting SQL (by turning on logging), I only see a DELETE statement.
    Any thoughts?
    Mark S

    I assume this happens when you do a straight delete, and that you aren't updating the object before it gets deleted (i.e., sometimes a UOW will modify an object and then some part of the use case deletes it before the UOW commits).
    In any case, I'm sure this was a concious decision and it's the kind of thing you don't want to change because no doubt there are people depending on it behaving that way :)
    If it's turning into a headache (i.e., maybe you do a lot of expensive ops in the event), you might want to experiement with a couple things (I'm just thinking out loud here, not sure if this is a wild goose chase) --
    Try unregistering the object. I.e., if you explicitly do a deleteObject, I think you can unregister the object in the UOW and then the delete will still happen (you might have to tell the UOW to performDeletesFirst though). This definitely won't work if the object is being deleted by de-associating a private relationship though, only if you explicitly call delete...
    - Don

  • I updated to iOS7 and my deleted photos came back.  How do I make sure this doesn't happen again?

    I updated to iOS7 and my deleted photos came back.  How do I make sure this doesn't happen again?  I want to get rid of the ones I already got rid of, but if they just keep coming back that will be a waste of time. 
    Can anyone help?
    When I sync with itunes, the photos sections says I am syncing with my iphone, so I assume that anything I physically delete from my iphone should not be showing up again.  Right?
    Thanks in advance.
    CM
    PS- I don't use iphoto. 

    Is that really how sync works?
    If you read this, http://support.apple.com/kb/ht4236  and this http://support.apple.com/kb/TS1314  they don't actually make how sync works very clear.  I had thought that syncing my device to itunes would allow I tunes to copy what was currently on my phone so that I could restore that information when needed ie if your phone dies and you need to do a clean install of the iOS system, you always have what is currently on your phone saved in Itunes.
    Specifically reading this:
    To delete Camera Roll photos and videos from your device
    There are two methods to delete items from the Camera Roll:
    Import the Camera Roll to your computer and choose to delete items after import.
    Delete photos and videos from your device manually:
    Open the Photos application and open the Camera Roll.
    Tap the Action button.
    Tap each photo to select it.
    Tap the Delete button.
    Note: For photos and videos you want to save, import them to your computer before deleting them from the Camera Roll.
    What you seem to be saying is that iTunes saves every contact, message, photo etc and when you click sync, it reuploads things that you deleted?  This seems like it should work the opposite.  Make a mirror image of my iPhone on my computer, not make a mirror image of my computer onto my iPhone.  You delete things for a reason. 
    Help- anyone else?  Is razmee209 right?

  • Cancel a delete action in a trigger

    Hi,
    I would like to know the best way to cancel a delete in a trigger, I want to instead change a Field called Active to 'N'
    My application is built on views that exclude records with this flag set to 'N'
    I have found the IF DELETING ('id') THEN syntax which should be fine to capture the delete, but what is the best way to then cancel the delete?
    Thanks in advance
    cl3ft

    Hi,
    I don't think you can cancel the delete action in the trigger if you want to perform another action afterwards. You can cancel the delete action by raising an exception (e.g. with RAISE_APPLICATION_ERROR(-20001,'No delete allowed') ;)
    To cancel the delete action and perform an action afterwards I would suggest to create a view on the table containing all columns. On that view, you can define an INSTEAD OF DELETE trigger. In this trigger, simply update the column and do not perform any delete action. This should do the job for you.
    Regards
    Stephan

  • Automatic update of a part of Jsp

    Dear all,
    I was wondering if anybody could give me pointers on the direction for this :
    I need to update my rows displayed in jsp based on updates done to the database.
    Initially I thought I could do this with refreshing the JSP using the Meta tag for every 5 seconds and then having a sql query run for every 5 seconds and compare it with previous results and if the prev.res < new res. then send the data to the jsp. Obviously this is not the right way. I would love to ask for advise on how I should go from here.
    That is just a part of the problem. The bigger picture is , I suppose, I will need to use AJAX so that I can update only a part of the jsp and not reload the entire page.
    I just have no clue how to go from here. Did a lot of google and found something called hotcell for this. Still, I would love to hear back on advises.
    Thanks in advance for your time spent on this.

    Hi, thanks for your reply. I looked at the ajax code in that post.
    attrResponse should be called from my Action class (controller class in my case since am using spring)
    However, this is extremely useful if I am expecting the user to do an input for me.
    I need to figure out if a Query is updating table abc ( I plan to do it this way :
    I will get the table name from all update queries being executed (this I dont know how I will do though), and then after the successfull updation I will execute the select query for the same table) and then return the result set in the attrResponse.
    ultimately this will help in updating rows displayed in jsp based on updates done to the database without the page being refreshed. For ex, if my current Jsp is displaying my total no. of employees, which is 2 then if someone updates the table with a third employee, then the third row gets automatically updated.
    am I taking it up in the correct way ?
    Is there another way to do this ?
    Thanks for your time on this.

  • How to get  log of user's delete action on Content Items?

    Hi all,
    When one user edit a Content Item, we can get the log about this action. But when user delete this content Item, I couldn't find out the log about this action.
    I wonder that WebCenter Content have any function to logging the delete action on Content Items?
    If it have, where I can find it ?
    Thanks a lot!

    If you are strictly interested in just "deletes", you can query the table "DocumentHistory". Basic data like checkin, checkout, update, and delete actions against a document is recorded there, along with the user and date.
    If you need deeper data however, as Srinath noted, Content Tracker is built for those deeper requests.

  • Using a link to trigger a delete action on form page?

    Hello,
    I have been unable to find an explanation about how to do this in the documentation, these forums or the old interakt forums.
    Is it possible to use a link to trigger the delete action on a form page?
    If so how is it done?
    Thanks in advance!

    Sorry Purple.. I know that there is a delete link that triggers the delete transaction on the form page..
    The question was if anybody knew if I am able to use a link to trigger that delete transaction (on the form page), much like a dynamic list has a link that will trigger the delete transaction on the form page.
    I don't want to use a dynamic list in this case though. :)
    Thanks anyways,
    Drew

  • HELP!  I tunes wouldn't update so I tried to delete and reinstall.  I keep getting a message stating the installation source for this product is not available.  Verify that the source exists and that you can access it.  please help!!

    Help!  Itunes wouldn't update so I tried to delet and reinstall.  I keep getting a message: The instillation source for this product is not available.  Verify that the source exists and that you can access it.  I also get this message:  The feature you are trying to use is on a network resource that is unavailable.  Click OK to try again, or enter an alternate path to a folder containing the installation package 'iTunes64.msi' in the box below.  Help I have no idea what that means or how to fix it. 

    (1) Download the Windows Installer CleanUp utility installer file (msicuu2.exe) from the following Major Geeks page (use one of the links under the "DOWNLOAD LOCATIONS" thingy on the Major Geeks page). Here's a screenshot showing the particular links on the page that you should be clicking:
    After clicking one of the circled links, you should be taken to another page, and after a few seconds you should see a download dialog appear for the msicuu2.exe file. Here's a screenshot of what it looks like for me in Firefox:
    Choose to Save the file. If the dialog box does not appear for you, click the link on the page that says "CLICK HERE IF IT DOES NOT". Here's a screenshot of the page with the relevant link circled:
    When the dialog appears, choose to save the file.
    (2) Go to the Downloads area for your Web browser. Doubleclick the msicuu2.exe file and follow the prompts to install the Windows Installer CleanUp utility. (If you're on a Windows Vista or Windows 7 system and you get a Code 800A0046 error message when doubleclicking the msicuu2.exe file, try instead right-clicking on the msicuu2.exe file and selecting "Run as administrator".)
    (3) In your Start menu click All Programs and then click Windows Install Clean Up. The Windows Installer CleanUp utility window appears, listing software that is currently installed on your computer.
    (4) In the list of programs that appears in CleanUp, select any iTunes entries and click "Remove", as per the following screenshot:
    (5) Quit out of CleanUp, restart the PC and try another iTunes install. Does it go through properly this time?

  • Cannot delete the Folder on the desktop after Mavericks update. when I try to delete it, it is asking for logon password, When I give the logon password, it plays a sound of moving to Trash, but the folder still remains on the desktop

    Cannot delete the Folder on the desktop after Mavericks update. when I try to delete it, it is asking for logon password, When I give the logon password, it plays a sound of moving to Trash, but the folder still remains on the desktop
    Please help

    It is a folder which I have created. Name is "SAP".
    I copied some of my office stuff and then deleted the contents inside the folder. But I couldnt delete the folder SAP.
    This is happening after the Mavericks update.

  • I recently update my iTunes and it deleted all my songs. I was able to get some back via iCloud but I can't seem to sync my old playlist. Any suggestions??

    I recently update my iTunes and it deleted all my songs. I was able to get some back via iCloud but I can't seem to sync my old playlist. Any suggestions??

    See Empty/corrupt library after upgrade/crash...
    tt2

  • I have updated my ipod and it deleted everything including my photos and i did not save my photos on any other device, How do i get them back?

    I have updated my iPod and it deleted everything including my photos and I did not save my photos on any other device, How do I get them back?

    You didn't import all of your pics regularly?  Particularly before an update?
    They may very well be gone.
    You can try restoring from backup.

  • I updated my ipod and it deleted my entire library how do I restore it with the backup I have saved?

    I updated my ipod and it deleted my entire library.  How do I restore it with the backup I have so all songs will be available in the cloud; which I paid extra Money to increase memory for?

    The backup that iTunes makes does not include apps, music, synced videos and photos. Se:
    iTunes: About iOS backups
    You will have to sync the items back form yur computer/iTunes library to the iPod via iTunes. If they are not on the computer you can redownloa d some iTunes purchases by:
    Downloading past purchases from the App Store, iBookstore, and iTunes Store

  • So i updated my Itunes and it deleted my music that wasnt bought on itunes and only shows song i have in cloud. is there a was to get it all back without re-downloading them all again?

    so i updated my itunes and it deleted all my music that was not bought on itunes and only shows all the songs i did buy in cloud. is there a was to get it all back without re-downloading them all again?

    Hello Dark Pikachu
    Check out the article below to put the previous iTunes library file back on to bring back the songs that you had before the update. It will walk you through step by step to get you sorted out.
    No content shows up in iTunes after updating
    http://support.apple.com/kb/ts1967
    Regards,
    -Norm G.

  • I updated my ipod and it deleted most of my music,especially the songs and albums i bought off the apple store!how can i restore them?

    I updated my ipod and it deleted some of my music,especially the songs i bought off itunes!how can restore the songs?

    See this article for more information if need be.
    http://support.apple.com/kb/ht2519
    B-rock

Maybe you are looking for

  • Visio documents stored in KM

    I uploaded several Visio (.vsd extension) files to a KM folder. When I try to open them, the browser detects the correct file type and asks if I want to open or save the file. When I click open, I receive a "page cannot be displayed" browser error. W

  • Wireless connection to mobiles

    Hi there, I'm having some trouble with the new BT infinity wireless connection for the mobiles in the house. Using the HH3. Wireless connection between the 2 laptops in the house is fine and the wired connection fine. However keeping a connection on

  • Deleting in the download folder

    I am new to mac. I now have a bunch of stuff in the download folder. Do I need to delete these and if so, is there a quick and dirty way to do it or must I drag each file to the dump seperately?

  • Debugging advice - attempt to insert nil value

    Hello, I have a program that gets its data from a lot of XML files. When working on the XML files, if I do something wrong like, misspell a tag, or put a file that doesn't exists between the tags, or something like that, I often get this error. iPhon

  • Rac 10gr2 upgrade

    Hi experts, We are prototyping RAC database upgrade from 10.1.0 to 10.2.0.4. I just created a new directory as 10.2.0 ORACLE_HOME. Since the 10gr1 database is running, all the environmental variables set by login profile point to the current 10.1.0 d