Skip to Content
avatar image
Former Member

ContextException problem

Hi Experts,

Need your help.

I have the following context structure:

UserInfo : node, singletone=true

****UserMachines : node, singletone=true

*********MachinesInformation : node, singletone=false ( there is a supply function for this node)

*********locale : attribute

*********version : attribute

****name : attribute

****type : attribute

UserMachines node is bound to Table. MachinesInformation is bound to TextView elements.

When there is at least 1 element in UserMachines node everything works OK. But when there are no machines to enter to the node ( UserMachines is empty) i get the following exception:

com.sap.tc.webdynpro.progmodel.context.ContextException: Node(SingleUserCompView.UserInfo.UserMachines): no child node 'MachineInformation' at index -1

at com.sap.tc.webdynpro.progmodel.context.Paths.followPath(Paths.java:880)

at com.sap.tc.webdynpro.progmodel.context.Paths.followPath(Paths.java:852)

at com.sap.tc.webdynpro.progmodel.context.Paths.createAttributePointer(Paths.java:91)

at com.sap.tc.webdynpro.progmodel.view.UIElement.getVisible(UIElement.java:619)

at com.sap.tc.webdynpro.clientserver.uielib.standard.uradapter.MatrixLayoutAdapter$Cells.doNext(MatrixLayoutAdapter.java:362)

.....

I could not understand what is wrong. Please help me.

Regards,

Slavik.

Edited by: Stanislav Lvovsky on Jul 2, 2009 4:47 PM

Edited by: Stanislav Lvovsky on Jul 2, 2009 4:49 PM

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

3 Answers

  • Best Answer
    avatar image
    Former Member
    Jul 02, 2009 at 04:16 PM

    Looks like you have bound the "visible" property of some UI element to some context attribute inside node "MachineInformation". The runtime tries to compute the property value before it renders the UI element. To do so, it follows the lead-selections of all parent nodes and finds that node "UserMachines" has no selection (-1) because it is empty.

    Armin

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

      Hi Armin,

      You were right. I have moved "visibility" attributes from the node to other place and it started to work.

      Regards,

      Slavik.

  • avatar image
    Former Member
    Jul 02, 2009 at 03:38 PM

    Set the cardinality of node UserMachines to 0..n

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Jul 02, 2009 at 04:06 PM

    whats on Paths.java line 880?

    It could be cardinality, but also with a "for" loop over the MachinesInformation node ...could be the supply function

    have on mind that if you put nothing on the node and the cardinality its 1-n then there is gonna be one empty record

    are you using some of this?

    numXVal.bindValue("xxxxxxxx");

    Add comment
    10|10000 characters needed characters exceeded