cancel
Showing results for 
Search instead for 
Did you mean: 

Object creation in NDS and Mapping Collection of objects/javabeans

Former Member
0 Kudos

Cuold anyone provide me information of

1. How to create Java bean class in NDS

2. Mapping Collection of objects/javabeans between View and Controller.

Example:

I have requirement of carring collection of employees between view ,controller and model layer as below..

ArrayList arl=new ArrayList();

arl.add(new Employee("john","1001"));

arl.add(new Employee("steeve","1002"));

-


public class Employee{

private String name=null;

private String no=null;

Employee(String name,String no){

this.name=name;

this.no=no;

}

public String getName(){

return this.name;

}

public String getNo(){

return this.no;

}

public setName(String name){

this.name=name;

}

public setNo(String no){

this.no=no;

}

}

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi Raghu,

Go to package explorer view in web dynpro perspective. There you will find src/packages under your project. On context menu of src/packages, create a package for eg., com.sap.java.Using context menu of com.sap.java, create a class Employee. In this class paste your code and save the file.

Now go to web dynpro explorer. Now Create model. Choose Import Java bean model. Give some name to model and package. Click next. It will show list of all java classes that you have created. Select Employee. Click next, select attributes you want in Employee Node and then click finish. Your Employee java class will be now available as Model class.

Regards,

Gopal

Edited by: Gopal on Apr 17, 2008 12:20 PM

Former Member
0 Kudos

Hi Gopal,

Thanks for giving me information of Javabean Model.

I will test this and let you know.

snehal_kendre
Active Contributor
0 Kudos

Hi Raghu,

For javabeans

1. create a javabean project first. Where you can implement session beans and entity beans.

2. Create a simple java project(usually it is called as commanbean) to access the session bean.

3. create a javabean model using commandbean.

4 and map model ->controller -> view.

please go through folowing documents

using EJB`s in web dynpro

https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/1f5f3366-0401-0010-d6b0-e85a49e9...

and try to implement quick car rental application. its the simplest one. after that definatly you will be able to use java beans