650) this.width=650; "Src=" http://images2015.cnblogs.com/blog/994049/201610/994049-20161019165217029-463210813. JPG "alt=" tag "style=" border:0px;line-height:1.5; "/>
In order to trigger the server event in BSP using JavaScript, you need to use the <bsp:event> tag in the. htm file to generate a JavaScript method. If necessary, two parameters can be passed through the label:
<bsp:htmlbevent name = "Fireserverevent" Id = "fireserverevent" P1 = "P1" P2 = "P2"/>
Next, create a method like this:
<script language= "JavaScript" > fireserverevent (p1 = "First_parameter" P2 = "Second_parameter ");</script>
You need to create an event handler with Serveevent ( case sensitive ) to handle events. Next, access the data inside the event handler like this:
650) this.width=650; "src="/img/fz.gif "alt=" Copy Code "style=" border:0px; "/>
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_even T->P2 Endifendif
650) this.width=650; "src="/img/fz.gif "alt=" Copy Code "style=" border:0px; "/>
You can use the following code in an. htm file to periodically trigger a server event, that is, by using the SetInterval () method in JavaScript. In this example, it is triggered every 10 seconds.
<bsp:htmlbevent name = "Fireserverevent" id = "Fireserverevent"/><script language= "JavaScript" & Gt var ointerval = setinterval ("Fireserverevent ()", 10000);</script>
SAP CRM uses JavaScript to trigger SAP Server Event