cancel
Showing results for 
Search instead for 
Did you mean: 

How to pass Dynamic Attribute info (paramete)from one view to another view

Former Member
0 Kudos

HI ,

I have two views and a controller.I have a Static node in the controler and is mapped with the two views.(say V!,V2)

I have created 3 dynamic attributes in this static node in the V2.

I want to get those dynamic attributes(say to get the name of the dynamic attribute) in the V1.

How should i pass the parameter from V2 to V1 to get hold of the dynamic attributes to get them available in V1.

How should i proceed.

Please suggest.Advance thanks.

-Padmalatha.K

Accepted Solutions (0)

Answers (4)

Answers (4)

Former Member
0 Kudos

Hi all,

Any updates?????????

Please Help...............

Regards,

Padmalatha.K

Former Member
0 Kudos

Creating the context structure (not the data) programmatically should be the exception, not the rule. Can you explain your use case?

Armin

Former Member
0 Kudos

hi Mithu/Padmalatha

I am also facing the same problem.

I need to map dynamic attribute values from 1 view to another view.

Do u have anysample code to map the the attributes dynamically.

Thanks

-Sandip

Former Member
0 Kudos

HI AyapaaRaj,

Thanks for ur reply.

But I dont know abt dynamic mapping.

Can u plz tell me in detail how dynamic mapping is done.

Rgards

-Padmalatha K

former_member751941
Active Contributor
Former Member
0 Kudos

Hi,

Why dont you make them to at design time?

wdContext.getNodeInfo().addMappedAttribute(name, mappedName)

The above method is used to map attributes.

Examples:

  • <ul>

  • <li><code>mappedNode.addMappedAttribute("mapped1", "value1")</code><br>

  • This assumes that <code>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.

  • <li><code>node.addMappedAttribute("mapped2", ".CustomContext.Some.Node.value2"></code><br>

  • 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><br>

  • 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.

  • <p>

  • 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>.

  • </ul>

  • <p>

  • The attribute can be removed again via {@link IWDAttributeInfo#remove()}.It

  • will also disappear if you {@link IWDContext#reset(boolean) reset the context}.

  • @param name The name of the attribute within the node or the complete

  • meta path, must be unique within the node.

  • The name may only contain ascii letters, digits and underscore ('_') and

  • must not start with a digit.

  • @param mappedName The name of the attribute in the origin node.

  • @return The added attribute.

Regards

Ayyapparaj