Hi,
trying to get data using beans & htmlb I get error:
Tag tableView attribute model: Cannot access bean property myBean.model in page context.
Exception id: 02:43_08/04/05_0141_3246050
See the details for the exception ID in the log file
myJCoBean.java:
package fazulky;
import java.io.Serializable;
import com.sapportals.htmlb.table.*;
public class myJCoBean implements Serializable {
public JCOTableViewModel model = null;
public JCOTableViewModel getModel(){
return model;
}
public void setModel(JCOTableViewModel value){
this.model = value;
}
}
JCoBean.java:
public class JCoBean extends PageProcessorComponent {
public DynPage getPage() {
return new JCoBeanDynPage();
}
public static class JCoBeanDynPage extends JSPDynPage {
private myJCoBean myBean = null;
public ValueBean valueBean = null;
public void doInitialization() {
IPortalComponentSession componentSession =
((IPortalComponentRequest) getRequest()).getComponentSession();
Object o = componentSession.getValue("myBean");
if (o == null || !(o instanceof myJCoBean)) {
myBean = new myJCoBean();
componentSession.putValue("myBean", myBean);
} else {
myBean = (myJCoBean) o;
}
}
public void doProcessAfterInput() throws PageException {
}
public void doProcessBeforeOutput() throws PageException {
JCO.Client jcoClient = null;
jcoClient =
JCO.createClient(
"800",
"usr",
"pass",
"EN",
"pro3000",
"00");
jcoClient.connect();
JCO.Repository jcoRepository = null;
jcoRepository = new JCO.Repository("rep", jcoClient);
IFunctionTemplate jcoFunctionTemplate = jcoRepository.getFunctionTemplate("BAPI_COMPANYCODE_GETLIST");
JCO.Function jcoFunction = new JCO.Function(jcoFunctionTemplate);
jcoClient.execute(jcoFunction);
JCO.Table jcoTable = jcoFunction.getTableParameterList().getTable("COMPANYCODE_LIST");
JCOTableViewModel jcoModel = new JCOTableViewModel(jcoTable);
myBean.setModel(jcoModel);
this.setJspName("jcobean.jsp");
}
}
}
jcobean.jsp:
<%@ taglib uri="tagLib" prefix="hbj" %>
<jsp:useBean id="myBean" scope="application" class="fazulky.myJCoBean" />
<hbj:content id="myContent">
<hbj:page title="SAPPortals">
<hbj:form id="myFormId">
<hbj:tableView
id="idTableView"
design="ALTERNATING"
model="myBean.model"
headerVisible="true"
headerText="Hello-World Example for SAP Data">
</hbj:tableView>
</hbj:form>
</hbj:page>
</hbj:content>
By the way, where are errors like this logged?