Skip to Content
author's profile photo Former Member
Former Member

Client Eventing

I am trying to get started with a simple test to verify that the EPCF is working according to documentation.

I have created an html page that should simply display the version of the EPCM object by doing the following.

<script>document.write (EPCM.getVersion());</script>

Then I created a .NET iView with the url to this html page and also selected "bypass iView server".

When I load this iView on a portal page I get an error "EPCM is undefined".

I didn't think I needed to include any files to make this work. I thought from the documentation that any iViews loaded on a portal page automatically include the necessary files to use this framework. Is there something simple I am missing?


Add comment
10|10000 characters needed characters exceeded

1 Answer

  • author's profile photo Former Member
    Former Member
    Posted on May 04, 2004 at 12:15 AM

    yes, i believe something "simple" yet not-so-obvious is missing.

    indeed, iviews and contents created in the portal automatically have the epcf files included. but the problem here is, your little html page is external content, at least from the portal's point of view. when loaded into the iview, the portal most likely places the external html contents in a separate iframe.

    the solution is EPCMPROXY object, which is defined in a epcfproxy.js file. you must include it in your external html file, and in the script snippet, use EPCMPROXY instead of EPCM, for example EPCMPROXY.getVersion(). this is well documented in the client framework section in ep6.

    also, due to cross frame scripting, you may need to perform domain relaxation in js. plus, make sure you access the portal and the url to your html page using the full domain path, for example instead of simply http://server/page.html. again, this is documented in the client framework section and is sometimes referred to as the java origin policy.

    hope this helped and good luck.

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

      Thanks for the reply. I think the EPCMPROXY has helped, but I am still not quite there. Now I don't get the "undefine" error, but when I call the EPCMPROXY.getVersion() function the result I get is the word "null". I get the same result for all methods that I call.

      Current script:

      <SCRIPT src="epcfproxy.js"></SCRIPT>




      var lnDotPos = document.domain.indexOf( "." );

      if (lnDotPos >= 0)

      document.domain = document.domain.substr( lnDotPos + 1 );

      document.write ('EPCM '+EPCMPROXY.getVersion());


      Any ideas? I appreciate your help!