Thursday, 21 July 2016

quick way how to implement parameterized popups in ADF

    The business case is very common - there must be a popup which should be parametrized. As usually, I don't want to code it and I want to get it fast. I've done it for several times earlier, and even during this demo I've forgotten about one of the attributes.

    My popup will show a region, in my demo I've created a simple task flow with one input parameter and one view activity.

    After that I've started to work on the test page. There I've created two buttons with <af:setPropertyListener> tags to assign parameter. You can use managed beans or other ways, in my case I'm creating implicit parameters in one of ADF memory scopes. I'm using request scope or view scope because they're living for the shortest amount of the application life time. 

    I'm creating a popup with a dialog and region inside. The popup itself must have contentDelivery attribute set to lazyUncached. The tricky part is with setPropertyListener and showPopupBehavior tags under the buttons. First one must have type attribute set to action, second the triggerType attribute to click.

    It's almost everything, the final last thing that needs to be changed is in the page definition file. Because the region relies on the input parameter, to ensure that it'll refresh itself, please change refresh parameter to ifNeeded. And that's it, you can run it and check the results :)

1 comment: