cancel
Showing results for 
Search instead for 
Did you mean: 

subscripe to the event and decideon which Jsp to display

Former Member
0 Kudos

Hallo Ep'ers

I want to create a page in which 2 iviews will be placed with Isolation method as Url.

when the page is opened i want to show both iviews in their initial state.So far so good.It is working.When a event is raised from first iview i want to change the view in second iview.

I have created a dynpage jsp portal archive with 2 jsp's(initial,result).In the initial.jsp i have subscribed to a event using EPCM.subscribe. Now i do not know how to set a switch by which doProcessBeforeOutput method decide on which Jsp to direct.

Can anyone please help me ??

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi,

if u have two jspdynpage components, then you can call the second page directly as follows:

<b><script>

EPCM.subscribeEvent("urn:...", "<event Name>", <function name>);

function <function name>(){

window.location="<ProjectName.ComponentName>";

}

</script></b>

Hope this helps.

Former Member
0 Kudos

Hi Ranjith,

Thanks for your answer,i have tried your code also but it doesnt work either.I am not sure what is wrong in it.

Former Member
0 Kudos

Hallo Everyone,

Thanks to prakash singh for his wonderful webblog.i have solved this problem.

people who are intrested in the solution can have a look into this webblog from prakash singh.

and refer How to use EPCM to trigger a server side event

Former Member
0 Kudos

Hi,

Maybe you can put a "flag" into the url of your portal component and then you can get it within your server side code. I try to explain you my idea.

Within the jscript function which manage the event subscription, you perform a redirect to the same address of the portal component, but adding a flag. For example;

<script>

//I don't remember the right sintax

EPCM.subscribeEvent("urn:...", "<event Name>", <function name>);

function <function name>(eventObject){

var url = window.location.href;

url += "?flag=yes"

//this perform component recalculation

window.location.replace(url);

}

</script>

on server side, within doProcessBeforeOutput you:

get the request object and then you get the flag:

IPortalComponentRequest request = PortalComponentRequest this.getRequest();

String flag = request.getParameter("flag");

if (flag.equals("yes")){

this.setJspName("result.jsp");

}else{

this.setJspName("initial.jsp");

}

I don't know if could be a helpfull idea for you or not

Hope this help

Ciao

Roberto

Former Member
0 Kudos

Hi Roberto,

Thanks for your response.I have made changes as you suggested but it is not working.I have seen with alert command that url has flag parameter "yes".I am not sure what happends after location.replace.

it looks like flag parameter wasnt available in doProcessBeforeOutput.