cancel
Showing results for 
Search instead for 
Did you mean: 

Adding an Element to a sub node

Former Member
0 Kudos


I have a Context that consists of a node (foodAndBevServingSizeInfo), three additional attributes, and a sub node (householdServingSize) which has a single attribute. Please see below image.

My problem is I struggle to set the value of the "value" attribute of the "householdServingSize" sub node.

Can you please guide me on how to achive it?

My code below does not seem to work:

I'm getting this error:

while trying to invoke the method com.sap.tc.webdynpro.progmodel.context.Node.addElement(com.sap.tc.webdynpro.progmodel.api.IWDNodeElement) of an object returned from com.sap.is.gds.custom.interspec.web.wd.wdp.IPublicInterspecWebComponent$IFoodAndBevServingSizeInfoElement.node(java.lang.String)

Thanks in advance

.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Erwin

The problem is that you created the foodAndBevServingSizeInfo element but did not add it to the node.

Generally I suggest using CreateAndAddElement method rather, it prevents mistakes like those and makes code shorter and more readable.

Regards

Shai.

Former Member
0 Kudos

Thanks!

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi,

Can you share the details of your foodAndBevServingSizeInfo node too please?  I imagine it is because of a combination of the cardinality, selection cardinality, singleton, etc. settings.

Cheers,

G.