Forum Stats

  • 3,781,297 Users
  • 2,254,499 Discussions
  • 7,879,635 Comments

Discussions

How to refresh a single page item without refreshing the whole page or region?

Virat Praveen-Oracle
Virat Praveen-Oracle Member Posts: 48
edited Feb 26, 2015 1:05AM in APEX Discussions

I want to refresh a single page item without refreshing the whole page or region.Can i do this with a dynamic action? if yes how to do it?

Apex version:4.2.

Tagged:

Answers

  • ReemaPuri
    ReemaPuri Member Posts: 1,358 Gold Badge
    edited Feb 26, 2015 1:05AM

    Just a small example of displaying time and auto refresh apex item in apex every second   -Hope this will be helpful



    Selection_010.pngSelection_011.png

    STEP 1:- CREATE a html region on page 0 and make it conditional for page no 7

    "current page is contained for page in expression 1"

    put page 7(or any page)

    Step 2:- create a Apex item P0_X ON the same region of page 0

    Step 3:-

    Create an application process containing the PL/SQL logic:

    Name: test_ajax

    Point: On Demand.

    Process Text:

    begin

      htp.prn(to_char(systimestamp,'dd-mm-yyyy hh24:mi:ss.FF'));

      exception when others then htp.prn(SQLERRM);

    end;

    step4:-   on page 7

    in html header

    <script language="JavaScript" type="text/javascript">

    <!--

    function test_ajax_auto_refresh() {

      var vGet = new htmldb_Get(null,$x('pFlowId').value,'APPLICATION_PROCESS=test_ajax',0);

      document.getElementById('P0_X').value = vGet.get();

      vGet = null;

      setTimeout('test_ajax_auto_refresh()',1000);

    }

    //-->

    </script>

    step 5:-

    on page load in page 7

    write:-

    test_ajax_auto_refresh();

    this is an example of running PLSQL autorefresh after every second in apex item

    FOR running example

    login credentials:-

    WORKSPACE:-REEMATEST

    password -reematest

    username:[email protected]

    Application-72665

    tab-autorefresh

This discussion has been closed.