Forum Stats

  • 3,855,262 Users
  • 2,264,493 Discussions
  • 7,905,953 Comments

Discussions

Show in Dynamic action

Srinivash
Srinivash Member Posts: 11 Blue Ribbon
edited Feb 28, 2013 11:19PM in APEX Discussions
I have created a region which is a dynamic report based on a item value(P1_SHOW).when the page loads this region is hidden using a DA (on page load).at some point I have a super lov item which wen changes to any value folowing DA works
IF NOT NULL
sets the item value P1_SV
Refreshes the region containing the report.
Show the region report

IF NULL
Hides the region report


Here my problem is when i select a value it first shows No data found and then changes according to the item set.
or
If we are changing a value it shows the report then we clear the super lov then the region is hidden and when we give another value for few seconds it shows the previous data then shows the refreshed data.

I tried debugging it is all happening because of the last show action.

I don't want that previous data to be shown for few seconds pls help

Best Answer

  • dmcghan
    dmcghan Member Posts: 2,556
    Answer ✓
    990870,

    Please set up a demo of your problem on apex.oracle.com. Provide us with developer credentials and steps to reproduce.

    Regards,
    Dan

    blog: http://DanielMcghan.us/
    work: http://SkillBuilders.com/APEX/

Answers

  • dmcghan
    dmcghan Member Posts: 2,556
    Answer ✓
    990870,

    Please set up a demo of your problem on apex.oracle.com. Provide us with developer credentials and steps to reproduce.

    Regards,
    Dan

    blog: http://DanielMcghan.us/
    work: http://SkillBuilders.com/APEX/
  • Howard (... in Training)
    Howard (... in Training) Member Posts: 905
    edited Feb 28, 2013 8:50AM
    Hi 990870,

    A few preliminaries. Could we get you to change your handle from a number to a name? (I'm Howard.) Also, If you haven't read the useful advice in https://forums.oracle.com/forums/ann.jspa?annID=1324 , take a look.

    A demo is a great idea.

    A few thoughts. [I'm only a newbie.] In what I've done, APEX seemingly constructs/makes a page (or region) visible and then updates it. So, one sees the current value and it changes to the the new value before our very eyes. A feature? It could be a useful one. But what we want is to have the page cleared before it's made visible so we don't see the former image. Right?

    So, is there a way to change the page before it displays? Can we do this: Hide the region, update the region, show the updated region? Not sure.

    But if it were, say, a single button -- maybe that can be done with some javascript. You already have a DA.

    One could add a new action "Execute Javascript Code" and in Settings have the following Code:
    [This was someone's example to show or hide a button based on a count in P9_COUNT.]
    var my_cnt = $v('P9_COUNT');
    if( my_cnt > 0 )
    {
       $('#MY_SUB_BTN').show();
    }
    else
    {
       $('#MY_SUB_BTN').hide();
    };
    So one would have three actions on the same DA. The first would hide the region, the second would hide the button and the third would show the update region without the button. Maybe it could work.

    I'll see if there's any time to experiment with this today.

    Regards,
    Howard
    Howard (... in Training)
  • Srinivash
    Srinivash Member Posts: 11 Blue Ribbon
    Hi Dan,
    I have made a demo app at apex.oracle.com with the following credentials
    workspace-srinivash
    [email protected]
    password-twilight


    you can go to the only app present there named as 'practice dynamic action jan'.When you run the page you will get an select list item which you when change displays the report according to the empno selected.But before it shows the report it also shows no data found for few second which I dont required.Also when you select a empno and then NULL then again any other empno it will show the previous report first.
    And my restriction is I cant submit page.It has to be done through dynamic action

    Thanks in advance
    Srinivash
  • Srinivash
    Srinivash Member Posts: 11 Blue Ribbon
    Hi Howard,
    Thanks for the suggestion I did change my handle and I think the idea you are giving will require me to page reload which I cant do in my page as it will completely change other things because of the other on load process.Please go through the demo I provided and help me.

    Thanks in advance
    Srinivash
  • HarryF
    HarryF Member Posts: 148
    My approach is to have a conditional on the region:

    :SELECT_LIST is not null

    If the page action when value changed for the select list is submit page it will refresh the page and show the region.
    HarryF
  • Tom Petrus
    Tom Petrus Member Posts: 1,151 Gold Trophy
    Srinivash,

    First of all, the built-in refresh has been made so that no screen-flicker-effect would occur: the refreshed region is a bit of html requested from the server, dumped in a container, and then replaces the original html (a report in this case).
    What you want, from what I understand, is to hide the region when it is refreshed.

    Looking at your app, you probably want to keep the region hidden during the PLSQL code and the refresh action. I just put the "Hide" effect you had under the "False" actions as first action in the "True" actions.
    Doesn't that achieve what you want? I'm not sure why you put a false action under a change event. A change will always be a true action, it will only fire when there is an actual change.
    Tom Petrus
  • dmcghan
    dmcghan Member Posts: 2,556
    Srinivash,

    I looks like the refresh action was move to asynchronous Ajax (kinda funny, I know) and that was the problem. However, if you leverage the apexafterrefresh event that is triggered on the region after the refresh is complete, then it's an easy workaround.

    I updated your demo to do this via a new dynamic action. Is that working as you wanted it to?

    Regards,
    Dan

    blog: http://DanielMcghan.us/
    work: http://SkillBuilders.com/APEX/
    dmcghan
  • Srinivash
    Srinivash Member Posts: 11 Blue Ribbon
    Hi Dan,
    Thanks a lot Its working as required I wanted when the select list is chosen as NULL then the region should hide and I added that as a false condition and now its totally as required.So after refresh action which I was missing .Once again thanks for the help Dan.

    Thanks
    Srinivash
  • Srinivash
    Srinivash Member Posts: 11 Blue Ribbon
    Hi Harry,
    Actually i had the limitation of not making the page reload so i cant make the report region as conditional and also the refresh action only works on the report query it doesn't refresh or check the condition there again so I was not able to apply this approach.Thanks for your help.

    Thanks
    Srinivash
  • Srinivash
    Srinivash Member Posts: 11 Blue Ribbon
    Hi Tom,
    I needed that false action to hide the region when the select list is changed to NULL and when not NULL to refresh and show the region.Thanks for your suggestion that hide thing is the correct approach you are correct.

    Thanks
    Srinivash
This discussion has been closed.