This discussion is archived
3 Replies Latest reply: Oct 7, 2012 7:53 AM by 953399 RSS

Skillbuilder Modal Page needs to execute a process on the parent page

953399 Newbie
Currently Being Moderated
Hi,

I am using apex 4.1 and theme 2. Also I am using the Skillbuilder modal page plugin.
I have a modal page with a textbox and a button. On click of this button i want to pass the textbox value to the parent page and execute a process on the parent page.
I dont want to hardcode the page numbers here as this same popup page will be used in all the pages in the application. It is to capture the comments before submit on each page. Hence it should just pass the values to the page that called this modal window.

Any help greatly appreciated.

Thanks in advance,
DS
  • 1. Re: Skillbuilder Modal Page needs to execute a process on the parent page
    Tom Petrus Expert
    Currently Being Moderated
    Take a look at these:
    {thread:id=2420256}
    {thread:id=2407235}

    Basically: define a dynamic action on your parent page to act on the close event of the modal page. On your modal page, use the close method of the plugin (and possibly provide a return value)

    From documentation
    Advanced Usage
    Methods
    ...
    Close*
    The close method can be used to close the modal dialog programmatically. The method accepts an optional parameter which can be anything. That value can then be >accessed in Dynamic Actions that respond to any of the close events of the plug-in. The syntax to access the value is: this.data.modalPageCloseValue. To access the method >from within the child page, see the third example.
    $(document).apex_modal_page('close');
    $(document).apex_modal_page('close', someVariable);
    parent.$(parent.document).apex_modal_page('close');
    ...
    Events
    Manual Close
    The Manual Close event fires when the the modal dialog is closed by either the end user or programmatically by the close method. If the close method was used it’s possible >that an optional value was passed to the close method which is exposed in Dynamic Actions as this.data.modalPageCloseValue.
    Close
    The Close event fires whenever the modal dialog is closed, whether automatically or manually.
  • 2. Re: Skillbuilder Modal Page needs to execute a process on the parent page
    953399 Newbie
    Currently Being Moderated
    Hi Tom,

    Thanks for the links. They were really useful.
    I got the modal page to pass the value to the parent page.
    I am able to receive the value in the parent page but when i assign it to a page item, it doesnt display.
    I dont even want to assign it to a page item but want to pass it to a pl/sql query that updates the value in the db.
    Please let me know how to pass it to pl/sql.

    Thanks,
    DS
  • 3. Re: Skillbuilder Modal Page needs to execute a process on the parent page
    953399 Newbie
    Currently Being Moderated
    Ok got it working. when setting the value of an item, we have to set the session state using ajax as given in the link below.
    Setting item value using Javascript

Legend

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