Skip to Content
author's profile photo Former Member
Former Member

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

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

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

3 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Jul 20, 2011 at 07:22 AM

    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

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member

      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

  • Posted on Jul 20, 2011 at 07:10 AM

    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

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jul 20, 2011 at 07:23 AM

    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

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.