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

REG:htmlb table..VERY URGENT

Hi,

I am trying to create a htmlb table. my code looks as follows:

<b>Dynpage</b>

package com.linde.myaccounts.paymyaccountprelogin.dynpage;

import java.io.IOException;

import javax.naming.Context;

import com.linde.myaccounts.util.TableBean;

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;

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

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

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

import com.sapportals.portal.prt.runtime.PortalRuntime;

public class PayMyAccountPreLoginDynpage extends PageProcessorComponent {

public DynPage getPage(){

return new PayMyAccountPreLoginDynpageDynPage();

}

public static class PayMyAccountPreLoginDynpageDynPage extends JSPDynPage{

private TableBean myBean = null;

public void doInitialization(){

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

IPortalComponentProfile profile = ((IPortalComponentRequest)getRequest()).getComponentContext().getProfile();

Object o = profile.getValue("myBean");

try {

response.getWriter().write("hi");

} catch (IOException e) {

// TODO Auto-generated catch block

e.printStackTrace();

}

if(o==null || !(o instanceof TableBean)){

try {

response.getWriter().write("hi1");

} catch (IOException e) {

// TODO Auto-generated catch block

e.printStackTrace();

}

myBean = new TableBean();

profile.putValue("myBean",myBean);

try {

response.getWriter().write("hi2");

} catch (IOException e) {

// TODO Auto-generated catch block

e.printStackTrace();

}

} else {

myBean = (TableBean) o;

}

// fill your bean with data here...

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

//doJca(request);

}

public void doProcessAfterInput() throws PageException {

}

public void doProcessBeforeOutput() throws PageException {

this.setJspName("PayMyAccountPreLoginStep1.jsp");

}

}

}

<b>JSP</b>

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

<jsp:useBean id="myBean" scope="application" class="com.linde.myaccounts.util.TableBean" />

<hbj:content id="myContext" >

<hbj:page title="PageTitle">

<hbj:form id="myFormId" >

<hbj:tableView

id="myTableView1"

model="myBean.model"

design="ALTERNATING"

headerVisible="true"

footerVisible="true"

fillUpEmptyRows="true"

navigationMode="BYLINE"

selectionMode="MULTISELECT"

headerText="TableView example 1"

onNavigate="myOnNavigate"

visibleFirstRow="1"

visibleRowCount="30"

width="500 px"

/>

</hbj:form>

</hbj:page>

</hbj:content>

<b>TableBean</b>

package com.linde.myaccounts.util;

/**

  • @author zm46187

*

  • To change the template for this generated type comment go to

  • Window&gt;Preferences&gt;Java&gt;Code Generation&gt;Code and Comments

*/

import java.io.Serializable;

import java.util.Vector;

import com.sapportals.htmlb.table.DefaultTableViewModel;

import com.sapportals.htmlb.table.TableViewModel;

public class TableBean implements Serializable {

public DefaultTableViewModel model;

public TableViewModel getModel() {

return this.model;

}

public void setModel(DefaultTableViewModel model) {

this.model = model;

}

public void createData() {

//this is your column names

Vector column = new Vector();

column.addElement("Company Code");

column.addElement("Company Name");

//all this logic is for the data part.

Vector rVector = new Vector();

try {

for(int i=0;i<3;i++) {

Vector data = new Vector();

data.addElement("COMP_CODE" + i);

data.addElement("COMP_NAME" + i);

rVector.addElement(data);

}

} catch (Exception e) {

e.printStackTrace();

}

//this is where you create the model

this.setModel(new DefaultTableViewModel(rVector, column));

}

}

I have removed the jspnative and jsp from the portalapp.xml

And the error message I m getting is

#1.5 #0008742E905D0073000000B40000056400043F6FD35A984F#1195649426516#com.sap.portal.portal#sap.com/irj#com.sap.portal.portal#Administrator#8270##bcr45pc0122.corp_BOC_3400650#Administrator#32f213d0983011dccabe0008742e905d#SAPEngine_Application_Thread[impl:3]_17##0#0#Error#1#/System/Server#Java###Exception ID:06:20_21/11/07_0091_3400650

[EXCEPTION]

#1#com.sapportals.portal.prt.component.PortalComponentException: Error in service call of Resource

Component : LindeMyAccountWeb.PayMyAccountPreLoginDynpage

Component class : com.linde.myaccounts.paymyaccountprelogin.dynpage.PayMyAccountPreLoginDynpage

User : Administrator

at com.sapportals.portal.prt.core.PortalRequestManager.handlePortalComponentException(PortalRequestManager.java:969)

at com.sapportals.portal.prt.core.PortalRequestManager.dispatchRequest(PortalRequestManager.java:444)

at com.sapportals.portal.prt.core.PortalRequestManager.dispatchRequest(PortalRequestManager.java:527)

at com.sapportals.portal.prt.component.AbstractComponentResponse.include(AbstractComponentResponse.java:89)

at com.sapportals.portal.prt.component.PortalComponentResponse.include(PortalComponentResponse.java:232)

