Page refresh button

文章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

文章3http://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的值呢?


  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值