cancel
Showing results for 
Search instead for 
Did you mean: 

ContextAttribute Result has JavaNative Type ArrayList

Former Member
0 Kudos

Hi,

I created a model by importing from webservice. The webservice has a method which return an object of type ArrayList.

Now my problem is that I can't bind this to my table in webdynpro Iview.

I get the following message.

ContextAttribute Result has JavaNative Type ArrayList

ContextAttribute with java native type cannot be selected

There are other option we can achieve it, but what i want is to bind the arraylist with some concept of array of objects.

Thanks and regards,

Sameer Ali Khan

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

Hi,

I feel the issue which i am facing is not being analyzed properly. I need to bind the context attribute to an arraylist. How can we do it...

former_member751941
Active Contributor
0 Kudos

Hi Sameer,

Take a context attribute say xyz of type <b>java.util.ArrayList</b>

Default Context Attribute type is string. Go to the property window then browse

Type Value. Select Java Native Type: java.util.ArrayList

ArrayList arr = new ArrayList();
 arr.add("Hello");
 arr.add("World");
	
wdContext.currentContextElement().setXyz(arr); // Binding ArrayList to a context Attribute
	
wdContext.nodeTest().bind(arr); //Binding ArrayList to a context Node

instead of <b>arr</b> Set the ArrayList object that you are getting from the Web service Method;

Regards,

Mithu

Former Member
0 Kudos

Hi,

My problem is that i am not able to map the table with the context attribute of type ArrayList

Former Member
0 Kudos

Hi Sameer, in your case you will have to iterate that ArrayList, extracting its elements one at the time, casting them to an appropiate ValueObject type, then extract its data attributes and populate your table with them.

Regards!

Julio Herera

former_member751941
Active Contributor
0 Kudos

Hi Sameer,

Check this thread.

Regards,

Mithu