This discussion is archived
7 Replies Latest reply: Apr 23, 2012 9:15 AM by alexander RSS

Treetable delete/remove rows

alexander Newbie
Currently Being Moderated
Hi,

what is the most appropriate way to delete/remove parent and child rows/records from treetable?
Could somebody to point on working examples?
thanks,
Alexander
  • 1. Re: Treetable delete/remove rows
    Timo Hahn Oracle ACE
    Currently Being Moderated
    The answer to this depends on your jdev version (which you did not mention) and the data model beneath the tree table.
    The easiest case would be that you can do a cascading delete on the master and all children are removed automatically by the framework...

    Timo
  • 2. Re: Treetable delete/remove rows
    Frank Nimphius Employee ACE
    Currently Being Moderated
    +1 on Timo's answer

    For the how-to: see http://www.oracle.com/technetwork/developer-tools/adf/learnmore/november2011-otn-harvest-1389769.pdf "How-to access selected node in tree component" on page 17 If you call remove() on the Row then teh row is deleted with the next commit you send. If there is a cascading behavior implemented on the database tables (cascade delete constraint) and also defined on the association in ADF BC then the child nodes are deleted as well. If there is no cascade delete defined, then you can call getChildren on the JUCtrlHierNode reference to get hold of the child data for a tree component so you can access and delete these rows too

    Frank
  • 3. Re: Treetable delete/remove rows
    alexander Newbie
    Currently Being Moderated
    Hi,
    current JDeveloper Studion version is 11.1.2.1.0 and Oracle IDE is 11.1.2.1.38.60.81.
    I was asking this question, since I was getting current row from treetable properly, then doing remove() and commiting the changes. The changes were not applied in the database. I was trying several examples that I have seen in the internet, no success. Only working through application module and calling stored procedure I was able to delete the record.
    I can prepare an example if it can help.
    And thanks for such quick replies on my question!

    Alexander
  • 4. Re: Treetable delete/remove rows
    user13159000 Newbie
    Currently Being Moderated
    Hello,

    Are you removing the current Row and commiting the DBTransaction in Application Module ? Does this Row has any master or child data ? Do you see any exceptions while commiting transaction ?
  • 5. Re: Treetable delete/remove rows
    alexander Newbie
    Currently Being Moderated
    there are no child records and no master records ...

    Alexander
  • 6. Re: Treetable delete/remove rows
    Timo Hahn Oracle ACE
    Currently Being Moderated
    How is the data model wired up?
    How do you remove the master record?


    If you can prepare a sample build on the HR schema and put it on a file hoster (the forum don't allow file uploads). the post the link here...


    Timo
  • 7. Re: Treetable delete/remove rows
    alexander Newbie
    Currently Being Moderated
    Hi Timo,

    I need some time to prepare an working example.

    Alexander

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points