SAP CRM 使用Javascript触发SAP Server Event
生活随笔
收集整理的這篇文章主要介紹了
SAP CRM 使用Javascript触发SAP Server Event
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
為了在BSP中使用Javascript觸發server event,你需要在.htm文件中使用<bsp:event>標簽生成一個Javascript方法。如果有需要的話,可以通過該標簽傳遞兩個參數:
<bsp:htmlbEvent?name?=?"fireServerEvent"Id???=?"fireServerEvent"p1???=?"p1"p2???=?"p2"?/>接下來生成像下面這樣的方法:
<script?language="javascript">fireServerEvent(?p1?=?"first_parameter"p2?=?"second_parameter"?);</script>你需要通過serveEvent(大小寫敏感)創建一個event handler來處理事件。接下來像這樣在event handler內部訪問數據:
DATA:?lr_event???????TYPE?REF?TO?cl_bsl_htmlb_event,lt_event_items?TYPE?tihyypnvp,ls_event_items?TYPE?ihttpnvp.IF?htmlb_event_ex?IS?BOUND.lr_event??=?htmlb_event_ex.???????IF??lr_event->name?=?'fireServerEvent'.*??????your?code?here*??????access?the?parameters?as?lr_event->p1?and?lr_event->p2ENDIFENDIF可以在.htm文件中使用下面的代碼來周期性地觸發一個server event,即通過使用Javascript中的setInterval()方法。在這個例子中是每十秒觸發一次。
<bsp:htmlbEvent?name?=?"fireServerEvent"id???=?"fireServerEvent"?/><script?language="javascript">var?oInterval?=?setInterval("fireServerEvent()",?10000);</script>?
轉載于:https://blog.51cto.com/12883930/1922709
總結
以上是生活随笔為你收集整理的SAP CRM 使用Javascript触发SAP Server Event的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: Unity3D的Time.timeSca
- 下一篇: fixedBox固定div漂浮代码 支持