Forum Stats

  • 3,853,596 Users
  • 2,264,243 Discussions
  • 7,905,405 Comments

Discussions

Conditionally show popup on page(fragment) load

Saurabh-Oracle
Saurabh-Oracle Member Posts: 25
edited Oct 20, 2014 2:16AM in JDeveloper and ADF

Hi Experts,

We have a requirement to show a popup on page load if a specific condition is true.

I have two fragments (home.jsff and profile.jsff). Initially when the user login, home.jsff is shown and there should be no popup.

When the user will go to profile.jsff and save the changes, it should first redirect to home.jsff and show a popup with confirmation message.

I can not create a separate fragment for the popup where we should redirect from profile.jsff and then redirect to home.jsff as the requirement says the popup should be shown with the content of home.jsff in background.

Also I cant use showPopup behavior on page load as its a jsff.

Kindly suggest how to implement this.

Thanks in advance.

Best regards,

Saurabh

Tagged:

Best Answer

  • Frank Nimphius-Oracle
    Frank Nimphius-Oracle Member Posts: 29,689 Bronze Badge
    Answer ✓

    ... there is an even simpler option

    1. add a hidden output text component to the fragment

    2. bind the output text components "value" property to a manage bean property (setter/getter pair)

    3. When the value's getter method is called, check the flag you set for whether to show the popup or not

    4. If the flag is such that the popup should be shown, launch the Popup from Java

      4.a lookup the RichPopup component

      4.b set the popup hints

      4.c unset flag to display popup (for the next time you need to set it)

      4.d show popup

    Frank

Answers

  • when user saves the changes. store inside session bean some flag that says should or should not show the popup.

    After redirection - check the value of this flag and it shows that you should show the popup - so show it. (reset the flag immediatelly after this)

  • Alejandro Tovar Lanz
    Alejandro Tovar Lanz Member Posts: 1,631 Bronze Trophy

    Saurabh,

    What version of JDeveloper are you using? Depending in your version you might be able to achieve the requirement in different ways. As previous post says, you need a variable stored in your pageFlowScope at least, to determine whether you should show the popup or not.

    If you are using newest version of JDeveloper (12c) maybe using a SystemEvent when the parent UI component of main loads for example.

    Regards

  • Thanks for the response.

    My Jdeveloper version is 11.1.1.7.3

    I am setting the session scope flag but the problem is how to show popup on page load. If I use the java code to show popup in the backing bean constructor it doesnt recognise popup binding.

    The result is same if I use a TF method call activity to call a bean method to show the popup.

    Thanks.

  • Timo Hahn
    Timo Hahn Senior Principal Technical Consultant - Oracle ACE Director Member, Moderator Posts: 38,745 Red Diamond

    There are different possible solutions which are outlined here https://blogs.oracle.com/adf/entry/an_epic_question_how_to

    Timo

  • Frank Nimphius-Oracle
    Frank Nimphius-Oracle Member Posts: 29,689 Bronze Badge
    Answer ✓

    ... there is an even simpler option

    1. add a hidden output text component to the fragment

    2. bind the output text components "value" property to a manage bean property (setter/getter pair)

    3. When the value's getter method is called, check the flag you set for whether to show the popup or not

    4. If the flag is such that the popup should be shown, launch the Popup from Java

      4.a lookup the RichPopup component

      4.b set the popup hints

      4.c unset flag to display popup (for the next time you need to set it)

      4.d show popup

    Frank

This discussion has been closed.