cancel
Showing results for 
Search instead for 
Did you mean: 

mapping of context attribute

Former Member
0 Kudos

hai all,

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

Thanks n Regards

Sharanya.R

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi,

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
      element.
   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
      <code>value3</code>.


Regards

Ayyapparaj