Skip to Content
0
Former Member
Jan 30, 2005 at 10:43 AM

Reciever IView not listening?

28 Views

Hi,

I'm trying to learn EPCM eventing. I went through the

howto guide of client side eveting. However, I could not

have the example mentioned in the guide working. Then, I

tried to simplify the example to have one IView as a

sender and a reciever. Following is the BW template code

(which is then embedded in a BW IView):

<html>
<!-- BW data source object tags -->
<object>
         <param name="OWNER" value="SAP_BW"/>
         <param name="CMD" value="SET_PROPERTIES"/>
         <param name="TEMPLATE_ID" value="Y_SENDER"/>
         TEMPLATE PROPERTIES 
</object>

<head />
<body>
<script language=javascript> 
  <!-- 
  function eventRecieved( eventObj ) { 
    document.getElementById("Reciever").innerHTML = 
        "<b>" + eventObj.dataObject + "<b>";
  } 
  function raiseEvent(value) { 
    EPCMPROXY.raiseEvent("urn:com.sap:BWEvents", 
       "ChangeSpanText", value, null); 
    document.getElementById("Comment").innerHTML=
             "<b>value=" + value + "</b> ";
  } 
  --> 
</script>

<form name="myform"> 
  <select class="SAPBexDdl" name="myselect" size="1"
  onchange=
"raiseEvent(this.options[this.selectedIndex].value);">
    <option value="9COM" >Send 9COM</option> 
    <option value="9CAT" >Send 9CAT</option> 
  </select><br>
  <input type="button" value="Fire a test event"
   onclick="raiseEvent('Testing raiseEvent');" />
</form>
<br>
<span id="Comment">Comment</span><br>
<span id="Reciever">Reciever</span>
<script language=javascript> 
  <!-- 
  EPCMPROXY.subscribeEvent("urn:com.sap:BWEvents",  
      "ChangeSpanText", window, "eventRecieved"); 
  --> 
</script>
</body>
</html>

The event is raised correctly, however, the

eventRecieved

method is never executed. Any idea on how to work around

this problem please?

Thanks.