Tag: javascript

Implementing Character Limit Feature for TextArea Element in a BSP with JavaScript

Here is a good example of using JavaScript in WebUI BSPs. In this example, we will try to implement character limit functionality for a TextArea field in a bsp. First of all, we need to ID property of Html Element of the Text Field. To get that, we could use below code in .htm. DATA lv_textArea_id TYPE string. CONCATENATE controller->component_id '_search_message' INTO lv_textArea_id. The "search" phrase, in concatenate action, is the name of the context node of the property that ge
Read More »

How To Trigger SAP Server Event With Javascript

In order to trigger a server even with Javascript from a BSP, you need to generate a Javascript function with <bsp:event> tag in your .htm file, which you can then use inside a script. You can pass two parameters with it as well if you desire. <bsp:htmlbEvent name = "fireServerEvent" Id = "fireServerEvent" p1 = "p1" p2 = "p2" /> You can then use the generated function as below <script language="javascript"> fireSe
Read More »