cancel
Showing results for 
Search instead for 
Did you mean: 

two iviews in the same page

Former Member
0 Kudos

hi

i have created two iviews in the same page based on the two jspdynpage components.

i am displaying a tableview on the ist view..on on cell click i hav to pass an the value in the cell(of ist view) to the second view...

how do i call the second view with passing this argument...

please tell the code to proceed .

looking forward for ur response.

thanks

bidyut dutta

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Try this code and let me know the results.

EPCF1.java(producer of event)

===============================

package com.epcf;

import com.sapportals.htmlb.page.DynPage;

import com.sapportals.htmlb.page.PageException;

import com.sapportals.portal.htmlb.page.JSPDynPage;

import com.sapportals.portal.htmlb.page.PageProcessorComponent ;

public class EPCF1 extends PageProcessorComponent {

public DynPage getPage(){

return new EPCF1DynPage();

}

public static class EPCF1DynPage extends JSPDynPage{

public void doInitialization(){

}

public void doProcessAfterInput() throws PageException {

}

public void doProcessBeforeOutput() throws PageException {

this.setJspName("EPCFProducer.jsp");

}

}

}

EPCF2.java(consumer of the event)

===================================

package com.epcf;

import com.sapportals.htmlb.page.DynPage;

import com.sapportals.htmlb.page.PageException;

import com.sapportals.portal.htmlb.page.JSPDynPage;

import com.sapportals.portal.htmlb.page.PageProcessorComponent ;

public class EPCF2 extends PageProcessorComponent {

public DynPage getPage(){

return new EPCF2DynPage();

}

public static class EPCF2DynPage extends JSPDynPage{

public void doInitialization(){

}

public void doProcessAfterInput() throws PageException {

}

public void doProcessBeforeOutput() throws PageException {

this.setJspName("EPCFConsumer.jsp");

}

}

}

EPCFProducer.jsp

================

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

<hbj:content id="myContext" >

<hbj:page title="PageTitle">

<script>

function buttonClick()

{

var name = 'hi';

alert('hi');

EPCM.raiseEvent("urn:com.epcf.EPCFProducer", "clickEvent", name);

alert('hi');

}

</script>

<hbj:form id="myFormId" >

<hbj:button

id="myButton"

text="click"

width="125px"

tooltip="click here"

onClientClick="JavaScript:buttonClick();"

/>

</hbj:form>

</hbj:page>

</hbj:content>

EPCFConsumer.jsp

=================

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

<hbj:content id="myContext" >

<hbj:page title="PageTitle">

<script>

function eventHandler(event)

{

myFormId.data.value=event.dataObject;

}

EPCM.subscribeEvent("urn:com.epcf.EPCFProducer", "clickEvent", eventHandler);

</script>

<form id="myFormId" >

The string passed is:

<input type="text" value="" name="data"/>

</form>

</hbj:page>

</hbj:content>

portalapp.xml

================

<?xml version="1.0" encoding="utf-8"?>

<application>

<application-config>

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

</application-config>

<components>

<component name="EPCF1">

<component-config>

<property name="ClassName" value="com.epcf.EPCF1"/>

</component-config>

<component-profile>

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

</component-profile>

</component>

<component name="EPCF2">

<component-config>

<property name="ClassName" value="com.epcf.EPCF2"/>

</component-config>

<component-profile>

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

</component-profile>

</component>

</components>

<services/>

</application>

Answers (2)

Answers (2)

Former Member
0 Kudos

thanks Mohan

cheers

Former Member
0 Kudos

Hi Bidyut,

Please go through the similar threads below..

Hope these help..

Regards

Kiran..