Skip to Content
0
Former Member
Jan 13, 2006 at 11:46 AM

Bean related

9 Views

Hi,

I have 2 queries wrt to Bean usage in JSPDynPage.

1. I am trying a very simple example which goes as follows:

Dynpage:

public void doProcessBeforeOutput() throws PageException {
      testbeanclass4 testBean4 = new testbeanclass4();
      ((IPortalComponentRequest)getRequest()).getServletRequest().setAttribute("testBean4", testBean4);      
      testBean4.setName("abcd");
      
      this.setJspName("jsp4.jsp");
    }

JSP:

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

<hbj:content id="myContext" >
  <hbj:page title="PageTitle">
   <hbj:form id="myFormId" >
<jsp:useBean id="testBean4" scope="application" class="com.sap.jspdynpage.jsp4.testbeanclass4" />   
    <hbj:textView
	id="temp"
	>
	<%
	temp.setText(testBean4.getName());
	%>
    </hbj:textView>

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

Bean:

package com.sap.jspdynpage.jsp4;

import java.io.Serializable;

public class testbeanclass4 implements Serializable {
	String name;
	public String getName(){
		return name;
	}
	
	public void setName(String name){
		this.name = name;
	}
}

But i am unable to get what i want... i am getting blank field!!

Any pointers to where am i going wrong..

PortalApp.xml has been correctly framed!!

2. What is the use of bean model in list boxes or tables? Does it act as an arrray of objects which can be populated into the table/listbox?

I have read the help.sap.com doc on Bean Model, still some kind of clarity is missing.

Points will be awarded!!

Regards,

Dev