cancel
Showing results for 
Search instead for 
Did you mean: 

EPCF and Java Applet

Former Member
0 Kudos

Hello All

I have 2 iviews, first with web dynpro app and second with java applet,

applet is embedded in dynpage.

I want pass parameters from applet to webdynpro.

I call javascript function in applet to fire portal event which is mapped to webdynpro action and everything should be fine but...

when i have both iviews in portal page, applet is unable to call javascript function

but when i open this page in new window everything is working fine.

pls can someone explain me how can i fix it?

Marek

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

Inside the portal page, are the iviews isolated ?

Check with the iview properties and accordingly put them as isolated.

i.e. The isolation method has to be set to embedded for the iview containing the applet and for the other iview the isolaton method has to be url.

Refer this <a href="http://help.sap.com/saphelp_nw04s/helpdata/en/97/0be13dc2fd605ae10000000a11405a/frameset.htm">link</a> for more details.

Award points if helpful.

Regards,

Sujana

Answers (3)

Answers (3)

Former Member
0 Kudos

Finally I found out the answer.

The problem was that javascript protocol couldn't find proper frame for function call in onpage javascript, it was caused by portal framework which produced new frames. To fix it has to be implemented parameter '_self' in this line:

getAppletContext().showDocument(new URL("javascript:sendXY("" + str +"")"),"_self");

Regards

Marek

Former Member
0 Kudos

it was some workaround but it did not resolve my problem...

i have configuration in iviews as You adviced, but it still doesn't help,

if i change isolation from embedded to url in applet iview it don't work at all in any way. I tryed with EPCF levels but it gave the same effect.

thanks for reply

Marek

Former Member
0 Kudos

i will print code from dynpage and applet:

dynpage:

Form myForm = this.getForm(); // get the form from DynPage

IPortalComponentResponse response = (IPortalComponentResponse)this.getResponse();

IPortalComponentRequest request = (IPortalComponentRequest) this.getRequest();

IResource res = request.getResource(IResource.APPLET, "applet/");

String myappletRes= res.getResourceInformation().getURL(request);

AppletContainer container = new AppletContainer();

container.setClassObject("NewApplet");

container.setName("myApplet");

container.setWidth("727");

container.setHeight("684");

container.setLibrary(myappletRes);

myForm.addComponent(container);

myForm.addRawText("<script> function sendXY(s) {EPCM.raiseEvent('urn:pl.myNameSpace, 'SendXYEvent', s);} </script>");

applet:

public void mouseReleased(MouseEvent e) {

p = e.getPoint();

str = p.x + "#" + p.y;

try {

getAppletContext().showDocument(new URL("javascript:sendXY(\"" + str +"\")"));

}catch (MalformedURLException me) { }

repaint();

}

maby it will help You solve it,

post any advices and idea You have pls

thanks in advance

Regards

Marek