cancel
Showing results for 
Search instead for 
Did you mean: 

Context-node and child-nodes: binding-problems when parent node is initial

Former Member
0 Kudos

Hello,

I'm using a context node (TABLE_NODE) representing different people to fill a table element with.

In this context node there are subnodes storing information for an image and comment.

I have an image UI element that is bound to this subnode and a text input element bound to the other subnode.

Under some circumstances this main table (TABLE_NODE) has no entries. Therefore the child nodes doesn't exist and I get an error message like the following.

■The following error occurred in system XYZ : Adapter error in INPUT_FIELD "COMMENT_INPUT_FIELD" of view "VIEW": Context binding of property VALUE cannot be resolved: Node VIEW.1.TABLE_NODE does not contain any elements

To avoid this error, I check (in WDDOMODIFYVIEW) the state of TABLE_NODE and release the binding of the image (image->bind_source( '' )) and of the text input (text_input->bind_value( '' )). While this works perfectly for the image element, the text input gives another error:

■The following error occurred in system XYZ : Access via 'NULL' object reference not possible.

Debugging of this error leads into deep areas of SAP-code.... this error definitly come from the text input, because setting this element to invisible avoids the error and the application is working again.

Is there anything I've overseen or what can I do to get this work?

Best regards,

Michael

Accepted Solutions (1)

Accepted Solutions (1)

saravanan_narayanan
Active Contributor
0 Kudos

Hello Michael,

the InputField always expects a binding value and the corresponding context element should exists. otherwise it wont work. In your case for the Inputfield you have removed the binding. thats the reason you dump

if you want the Inputfield to be displayed then you need to make sure that its bound to an context attribute and context element should exist for the same.

easy way is to change the cardinality of both TABLE_NODE and SUB_NODE to 1..1.

Otherwise you have an option of creating the SUB_NODE instance or hide the input field if the sub_node has no instance.

BR, Saravanan

Former Member
0 Kudos

Hello Saravanan,

thanks for pointing that out.

But unfortunately hiding the element is no option due to "design request"...

I'll bind the element to another dummy context element and disable the input field.

Best regards,

Michael

Answers (2)

Answers (2)

Former Member
0 Kudos

Cardinality of table_node is 0..n (with selection 0..1).

The image childnode is cardinality 0..1 and the comment child node is cardinality 1..1

former_member199125
Active Contributor
0 Kudos

what is the cardinality of table_node? I think you set the value to 1: 1 or 1:n, try to make 0:N and check now.

Regards

Srinivas