at com.sapportals.portal.htmlb.page.JSPDynPage.doOutput(JSPDynPage.java:76)

at com.sapportals.htmlb.page.PageProcessor.handleRequest(PageProcessor.java:129)

at com.sapportals.portal.htmlb.page.PageProcessorComponent.doContent(PageProcessorComponent.java:134)

at com.sapportals.portal.prt.component.AbstractPortalComponent.serviceDeprecated(AbstractPortalComponent.java:209)

at com.sapportals.portal.prt.component.AbstractPortalComponent.service(AbstractPortalComponent.java:114)

at com.sapportals.portal.prt.core.PortalRequestManager.callPortalComponent(PortalRequestManager.java:328)

at com.sapportals.portal.prt.core.PortalRequestManager.dispatchRequest(PortalRequestManager.java:136)

at com.sapportals.portal.prt.core.PortalRequestManager.dispatchRequest(PortalRequestManager.java:189)

at com.sapportals.portal.prt.component.PortalComponentResponse.include(PortalComponentResponse.java:215)

at com.sapportals.portal.prt.pom.PortalNode.service(PortalNode.java:646)

at com.sapportals.portal.prt.core.PortalRequestManager.callPortalComponent(PortalRequestManager.java:328)

at com.sapportals.portal.prt.core.PortalRequestManager.dispatchRequest(PortalRequestManager.java:136)

at com.sapportals.portal.prt.core.PortalRequestManager.dispatchRequest(PortalRequestManager.java:189)

at com.sapportals.portal.prt.core.PortalRequestManager.runRequestCycle(PortalRequestManager.java:753)

at com.sapportals.portal.prt.connection.ServletConnection.handleRequest(ServletConnection.java:240)

at com.sapportals.portal.prt.dispatcher.Dispatcher$doService.run(Dispatcher.java:522)

at java.security.AccessController.doPrivileged(Native Method)

at com.sapportals.portal.prt.dispatcher.Dispatcher.service(Dispatcher.java:405)

at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)

at com.sap.engine.services.servlets_jsp.server.servlet.InvokerServlet.service(InvokerServlet.java:156)

at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)

at com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl.runServlet(HttpHandlerImpl.java:401)

at com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl.handleRequest(HttpHandlerImpl.java:266)

at com.sap.engine.services.httpserver.server.RequestAnalizer.startServlet(RequestAnalizer.java:387)

at com.sap.engine.services.httpserver.server.RequestAnalizer.startServlet(RequestAnalizer.java:365)

at com.sap.engine.services.httpserver.server.RequestAnalizer.invokeWebContainer(RequestAnalizer.java:944)

at com.sap.engine.services.httpserver.server.RequestAnalizer.handle(RequestAnalizer.java:266)

at com.sap.engine.services.httpserver.server.Client.handle(Client.java:95)

at com.sap.engine.services.httpserver.server.Processor.request(Processor.java:175)

at com.sap.engine.core.service630.context.cluster.session.ApplicationSessionMessageListener.process(ApplicationSessionMessageListener.java:33)

at com.sap.engine.core.cluster.impl6.session.MessageRunner.run(MessageRunner.java:41)

at com.sap.engine.core.thread.impl3.ActionObject.run(ActionObject.java:37)

at java.security.AccessController.doPrivileged(Native Method)

at com.sap.engine.core.thread.impl3.SingleThread.execute(SingleThread.java:100)

at com.sap.engine.core.thread.impl3.SingleThread.run(SingleThread.java:170)

Caused by: com.sapportals.portal.prt.component.PortalComponentException: Original exception:

at pagelet._sapportalsjsp_PayMyAccountPreLoginStep1.doContent(_sapportalsjsp_PayMyAccountPreLoginStep1.java:45)

at pagelet._sapportalsjsp_PayMyAccountPreLoginStep1.service(_sapportalsjsp_PayMyAccountPreLoginStep1.java:24)

at com.sapportals.portal.prt.core.broker.PortalComponentItemFacade.service(PortalComponentItemFacade.java:360)

at com.sapportals.portal.prt.core.broker.PortalComponentItem.service(PortalComponentItem.java:934)

at com.sapportals.portal.prt.core.PortalRequestManager.dispatchRequest(PortalRequestManager.java:435)

... 38 more

Caused by: java.lang.IllegalArgumentException: Tag tableView attribute model: Cannot access bean property myBean.model in page context

at com.sapportals.htmlb.taglib.TableViewTag.setModel(TableViewTag.java:67)

at pagelet._sapportalsjsp_PayMyAccountPreLoginStep1.subDoContent(_sapportalsjsp_PayMyAccountPreLoginStep1.java:164)

at pagelet._sapportalsjsp_PayMyAccountPreLoginStep1.doContent(_sapportalsjsp_PayMyAccountPreLoginStep1.java:40)

... 42 more

Kindly help..this is very urgent!

Add a comment
10|10000 characters needed characters exceeded

Related questions

1 Answer

  • author's profile photo Former Member
    Former Member
    Posted on Nov 22, 2007 at 01:09 PM

    Added a constructor in the bean.it worked

    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.