Skip to end of metadata
Go to start of metadata

Author: Durairaj Athavan Raja
Submitted: 30th Jan 2007
Related Links:

  • BSP In-Depth: Using the HTMLB Event System
  • One of the often asked questions in BSP forum is how to catch onchange, onblur, etc kind of events for htmlb:inputField and this code snippet is to address the same. Also to undersand the htmlb event system, check out the linked weblog.
<%@page language="abap" %>
<%@extension name="htmlb" prefix="htmlb" %>

<%@extension name="bsp" prefix="bsp" %>
<htmlb:content design="design2003" >
<htmlb:page title="Input field client/server events " >
<htmlb:form>
     <htmlb:label for = "IP1" text = "Demo Server event" />
     <htmlb:inputField id = "IP1" size = "100" />
     <br>

     <htmlb:label for = "IP2" text = "Demo Client event" />
    <htmlb:inputField id = "IP2" size = "100" />
    <bsp:htmlbEvent id = "myid" name = "ValueChanged" />

    <script for="IP1" event=onchange type="text/javascript">
    ValueChanged();
     </script>
     <script for="IP2" event=onchange type="text/javascript">
    alert(this.value);
    </script>

</htmlb:form>
</htmlb:page>
</htmlb:content>