This discussion is archived
12 Replies Latest reply: Feb 22, 2013 10:06 AM by 761876 RSS

generic popup

User268653 Newbie
Currently Being Moderated
hi every body

i have a page based on template page. inside a template page i have a Popup for deleteing a recrod with a confirmation message.

i want to call the popup from a button found in the page which have an action for delete , when i press on a button from the page the popup is shown , but when i click on ok button to execute delete action i get this message : Null Pointer Exception. i think that the binding for delete should found in template page,how can i solve this problem.

thanks
maher
  • 1. Re: generic popup
    Sudipto Desmukh Expert
    Currently Being Moderated
    Can you paste the log of the NPE in addition to the Jdev version you use (You should always mention that).
    That ways we can be able to give you better answers !
  • 2. Re: generic popup
    User268653 Newbie
    Currently Being Moderated
    jdeveloper version : 11.1.2.3

    I am now at home , when i go to my work i will past the log .

    but as i said before i think the problem is that the Popup found in template Page and the delete action found in page it self, so the dialoglistener of popup can not find the delete action in template page.

    thanks
    maher
  • 3. Re: generic popup
    Suresh Karunarathne Guru
    Currently Being Moderated
    Hi,
    Why did you add delete action in template page.delete based on VO and it is good practice use delete action page and also popup in the same page.
    See
    http://download.oracle.com/otn_hosted_doc/jdeveloper/11gdemos/adfjsfreuse/templates.html
    Edited by: Suresh Karunarathne on Feb 20, 2013 9:48 AM
  • 4. Re: generic popup
    User268653 Newbie
    Currently Being Moderated
    hi


    The Delete action is found in the page it self, but the execute of delete is done by the popup found in the page template. i want to do that because i don't want to create popup for each page .



    Thanks

    maher

    Edited by: 842127 on Feb 20, 2013 7:01 AM
  • 5. Re: generic popup
    User268653 Newbie
    Currently Being Moderated
    any help please.


    thanks
    maher
  • 6. Re: generic popup
    User268653 Newbie
    Currently Being Moderated
    hi everybody


    how can any one in this forum know that his question in this forum will be answered or not be answered.

    i wait and wait and wait.

    i wish from Experts in this forum to tell us that our question can be answered or not, and please tell us what is the wrong of our question.

    thanks
    maher
  • 7. Re: generic popup
    761876 Newbie
    Currently Being Moderated
    Hi 842127,

    When you select 'OK' or 'Cancel' button on the Popup from a page, a DialogEvent occurs. You can set the ActionListener for the popup. This method will check for the clicked button and perform a delete accordingly.

    Below is the code which can be used on popup action listener.

    public void deleteConfirm(DialogEvent dialogEvent) {

    Outcome outcome = (Outcome)dialogEvent.getOutcome();
    if (outcome == Outcome.ok) {

    BindingContainer bindings = getBindings();
    OperationBinding operationBinding =bindings.getOperationBinding("Delete");
    Object result = operationBinding.execute();
    OperationBinding operationBinding2 =bindings.getOperationBinding("Commit");
    Object result2 = operationBinding2.execute();
    }
    }

    Please try this and share your results.

    regards,
    Rajan

    It is considered good etiquette to reward answerers with points (as "helpful" - 5 pts - or "correct" - 10pts).
    https://forums.oracle.com/forums/ann.jspa?annID=893
  • 8. Re: generic popup
    User268653 Newbie
    Currently Being Moderated
    Hi Rajan


    i am already tried you solution and i have Null Pointer Exception at this line :

    OperationBinding operationBinding =bindings.getOperationBinding("Delete");

    Object result = operationBinding.execute();

    regards
    maher
  • 9. Re: generic popup
    761876 Newbie
    Currently Being Moderated
    Ok...I got your problem.

    you dont have that method binding on the adf page and hence not able to find it. Go to your adf page -> page definition. You will not be having Delete method there.

    Now...
    1. Go to your adf page
    2. from the Data Control pallette on the left, select your ViewObject and go to operations folder.
    3. Drag Delete method on your page. Drag it as a button.
    4. Select the button and set it's rendered='false' property.

    Now run your application and it should run fine.

    please share your results.

    regards,
    Rajan

    It is considered good etiquette to reward answerers with points (as "helpful" - 5 pts - or "correct" - 10pts).
    https://forums.oracle.com/forums/ann.jspa?annID=893
  • 10. Re: generic popup
    761876 Newbie
    Currently Being Moderated
    alternatively, you can add method on the page definition page itself. Below are the steps:

    1. Go to the page def file for the ADF page.
    2. Under bindings listing, click on the green Plus icon.
    3. Select Action and it asks you for the required iterator.
    4. Then you can select the required action there.

    regards,
    Rajan

    It is considered good etiquette to reward answerers with points (as "helpful" - 5 pts - or "correct" - 10pts).
    https://forums.oracle.com/forums/ann.jspa?annID=893
  • 11. Re: generic popup
    User268653 Newbie
    Currently Being Moderated
    hi

    i have the Delete method in my page. but the popup is found in Template page.

    regards
    maher
  • 12. Re: generic popup
    761876 Newbie
    Currently Being Moderated
    do your have popup in the same page where you have Delete action binding?

    Suppose I have abc.jsff page where I show the popup. Then I should have delete action binding in abc.jspx page definition.

Legend

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