How to show and hide inline dialog in oracle apex using JavaScript
- Create a Region named as example “Employee Details:
- Assign a Static ID of the region “EMPDTLS” ( ..Region Property/Advanced/Static ID:)
- Create a Page Button Named “ShowDialog”
- Go to the button property and set it’s properties as below:
- Behavior/Action = Redirect to URL
- Target =
1 |
javascript:openModal('EMPDTLS'); |
5. Now Save and run the page. when you click “ShowModal” button the modal dialog will be appeared.
6. Now for closing the Modal dialog, you can add a new button “closeDialog” in the dialog region and set the properties as below:
- Behavior/Action = Redirect to URL
- Target =
1 |
javascript:closeModal('EMPDTLS'); |
7. If you want to pass value in the Dialog region then
1 |
javascript:$s('P1_EMPID',7369);openModal('EMPDTLS'); |
Or
1 |
javascript:$s('P1_EMPID',$v('P1_EMPNO'));openModal('EMPDTLS'); |
Or
1 |
javascript:$s('P1_EMPID','#EMPNO#');openModal('EMPDTLS'); |
#EMPNO# – this is applicable when you calling dialog window from Interactive or classic report. here EMPNO is the column name.
Thank You
Good. It helped me in adding edit dialog in interactive report.
How to set mutliple items??
e.g.javascript:$s(‘P1_EMPID’,’#EMPNO#’,’P1_EMPNAME’,’#ENAME#’);openModal(‘EMPDTLS’);
Just follow the below example:
javascript:$s(‘P70_ATTACHMENT_ID’,’#ATTACHMENT_ID#’);$s(‘P70_EDIT_DESCRIPTION’,’#DESCRIPTION#’);openModal(‘editDescription’);
Thank You
Kamal
Good one!
There is something missing though: besides setting the static ID for the region, you also have to set its Layout > Position = Inline Dialogs, and the Appearance > Template = Inline Dialog.
Thanks,
Pedro
Good day! Would you mind if I share your blog with my twitter group?
There’s a lot of folks that I think would really enjoy your content.
Please let me know. Thanks
This site was… how do I say it? Relevant!! Finally I’ve found something which helped me.
Kudos!