Skip to Content
avatar image
Former Member

Pass parameters between 2 iview (EP6) builded with 2 BSP

Hello,

I've a problem correlated to the parameter transfer.

I've developed 2 different BSP pages on 2 different WAS 6.20, Support

packages 41. I've make applications stateful and 'Supports portal

integration' has been checked.

The 2 pages was used to create 2 different iViews (of BSP pages type)

in an Enterprise Portal 6 SP2. The 2 iViews has been placed on a single

page. I need to pass a value beetween the 2 iviews (i.e. the 2 BSP). I

thought to use portal eventing,... but I havn't found the right way.

Could You help me on this ? I havn't found any documentation either in

help.sap.com nor in sdn.sap.com.

Best Regard,

Luca Grilli

Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

3 Answers

  • Jul 03, 2004 at 07:39 PM

    Lucas,

    We have actually recently created a few tags to make it easy to use portal eventing. However, they have not yet made a service pack.

    I will give you here some cut and paste code. That should be more than enough to put anybody skilled in the art on the road.

    ++bcm

    function myPortalEPCM() {
      try{
         var ldFrame = window;
         while ( typeof(ldFrame.EPCM)=="undefined" && ldFrame != top)
            ldFrame = ldFrame.parent;
         return ldFrame.EPCM;
      }catch(ex){ }
    }
    
    function myPortalSubscribeEvent(namespace,eventname){
      try{
        epcm = myPortalEPCM();
        if (epcm.subscribeEventReliable){
           epcm.subscribeEventReliable( namespace, eventname, window, "myPortalEventHandler");
        }else{
           epcm.subscribeEvent( namespace, evName, eventname, "myPortalEventHandler");
        }
      }catch(ex){ }
    }
    
    function myPortalFireEvent(namespace,eventname,data,sourceId){
       try{
         epcm = myPortalEPCM();
         epcm.raiseEvent(namespace,eventname,data,sourceId);
      }catch(ex){ }
    }
    
    function myPortalEventHandler(event){
      var eventId   = event.eventNamespace + '&' + event.eventName;
      var eventData = event.dataObject + '&' + event.sourceId;
      htmlbSubmitLib('htmlb',this,'bsp:portalEvent:raised:null',document.getElementById("htmlb_first_form_id").value,'ID','eventRaised',2,eventId,eventData);
    }
    

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Jul 07, 2004 at 10:25 AM

    Fantastic! it works fine.

    I write here my test example.

    I've placed this code in the BSP page (which send the event and set the value):

    <%@page language="abap" %>

    <%@extension name="htmlb" prefix="htmlb" %>

    <head>

    <link rel=stylesheet href="../public/bc/bsp/styles/sapbsp.css">

    <%= runtime->session_manager->header_script( ) %>

    <script>

    function myPortalEPCM()

    { try{

    var ldFrame = window;

    while ( typeof(ldFrame.EPCM)=="undefined" && ldFrame != top)

    ldFrame = ldFrame.parent;

    return ldFrame.EPCM; }

    catch(ex){ }

    }

    function myPortalFireEvent(namespace,eventname,data,sourceId){

    try{

    epcm = myPortalEPCM();

    epcm.raiseEvent(namespace,eventname,data,sourceId);

    }catch(ex){ }

    }

    </script>

    </head>

    <htmlb:content design = "design2003"

    sessionManagement = "true" >

    <htmlb:page title=" " >

    <head>

    <link rel=stylesheet href="../public/bc/bsp/styles/sapbsp.css">

    <%= runtime->session_manager->header_script( ) %>

    </head>

    <htmlb:form>

    <htmlb:inputField id = "luca"

    value = "555555555555" />

    <htmlb:textView text = "Passa il valore"

    design = "EMPHASIZED" />

    <htmlb:button text = "VAI !!"

    id = "mb"

    onClick = "myClickHandler"

    onClientClick = "myPortalFireEvent('urn:com.techint','setvalue',document.getElementById('luca').value,null)"/>

    </htmlb:form>

    </htmlb:page>

    </htmlb:content>

    And in the getter page which receive the value.

    <%@page language="abap" %>

    <%@extension name="htmlb" prefix="htmlb" %>

    <head>

    <link rel=stylesheet href="../public/bc/bsp/styles/sapbsp.css">

    <%= runtime->session_manager->header_script( ) %>

    <script>

    function myPortalEPCM()

    { try{

    var ldFrame = window;

    while ( typeof(ldFrame.EPCM)=="undefined" && ldFrame != top)

    ldFrame = ldFrame.parent;

    return ldFrame.EPCM; }

    catch(ex){ }

    }

    function myPortalFireEvent(namespace,eventname,data,sourceId){

    try{

    epcm = myPortalEPCM();

    epcm.raiseEvent(namespace,eventname,data,sourceId);

    }catch(ex){ }

    }

    </script>

    </head>

    <htmlb:content design = "design2003"

    sessionManagement = "true" >

    <htmlb:page title=" " >

    <head>

    <link rel=stylesheet href="../public/bc/bsp/styles/sapbsp.css">

    <%= runtime->session_manager->header_script( ) %>

    </head>

    <htmlb:form>

    <htmlb:inputField id = "luca"

    value = "555555555555" />

    <htmlb:textView text = "Passa il valore"

    design = "EMPHASIZED" />

    <htmlb:button text = "VAI !!"

    id = "mb"

    onClick = "myClickHandler"

    onClientClick = "myPortalFireEvent('urn:com.techint','setvalue',document.getElementById('luca').value,null)"/>

    </htmlb:form>

    </htmlb:page>

    </htmlb:content>

    It works perfectly.

    My only doubt : how I can use the string that You suggest me?

    htmlbSubmitLib('htmlb',this,'bsp:portalEvent:raised:null',document.getElementById("htmlb_first_form_id").value,'ID','eventRaised',2,eventId,eventData);

    Thank a lot,

    Luca Grilli

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Jul 09, 2004 at 12:49 AM

    im doing something similar except using the ITS <-> EP6. i had difficulty getting the epcfproxy working correctly between the 2 however this code placed within the IAC template works perfectly.

    thanks.

    brad

    Add comment
    10|10000 characters needed characters exceeded