Thursday, 29 December 2016

Modal Dialog in Apex 4.2

Requirement:
A modal dialog has to open on button click in Oracle Apex 4.2.
Step 1:
    Create a page
Step 2:
Create a HTML static Region and create a button in that region.
Give a STATIC ID for that region.
Step 3:
    On page load the region should be hidden
Create a dynamic action using following steps
   1. Event     - Page Load
   2. True action - Hide Region
Step 3:
Create a dynamic action to open the HTML static region as Modal dialog using following steps
    1. Event        -  Click
    2. Selection Type -  Button
    3. Button       -   Button Name
        4. Add true action by specifying action as Execute JavaScript
Step 4:
     Enter the following JavaScript code

$('#STATIC_ID').dialog({"title":"Region_Title", "minheight":"50%", "width":"40%",  
"position":"auto"});  

Example:

$('#modal').dialog({"title":"cash_payment", "minheight":"50%", "width":"40%",  

"position":"auto"});  


By 
Preethi.J

8 comments:

  1. i tried follows your steps but i lost in the way, i think you need put more images :D

    ReplyDelete
    Replies
    1. This not an Old comment, I'll try to help you :3

      1. Create Two HTML regions, let's call them Main Region and Modal Region
      2. In the Main region create a Button, set the action of the button as "Defined by Dynamic action"
      3. Add some content to the Modal region. (Items, text, whatever you want).
      4. In the Modal region Properties set a Static ID, for example "modal"
      5. Create a Dynamic action to show the region as modal. There select the options as described in the step 3 of the blog, and select the button.
      6. Add a True action of type JavaScript and add this code
      $('#modal').dialog({"title":"cash_payment", "minheight":"50%", "width":"40%", "position":"auto"});
      7. Run the page and click the button, this would show the region as modal. But it is showing in the screen before you press the button tha's why you have to create other Dynamic action to hide the region.
      8. Create a dynamic action Event: Page Load, Create a true action to hide the region.

      Delete
    2. Followed second set of directions: makes a nice pop up movable region, but its not
      what i understand as MODAL- while the pop up is open, I can still click on anything else in the app.
      Is that expected?

      Delete
    3. How to use page item as link instead of button ?

      Delete
  2. Excellent blog I visit this blog it's really awesome. The important thing is that in this blog content written clearly and understandable. The content of information is very informative.
    Oracle Fusion HCM Online Training
    Oracle Fusion SCM Online Training
    Oracle Fusion Financials Online Training
    Big Data and Hadoop Training In Hyderabad

    ReplyDelete
  3. Such a nice blog, I really like what you write in this blog, I also have some relevant information about if you want more information.

    Big Data and Hadoop Online Training

    ReplyDelete
  4. I would like to thank you for the efforts you have made in writing this article. I am hoping the same best work from you in the future as well.

    Spark and Scala Online Training

    ReplyDelete
  5. Thanks a lot for sharing a valuable blog on oracle apex training. I was browsing through the internet looking for Oracle PPM Cloud and Oracle fusion applications and came across your blog. I am impressed by the information that you have on this blog. It shows how well you understand this subject, you can find more information about Oracle Apex by attending apex oracle training. You can learn about interview questions by visiting fusion Interview Questions

    ReplyDelete