cancel
Showing results for 
Search instead for 
Did you mean: 

JspDynPage - JspDynPage Communication ???

Former Member
0 Kudos

Hi ,

Can some one tell me how to redirect the page

From one JspDynpage to another JspDynpage.....

Thanks,

Sandeep

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

You could use a switch case in "doProcessBeforeOutput" method and redirect to the appropriate page you want for example:

public void doProcessBeforeOutput() {

// Set All corresponding JSP files based on the action

switch (ACTUAL_STATE) {

case 1:

this.setJspName("One.jsp");

break;

case 2:

this.setJspName("Two.jsp");

break;

}

}

and you could set the value of ACTUAL_STATE, to 1 or 2 in the server side even handler methods, based on user actions.

Hope this helps

Regards

Padmaja

Former Member
0 Kudos

Can you please have a look at this code & tell me where I went wrong.

<b>Jsp.jsp -- Jsp File</b>

<!-- HTMLB -->

<%@ taglib uri="tagLib" prefix="hbj" %>

<hbj:content id="myContext" >

<hbj:page title="PageTitle">

<hbj:form id="myFormId" >

<hbj:button

id = "EventTesting"

text = "Event Check"

tooltip = "Both Client Side & Server Side Event Testing..."

disabled = "false"

onClientClick="validate()"

onClick = "onControllerValidate"

design="emphasized"

/>

</hbj:form>

</hbj:page>

</hbj:content>

<b>RedirectJsp.jsp --- Another Jsp File</b>

<html>

It Works.....

</html>

<b>Jsp123 --- JspDynPage</b>

public void doProcessAfterInput() throws PageException {

}

public void doProcessBeforeOutput() throws PageException {

if(flag==0)

this.setJspName("Jsp.jsp");

if(flag==1)

this.setJspName("RedirectJsp.jsp");

}

public void onControllerValidate(Event event) {

flag = 1;

}

<b>portalapp.xml --- XML File</b>

<components>

<component name="Jsp123">

<component-config>

<property name="ClassName" value="practice.accenture.Jsp123"/>

<property name="ComponentType" value="jspnative"/>

<property name="JSP" value="pagelet/Jsp.jsp"/>

</component-config>

<component-profile>

<property name="tagLib" value="/SERVICE/htmlb/taglib/htmlb.tld"/>

</component-profile>

</component>

</components>

Thanks & Regards,

Sandeep

Former Member
0 Kudos

Please change this line in your JSP to

onClick = "onControllerValidate" -


this is wrong

<b>onClick = "ControllerValidate" ---this is correct.</b>

Let me know if it works

Pls reward if you find this helpful

Regards

Padmaja

Former Member
0 Kudos

Hi,

There is absolutely no problem with the name of the onClick method. The problem is here.

Remove these two lines from the portalapp.xml.

<property name="ComponentType" value="jspnative"/>

<property name="JSP" value="pagelet/Jsp.jsp"/>

and change the "PrivateSharingProperty" as "SharingProperty" in the application-config.

It will work.

Do like this. Declare

private static final int last = 1;

private static final int initial = 0;

private static int state = initial;

doProcessBeforeOutput(){

switch(state){

case initial:

this.setJspName("first.jsp");

break;

case last:

this.setJspName("last.jsp");

break;

}

}

doProcessAfterInput(){

state = last;

}

onControllerValidate

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

response.write("Button Clicked");

}

Ur Portalapp.xml should look similar to

<application>

<application-config>

<property name="SharingReference" value="com.sap.portal.htmlb"/>

</application-config>

<components>

<component name="MainPage">

<component-config>

<property name="ClassName" value="com.sample.MainPage"/>

</component-config>

<component-profile>

<property name="tagLib" value="/SERVICE/htmlb/taglib/htmlb.tld"/>

</component-profile>

</component>

</components>

<services/>

</application>

Regards,

Harini S

Murali_Shanmu
Active Contributor
0 Kudos

Yes, I agree with harini. As long as the event name and Method name exactly match, there is no issue.

Murali

Former Member
0 Kudos

Hi,

Didn't my solution solve ur problem?

If so, please mark my answer as 'Problem Solved'

Regards,

Harini S

Answers (0)