cancel
Showing results for 
Search instead for 
Did you mean: 

EP7 Migration giving errors on Cross Window JavaScript coding

Former Member
0 Kudos

We are in the process of migrating to EP7 and a are hitting issues with Cross window Java Script that do not occur on our EP6 platform.

We have applications which launch popup windows where the user can enter further details and then save.

On Save the Java Script function uses top.opener to call a function on the original page to savev the information, update a flag on the original screen to show information has been added and then close the popup.

All this activity works fine on EP6 but after migrating our content to EP7 we get a Java error.

Initially I thought it may have been the length URL for the Window ID but the contents position is no different in the PCD than in EP6. Even so I re-arrange the RoleWorksetPage and iView to produce a much shorter URL and still got the error:

__________________________________________________________

Line: 1269

Char: 2

Error: Object required

Code: 0

URL: https://amsdc1-s-6152.com/irj/servlet/prt/portal/prtroot/pcd!

3aportal_content!2fcom.role!2fcom.ws!2fcom.page!2fcom.iview?

InitialNodeFirstLevel=true&windowId=WID1180009971556

__________________________________________________________

Has anyone else experiences this issue or something similar with JavaScript on the EP7 platform.

We are on EP7 SP10 using SPNego Authentication if that helps.

Thanks for any help you can provide - points will be awarded for anything constructive.

Steve.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Steve,

The host+domain name looks incorrect. If the domains are not the same for caller and callee components, you will likely get domain cross scripting issues.

-jwise

Answers (1)

Answers (1)

brad_landry2
Active Contributor
0 Kudos

Hi Steve,

Joshua have a point, you could verify your hostname in the url generator :

System Admin \ System config \ Knowledge management \ Global Services (Show advanced options) \ Url Generator Services.

We had some minor error with our custom development after our upgraded to EP7.

I suggest you load all your custom program in the 2004s developer studio, and load all the apis from EP7. Some apis from EP6 won't work on EP7. Most of the time it's really minor changes.

Brad

Former Member
0 Kudos

Joshua/Brad,

Thanks for your helpful answers.

My next question is, which jar library do I need in EP7.

In EP6 we used the urlgeneratorapi.jar but this no longer exists in EP7.

Regards,

Steve.

Former Member
0 Kudos

Here is the code used to generate the URL:

	public String GeneratePortalURL(String PortalID,IPortalComponentRequest request,boolean isPage ){
			String tempURL = "";
			// get the url generator service
			IUrlGeneratorService urlGen = (IUrlGeneratorService) request.getService(IUrlGeneratorService.KEY);
			// get Specialized Portal Url Generator
			IPortalUrlGenerator portalGen = null;
			ISpecializedUrlGenerator specUrlGen = urlGen.getSpecializedUrlGenerator(IPortalUrlGenerator.KEY);
			if (specUrlGen instanceof IPortalUrlGenerator) {
				portalGen = (IPortalUrlGenerator) specUrlGen;
				// generate Page Url
				try {
					if(isPage){
						tempURL = portalGen.generatePortalPageUrl(request, PortalID);
					} else{
						tempURL =portalGen.generatePortalComponentUrl(request, PortalID);
					}
				} catch (NullPointerException e) {
					tempURL ="";
				} catch (UnknownPageIdException e) {
					tempURL ="";
				}
			}
			return tempURL;
	}

Are the same methods available in EP7 and if not can you provide advice on how this can be adapted?

Regards,

Steve.

Former Member
0 Kudos

As an update to this the issue was with how EP7 handles the onClick event.

We substituted the call to this event with the code inside the event in all places and it fixed the problem:

var head = ForwardHiddenID.substring(0, ForwardHiddenID.lastIndexOf("_"));

var tail = ForwardHiddenID.substring(ForwardHiddenID.lastIndexOf("_") + 1, ForwardHiddenID.length);

var result = htmlbDoEvent(this,'X','onclick','0',head,tail,2,'',0);