cancel
Showing results for 
Search instead for 
Did you mean: 

How import relations of a model in Web Dynpro project

Former Member
0 Kudos

I am importing a bean as model in my webdynpro project.

This bean is having a List(customerList) and a currosponding getter method. This List will become a relation. Can anybody tell me how to use this relation in my Webdynpro project when I import this bean as a model to my project?

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi Sujit,

If the Customer class you want to put in your List and to which your relation will point is in the same Java package as the other bean (OB) you have to add the Customer class to the Java model, too. Then in the editor of the OB model class there is a tab for relations. There you can select the Customer class (assuming you have a getter for customerList) as target type.

If Customer and OB are not in the same package I'm afraid it won't work. If you can move them to the same package you are lucky, else you have to think about workarounds (e.g. manually create sub nodes and use supply functions in WD context)

Hope this helps

Markus

Former Member
0 Kudos

Hi

I am having both the TestBean and HelperBean in the same package. Below is the code of TestBean. This bean is in turn calling HelperBean ,which is returning a List. I am importing both these beans in model but still I am getting an error while creating model -


<b>[Error]: There are one or more relations unresolved. Importing the model without resolvoing the relations might result in erratic output.</b>


     public class TestBean implements Serializable{
	private List customerList= null;
	HelperBean helper = new HelperBean();

	
		public void execute(){
		
		try{
								customerList = (ArrayList)helper.getCustomerList();
		
			
			}
			catch(Exception ex){
			
				ex.printStackTrace();
			
			}
		}

	
	/**
	 * @return
	 */
	public List getCustomerList() {
		return customerList;
	}

	/**
	 * @param list
	 */
	public void setCustomerList(List list) {
		customerList = list;
	}

Please inform if there is some solution.

regards,

Sujit