Skip to Content
avatar image
Former Member

mapping of context attribute

hai all,

I need to map the context attribute which was created dynamically to another view inorder to get the selected values of this can be done.

Thanks n Regards


Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • avatar image
    Former Member
    Feb 25, 2008 at 10:09 AM


    Use the following code

    wdContext.node<YourNode>().getNodeInfo().addMappedAttribute(name, mappedName);
    Examples from the doc
      mappedNode.addMappedAttribute("mapped1", "value1")
          This assumes that mappedNode</code> is a mapped node with an origin
          node that has an attribute named "value1". It creates a attribute named
          "mapped1" taking its value of the attribute "value1" of the origin
       node.addMappedAttribute("mapped2", ".CustomContext.Some.Node.value2
         This adds a mapped attribute named "mapped2" to <code>node</code>. The
          attribute maps to another attribute in the context named "CustomContext"
          of the current component. Its path within the component is "Some.Node.value2".
          Note that <code>mappedName</code> starts with a dot. This is because the
          first entry in the path is the name of an embedded component. Here the
          name is empty meaning the context is in the same component.
         <li><code>IWDNodeInfo node = parent.createMappedNode("MappedNode" ... ".Context.Another.Node",...)<br>
       node.addMappedAttribute("mapped3", ".Context.Another.Node.Child.value3")</code>
          In this case the node is mapped and the attribute is mapped, but not to 
          an attribute of the node itself. The mapping target of the attribute
          actually is in a child node of the node's mapping target.
          Now, if you have an element of <code>MappedNode</code> and read its
          attribute <code>mapped3</code>, the contexts starts at the data node of
          <code>MappedNode</code> and descends to the child <code>Child</code>,
          takes its element at the lead selection and reads the attribute



    Add comment
    10|10000 characters needed characters exceeded