cancel
Showing results for 
Search instead for 
Did you mean: 

Opening 1 jsp from another

Former Member
0 Kudos

Hi,

I am opening one jsp on click of a button of another.

Button's even code is here:

InputField txt = (InputField) this.getComponentByName("InputName");
	IPortalComponentRequest req = (IPortalComponentRequest) this.getRequest();
	IPortalComponentResponse res = (IPortalComponentResponse) this.getResponse();
req.getComponentSession().putValue("openurl", "Yes");

Based on This value "Yes", another JSP is opened via this...


<%
try	{
	com.sapportals.portal.prt.component.IPortalComponentRequest componentRequest;
	String open = componentRequest.getComponentSession().getValue("openurl").toString();
	if(open.equals("Yes"))	{
%>
 	 <SCRIPT language="JavaScript"> 	 	
		 	EPCM.doNavigate("pcd:portal_content/Dev/EP1/testAPC");
	 </SCRIPT>
<% } 
}
catch(Exception ex)	{ %>
<%= "Test" %>
<%
}
%>

But i am getting exception...

Can you plz guide me in this?

Regards,

Dev

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

Can you specify the exception you get,

in any case the url used in EPCM.doNavigate() has the following format and your url specification is not right.

"ROLES://portal_content/folder1/role1/workset1/iView111"

In other words the pcd: is replaced with ROLES://

Please refer to the links below,

Navigation Target

http://help.sap.com/saphelp_nw04s/helpdata/en/18/3fb84033a8b533e10000000a155106/frameset.htm

For information on EPCM.doNavigate()

http://help.sap.com/saphelp_nw04s/helpdata/en/26/71c74030308431e10000000a1550b0/frameset.htm

Further more

<i><b>com.sapportals.portal.prt.component.IPortalComponentRequest componentRequest;

String open = componentRequest.getComponentSession().getValue("openurl").toString();</b></i>

This part of the code is not usually done.

What you have done is actually put a bean in the component session of type java.lang.String

Use the following declaration,

<jsp:useBean id="openurl" scope="session" class="java.lang.String"

/>

Check up the link for the reference,

http://help.sap.com/saphelp_nw04s/helpdata/en/f9/1b0f4186b5d349e10000000a1550b0/frameset.htm

This declaration will done above all your form elements

In your page you can direcly use "openurl" as a variable.

For example

<%

if(openurl != null)

{

if(openurl.equals("yes"))

{

//Write some code

}

}

%>

Regards,

Harish

(Please award points for helpful answers)

Message was edited by: HARISH SUBRAMANIAN

Message was edited by: HARISH SUBRAMANIAN

Answers (0)