Tuesday, October 8, 2019

Oracle Apex - Modal Page Lookup Plugin

Just released my first Oracle Apex Plugin at apex.world  :)

For more details...




4 comments:

Tom said...

Thank you for providing this plugin. I think it is widely needed.

I installed it and try to use this modal lookup. The instructions are bit confusing and maybe not detailed enough so I cannot get it to work.
E.g.
3. Add a Button for search and set the button click action as "Dynamic Action".
4. Create a Dynamic Action for Page Load with Modal Page Lookup Button (plugin)

As per #4 the button plugin should be created at "Page Load" action. Is it correct?
I'm also confused about the "Returning..." items purpose and values.
E.g.
Returning Page Items - The Page Item(s) for performing lookup. After the Lookup Dialog closed, the selected value will be returned to it.
Does it mean I have to create an item on the Modal page or is it item on the calling page.

Kevin Chui said...

yes you need to create the plugins at "Page Load"


On my case
Page 2 is Employee Lookup Modal Page
Page 4 is for demo how to create the Search Buttons

For Modal Page [Plug-in]
You need create page item(s) for holding returning items
on my case
SQL: select EMPNO, ENAME, JOB, MGR, HIREDATE, SAL, COMM, DEPTNO from EMP
I created two page items P2_EMPNO and P2_ENAME (both are hidden and set Value Protected as OFF) and one button OK (ID set as BTN_OK)
Returning Page Items: P2_EMPNO,P2_ENAME
Returning IG Columns: EMPNO, ENAME
OK Button ID: BTN_OK

For plugin (Modal Page Search)
on my case
Lookup Page Items : P4_EMPNO, P4_ENAME
Lookup Page ID: 2
Returning Page Items: P2_EMPNO, P2_ENAME

Hope it can help, or you can download the application.

Christian said...

Thank you for your great work.

What’s the trick to make the created search button look like a “date picker” button for the linked page item as shown in the demo application?

I can’t install the demoapplication, because I getting an errormessage, so I can’t look up it myself.

Kevin Chui said...

Dear Christian,

Here is the key of trick
var btn = "#" + $(this)[0].action.affectedButtonId;
var divCon = $("#' || vPITEM || '").closest(".t-Form-itemWrapper");
$(btn).appendTo(divCon);
$(btn).addClass("ui-datepicker-trigger a-Button a-Button--calendar");


Sorry to hear about installation problem, probably that's the version problem. Which APEX version are you using? The downloaded version is for APEX 19. Or give me some more information about your problem.