on 2007 Mar 13 7:26 AM
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
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>
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
69 | |
11 | |
10 | |
10 | |
9 | |
7 | |
7 | |
7 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.