on 06-23-2006 6:43 AM
Hi ,
Can some one tell me how to redirect the page
From one JspDynpage to another JspDynpage.....
Thanks,
Sandeep
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
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
User | Count |
---|---|
93 | |
10 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.