Page refresh button

来源:互联网 发布:开淘宝网店保证金怎么交 编辑:程序博客网 时间:2024/05/16 07:54

文章1:http://www.apex-at-work.com/2009/11/page-refresh-button.html

If you want to create a page refresh button inside your APEX page you need to add the following things:

1. Upload a button picture (Shared Components>Images>Create>Upload)
2. Create a new navigation bar (Shared Components>Navigation Bar Entries>Create):
- Image: "LET IT EMPTY!"
- Icon Subtext: <img src="#APP_IMAGES#page_refresh.png" title="Refresh">

apex 4.1怎么没有找到Icon Subtext这个属性啊!按照步骤做了,icon图标没有显示出来。

- Icon Image Alt: "Refresh"
- Image Height: 40
- Width: 30
- Target type: URL
- URL Target: javascript:window.location.reload(false);

3. Watch the result:


文章2:http://c2anton.blogspot.com/2010/02/apex-refresh-classic-report-region-ajax.html

APEX Refresh Classic Report Region AJAX style

We often have the need to refresh a classic report region, AJAX style. It is straightforward to get a refresh link on the page. I used to just build a link using $a_report (the APEX built-in for doing partial page refresh on classic reports). But I have found it is better to create a javascript function in the region header or footer. This has the advantage that you can call it from a button on the page, or from any location on the page, not just from within the header or footer itself. If you put the following 

<script type="text/javascript">
function c2RefreshTasks(){  
  pId = '#REGION_ID#';   // report region id
  $a_report(pId.substring(1),'1','15');  // APEX built-in
  } 
</script>

This allows me to put a link anywhere on the page

<a href="javascript:c2RefreshTasks();">refresh tasks</a>

I can also create a standard button anywhere on the page that calls this javascript.

I recently also had the need to pop a new window (child), add a task in that child window, close the child and then refresh the task region in parent window. It turned out to be easy...

Just create the APEX child window that does the insert/update.&nbsp; Have it branch to a page (e.g. P99). On P99, put the following in the HTML header

<script type="text/javascript">
 // important to have the try because the parent window might have changed... 
{ try { 
  window.opener.c2RefreshTasks();
  }
  catch(err) {
  window.close();  
  }
}
  window.close(); 
</script>

APEX Refresh Classic Report Region AJAX style

文章3:http://www.oracle-and-apex.com/question-how-to-refresh-an-apex-sql-report-from-javascript/

Nowadays everything should be interactive and Web2.0 and AJAX, and again the Oracle Application Express Development Team has prepared something for us, that makes it easy to give our APEX Applications that interactive touch.

Imagine a SQL Report Region (“Classic Report”) and a button next to it. In front of the computer is a nervous user who waits for a certain record to appear in his Report (e.g. this months salary in his bank statement).

So what is he doing? The nervous finger. Clicking the refresh button every 10 seconds. And everytime he clicks the button, the page is submitted and loads the new data. But this Page submitting and reloading takes some time and flickers, which makes our user even more nervous.

Better and faster would be refreshing the report without submitting the Page, looks smooth and totally Web 2.0.

APEX has a JavaScript function $a_report(pId,pMin,pMax,pFetched,pSort) which reloads the reports data and displays it without resubmitting the whole page.
pId is the ID of your Report, pMin and pMax are the RowIds to display, pFetched the number of Rows and pSort can hold some sort clause.

e.g. javascript:$a_report(’15520013154312712′,’1′,’10′,’10′);

Now all you have to do is put this javascript call into your Buttons Target

And make sure that your Report is set to “Enable Partial Page Refresh”, this is needed to make sure that $a_report knows what to do.


问题:如何获取pId的值呢?