Skip to Content
0
Former Member
Mar 22, 2006 at 04:46 AM

Cannot access bean in page context

27 Views

Hi all,

I am facing a problem with JSP Dynpage. I am unable to get the value of the model that i have set in ,my controller, in the JSP, the exception that I see in the log viewer is this -

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

at

com.sapportals.htmlb.taglib.TableViewTag.setModel(TableViewTag.java:67)
at pagelet._sapportalsjsp_TVP_ViewPendingIssues.subDoContent(_sapportalsjsp_TVP_ViewPendingIssues.java:172)
at pagelet._sapportalsjsp_TVP_ViewPendingIssues.doContent(_sapportalsjsp_TVP_ViewPendingIssues.java:36)

My JSP page code is this :

<hbj:content id="myContext" >
  <hbj:page title="PageTitle">
   <hbj:form id="myFormId" >
    <br><br><center>     	
			<%if(techPendingissueBean.isShowTVC()) {%>
    		<hbj:tableView  id="techPendingTableView"
                      model = "techPendingissueBean.model"  
					  design = "ALTERNATING"
					  headerVisible = "true"
					  footerVisible = "true"
					  fillUpEmptyRows = "true"
					  navigationMode = "BYLINE"
					  selectionMode = "SINGLESELECT"
					  headerText = "Pending - Navigation - Selection"
					  onNavigate = "onNavigation"
					  visibleFirstRow = "<%= techPendingissueBean.getVisibleRow() %>"
					  visibleRowCount = "10" >  
					  <% techPendingTableView.setFooterRenderer(new TechPendingIssueFooterRenderer()); %>
					  <% techPendingTableView.setOnClientRowSelection("setFlag()"); %>        
					  <% techPendingTableView.setJsObjectNeeded(true); %>
		  </hbj:tableView>
		<%}else{%>
		 <h4> No Pending Issues for Approval</h4>
		  <%}%>
	</center>

   </hbj:form>
  </hbj:page>
</hbj:content>

The context of my bean is "application"

The portalapp.xml entry for my component is :

<component name="TechPendingIssuesController">
      <component-config>
        <property name="ClassName" value="com.accenture.sapticketing.technician.pendingissues.TechPendingIssuesController"/>        
        <property name="SafetyLevel" value="low_safety"/>
      </component-config>
      <component-profile>
        <property name="tagLib" value="/SERVICE/htmlb/taglib/htmlb.tld"/>
      </component-profile>
    </component>

I am setting the model in my controller in the following manner :

	try
		{
			tvm_rs = getDATAResults();
			response.write("rowcount in try"+tvm_rs.getRowCount());
			if ((tvm_rs != null)&&(tvm_rs.getRowCount() == 0))
			{
				techPendingIssueBean.setModel(null);
				techPendingIssueBean.setShowTVC(false);
				techPendingIssueBean.setMessage("No data for entered customer ");
			}
			else
			{
				techPendingIssueBean.setModel(tvm_rs);
				techPendingIssueBean.setShowTVC(true);
				context.putValue(IConstants.TPending,techPendingIssueBean);
				response.write("nInside else "+techPendingIssueBean.getModel().getRowCount());
			} 
		}

My bean has this code for the model :

public TableViewModel model = null; - with the getter/setter

I also have a constructor in the bean with :

public TechPendingIssueBean(){
		model = new DefaultTableViewModel();
	}

Please tell me if I am doing something wrong /have I missed out anything.. Have referred to the threads already existing.. could not find much help..

Regards

Ashwini.