Skip to Content
Jun 01, 2016 at 10:56 AM

Dynamically recreating (!) context attributes and table columns


Hello everybody!

We are trying to build a WebDynpro view which shows a table with some GroupedColumns unknown at design time.

Creating these and the corresponding context attributes underneath a fixed node works well, but when we try to create new attributes and table columns in the next roundtrip (after destroying the previously created ones, of course), I get a

java.lang.NullPointerException while invoking the method of a null object loaded from an Array (which itself was loaded from field of an object) with an index loaded from local variable 'i'

when trying to establish the context mapping between the local node inside my view's context and the corresponding node in the component controller context using

localNode.getNodeInfo().setMapping(ccNode.getNodeInfo(), true);

basically from inside the wdDoModifyView() method. When I call that method, there are no attributes defined for the node. Since I create mapped attributes afterwards (localNode.getNodeInfo().addMappedAttribute(someName, someName)), the parent nodes have to be mapped before.

When I create the set of context attributes and columns first, this works fine, but on the second roundtrip, this fails. I need the context mapping to be able to filter the table contents.

Does anyone have any idea on that? I'd like to be able to do this inside a single roundtrip in a single view without having to navigate to another view that is being recreated every tiem.

Thanks in advance