Hi,
I wrote a session bean method that returns an java.util.ArrayList.
Then I generated a web service for this session bean and imported this web service into a Web Dynpro model.
I can then execute this web service model and get the ArrayList in the method result (means in the result of the model instance) but I cannot bind this model to e.g. a table control with the following error message:
"ContextAttribute has JavaNativeType ArrayList. ContextAttribute with java native type cannot be selected."
This is o.k. so far but is there a way (workaround) to use any collection class as result of my web service method?
Background: Normally I´m and many users work with the java collection framework. At the moment I have to convert the Collection into an array with the following construct and return the array.
MyType[] tmp = new MyType[1];
return (MyType[])list.toArray(tmp);
When I then create a model in Web Dynpro the members of MyType are generated as model attributes.
This works but is not the way I would like to work. I would prefer to work with my Collection class.
Thanks for an answer
Helmut
Hi Helmut,
i guess, collections cannot be used for model binding, since they may contain different kinds of objects. As you know for sure, this is not the case for model- and value nodes, their entries are restricted to one element "type". So from my point of view the only workaround is to convert collections into arrays, like you're already doing it.
Best regards
Stefan
Add a comment