cancel
Showing results for 
Search instead for 
Did you mean: 

how to display / bind the value from a Model attribute to Value attribute

Former Member
0 Kudos

Hello Everyone,

I need your help:

1) how to get and display the value from a Model attribute (i.e. mNode1.mNode2.mAttrib1) ?

2) how to assign / bind this Model attribute value to a Value attribute (i.e. vNode1.vNode2.vAttrib1)?

both are in the same component controller (i.e. aComp).

Could you please provide me the sample code.

Thank you very much in advance.

Jin

Accepted Solutions (1)

Accepted Solutions (1)

former_member214651
Active Contributor
0 Kudos

Hi,

For

1) use the code below

if(wdContext().nodemNode2() != null)
{
   wdContext().currentmNode2Element().getmAttrib1();
}

2)

Create a structure in the context of the view / controller.

vnode1

---vnode2

-


mAttrib1 (the name & type of this attribute should match with the name & type of the model node attribute)

then use the following code to assign value:

IvNode1Element v1Element = wdContext().createAndAddvNode1Element();
WDCopyService.copyElements(wdContext().nodemNode2(), wdContext().nodevNode2());

This will copy all the value of mNode2 to vNode2

Regards,

Poojith MV

Edited by: Poojith M V on Oct 22, 2010 6:49 AM

Former Member
0 Kudos

Thank you so much Poojith for your quick reply and great help...... your solutions are so simple and resolved my 2 issues so quickly.... thanks alot.

Could you please reply back, so I can award you more points.

Thanks again, Jin

former_member214651
Active Contributor
0 Kudos

Hi,

Is the issue resolved or do you require any other help?

Regards,

Poojith MV

Former Member
0 Kudos

The issue is resolved ...... thank you very much Poojith!!

Answers (0)