Skip to Content
author's profile photo Former Member
Former Member

Help Navigation between JSPDynpages on EP

I have two JSPDynpages. The first page takes input as Material number and has a search button on it. On clicking the search button second page comes up and display the details of that material. I have been able to connect to R/3 system using JCO and execute a BAPI to get the material detail from R/3. I have specified the target page in the event handler of the search button such that on clicking the search button control transfers to the second page that displays the detail for that material number.This is working fine for me using tomcat PDK. Also for the data transfer iam using beans and storing the bean objects in session to transfer between pages.

Now i create a new Portal Application project in Netweaver Development kit and copy all my java files and jsps to it and export the par file.In the portal content directory I create a wokset and add two iViews (created iViews from par file) directly to this workset (one iView with material number input field along with search button and the second iView to display the material details).Please note that I am adding iViews directly to the workset instead of adding them to pages and then to the workset. I can see both the iViews in the detailed navigation section but now when I click the search button control doesn't pass to the second iView. Can some one please let me know how is navigation controlled on EP? I also tried using EPCM but that doesn't show material data on the second page.I would appreciate any help in this regard.

Thanks,

Vaibhav Gupta

Add a comment
10|10000 characters needed characters exceeded

Related questions

6 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Oct 18, 2005 at 06:15 PM

    Iam posting the code.Please help.

    File SearchMaterial.JSP - The first page that asks a user for input

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

    <%@page import="com.capgemini.clx.pdm.*;" %>

    <jsp:useBean id="myBean" scope="request" class="com.capgemini.clx.pdm.SearchMaterialBean" />

    <hbj:content id="myContext" >

    <hbj:page title="PageTitle">

    <script type="text/javascript">

    function testfun()

    {

    return EPCM.doNavigate('ROLES://portal_content/com.capgemini.clx.pdm.vg.PDTRID/com.capgemini.clx.pdm.vg.CUSIVID/com.capgemini.clx.pdm.vg.SRID');

    }

    </script>

    <%

    SearchMaterialBean smbean=(SearchMaterialBean)session.getAttribute("SearchCrit");

    if(smbean==null)

    {

    smbean=new SearchMaterialBean();

    }

    %>

    <hbj:form id="myFormId" >

    <table width="359" border="0">

    <tr>

    <td width="165">

    <hbj:textView

    id="Material_Info"

    text="Material Information"

    design="emphasized"/>

    </td>

    <td width="178"><input type="text" name="materialInformation" value="<%=smbean.getMaterialInformation()%>" /></td>

    </tr>

    <tr>

    <td>

    <hbj:textView

    id="Search_Criterion"

    text="Search Criterion"

    design="emphasized"/>

    </td>

    <td>

    <select name="searchCriterion">

    <option value="number"> Material Number </option>

    <option value="description"> Material Description </option>

    <option value="oldnumber">Old Material Number </option>

    <option value="catgeory"> Material Category </option>

    <option value="group"> Material Group </option>

    <option value="materialType"> Material Type </option>

    </select>

    </td>

    </tr>

    <tr>

    <td>&nbsp;</td>

    <td>

    <hbj:button

    id="SearchMaterial"

    text="Search"

    onClick="start_Search"

    disabled="false"

    design="STANDARD"

    />

    </td>

    </tr>

    </table>

    <a href="myLink" onclick="return EPCM.doNavigate('ROLES://portal_content/com.capgemini.clx.pdm.vg.PDTRID/com.capgemini.clx.pdm.vg.CUSIVID/com.capgemini.clx.pdm.vg.SRID')"> LINK </a>

    </hbj:form>

    </hbj:page>

    </hbj:content>

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Oct 18, 2005 at 06:16 PM

    SearchMaterial.java - The JSPDynpage of the SearchMaterial.jsp file

    package com.capgemini.clx.pdm;

    import com.sapportals.htmlb.*;

    import com.sapportals.htmlb.enum.*;

    import com.sapportals.htmlb.event.*;

    import com.sapportals.htmlb.page.*;

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

    import com.sapportals.portal.prt.component.*;

    public class SearchMaterial extends PageProcessorComponent {

    public DynPage getPage(){

    return new SearchMaterialDynPage();

    }

    public static class SearchMaterialDynPage extends JSPDynPage{

    String targetPage="SearchMaterial.jsp";

    public void doInitialization(){

    }

    public void doProcessAfterInput() throws PageException {

    IPortalComponentRequest request=(IPortalComponentRequest)this.getRequest();

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

    DataCapturer dc=new DataCapturer();

    dc.captureSearchCriteria(request.getServletRequest(),request);

    RetrieveData rd=new RetrieveData();

    rd.getMaterialDetail(request.getServletRequest());

    }

    public void onStart_Search(Event event) throws PageException

    {

    /*

    IPortalComponentRequest request=(IPortalComponentRequest)this.getRequest();

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

    response.write("Clicked the button");

    DataCapturer dc=new DataCapturer();

    dc.captureSearchCriteria(request.getServletRequest(),request);

    RetrieveData rd=new RetrieveData();

    rd.getMaterialDetail(request.getServletRequest());

    */

    targetPage="MaterialSearchResult.jsp";

    }

    public void doProcessBeforeOutput() throws PageException {

    //Form myForm=this.getForm();

    SearchMaterialBean myBean = new SearchMaterialBean();

    ((IPortalComponentRequest)getRequest()).getServletRequest().setAttribute("myBean", myBean);

    // fill your bean with data here...

    //myForm.addRawText("<script>EPCM.doNavigate('ROLES://portal_content/com.capgemini.clx.pdm.vg.PDTRID/com.capgemini.clx.pdm.vg.CUSIVID/com.capgemini.clx.pdm.vg.SRID');</script>");

    this.setJspName(targetPage);

    }

    }

    }

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Oct 18, 2005 at 06:35 PM

    MaterialSearchResult.jap - The second jsp to display the data retrieved from the R/3

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

    <%@page import="com.capgemini.clx.pdm.*;" %>

    <jsp:useBean id="myBean" scope="request" class="com.capgemini.clx.pdm.MaterialSearchResultBean" />

    <hbj:content id="myContext" >

    <hbj:page title="PageTitle">

    <%

    MaterialSearchResultBean msrbean=(MaterialSearchResultBean)session.getAttribute("MaterialData");

    if(msrbean==null)

    {

    msrbean=new MaterialSearchResultBean();

    }

    %>

    <hbj:form id="myFormId" >

    <table width="387" border="0">

    <tr>

    <td colspan="2">

    <div align="center">

    <hbj:textView

    id="result"

    text="Material Search Result"

    design="emphasized"/> </div> </td>

    </tr>

    <tr>

    <td width="211">

    <div align="right">

    <hbj:textView

    id="desc"

    text="Material Description:"

    design="emphasized"/>

    </div></td>

    <td width="160">

    <hbj:textView

    id="descval"

    text="<%=msrbean.getMaterialDescription()%>"

    />

    </td>

    </tr>

    <tr>

    <td>

    <div align="right">

    <hbj:textView

    id="omn"

    text="Old Material Number:"

    design="emphasized"/>

    </div></td>

    <td>

    <hbj:textView

    id="oldval"

    text="<%=msrbean.getOldMaterialNumber()%>"

    />

    </td>

    </tr>

    <tr>

    <td>

    <div align="right">

    <hbj:textView

    id="mtype"

    text="Material Type:"

    design="emphasized"/>

    </div></td>

    <td>

    <hbj:textView

    id="typeval"

    text="<%=msrbean.getMaterialType()%>"

    />

    </td>

    </tr>

    <tr>

    <td>

    <div align="right">

    <hbj:textView

    id="sector"

    text="Industry Sector:"

    design="emphasized"/>

    </div></td>

    <td>

    <hbj:textView

    id="indsecval"

    text="<%=msrbean.getIndustrySector()%>"

    />

    </td>

    </tr>

    <tr>

    <td>

    <div align="right">

    <hbj:textView

    id="div"

    text="Division:"

    design="emphasized"/>

    </div></td>

    <td>

    <hbj:textView

    id="divisionval"

    text="<%=msrbean.getDivision()%>"

    />

    </td>

    </tr>

    <tr>

    <td>

    <div align="right">

    <hbj:textView

    id="mgroup"

    text="Material Group:"

    design="emphasized"/>

    </div></td>

    <td>

    <hbj:textView

    id="matgpval"

    text="<%=msrbean.getMaterialGroup()%>"

    />

    </td>

    </tr>

    <tr>

    <td>

    <div align="right">

    <hbj:textView

    id="phierarchy"

    text="Product Hierarchy:"

    design="emphasized"/>

    </div></td>

    <td>

    <hbj:textView

    id="descval"

    text="<%=msrbean.getProductHierarchy()%>"

    />

    </td>

    </tr>

    <tr>

    <td>

    <div align="right">

    <hbj:textView

    id="bmat"

    text="Basic Material:"

    design="emphasized"/>

    </div></td>

    <td>

    <hbj:textView

    id="basicmatval"

    text="<%=msrbean.getBasicMaterial()%>"

    />

    </td>

    </tr>

    <tr>

    <td>

    <div align="right">

    <hbj:textView

    id="isd"

    text="Industry Standard Description:"

    design="emphasized"/>

    </div></td>

    <td>

    <hbj:textView

    id="isdval"

    text="<%=msrbean.getIndustryStandard()%>"

    />

    </td>

    </tr>

    </table>

    </hbj:form>

    </hbj:page>

    </hbj:content>

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Oct 18, 2005 at 06:36 PM

    MaterialSearchResult.java- The JSPDynpage for the MaterialSearchResult.jsp

    package com.capgemini.clx.pdm;

    import com.capgemini.clx.pdm.MaterialSearchResultBean;

    import com.sapportals.htmlb.*;

    import com.sapportals.htmlb.enum.*;

    import com.sapportals.htmlb.event.*;

    import com.sapportals.htmlb.page.*;

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

    import com.sapportals.portal.prt.component.*;

    public class MaterialSearchResult extends PageProcessorComponent {

    public DynPage getPage(){

    return new MaterialSearchResultDynPage();

    }

    public static class MaterialSearchResultDynPage extends JSPDynPage{

    public void doInitialization(){

    }

    public void doProcessAfterInput() throws PageException {

    }

    public void doProcessBeforeOutput() throws PageException {

    MaterialSearchResultBean myBean = new MaterialSearchResultBean();

    ((IPortalComponentRequest)getRequest()).getServletRequest().setAttribute("myBean", myBean);

    // fill your bean with data here...

    this.setJspName("MaterialSearchResult.jsp");

    }

    }

    }

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Oct 18, 2005 at 06:37 PM

    PortalApp.xml

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

    <application>

    <application-config>

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

    </application-config>

    <components>

    <component name="SearchMaterial">

    <component-config>

    <property name="ClassName" value="com.capgemini.clx.pdm.SearchMaterial"/>

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

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

    </component-config>

    <component-profile>

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

    </component-profile>

    </component>

    <component name="MaterialSearchResult">

    <component-config>

    <property name="ClassName" value="com.capgemini.clx.pdm.MaterialSearchResult"/>

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

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

    </component-config>

    <component-profile>

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

    </component-profile>

    </component>

    </components>

    <services/>

    </application>

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Oct 18, 2005 at 06:40 PM

    Please help me. Also do let me know if you guys need some more information. Note that this code is working fine with tomcat PDK but i am having problem with EP. The code has some more java files

    DataCapturer.java

    Beans

    RetrieveData.java

    But these files have logic to retrive data from R/3. Let me know if you would like to see these files too.

    Thanks in advance.

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.