on 07-12-2006 4:31 PM
Hi,
I'm building my view dynamically in the wdDoModifyView method.
Is it possible to bind a "TextView" element to a specific element of an attribute node?
Scenario:
Node_Employees
|
+- Attribute_Code
|
+- Attribute_Name
Node Contents:
Employees
|
+- Code: 1, Name: Employee 1
|
+- Code: 2, Name: Employee 2
|
+- Code: 3, Name: Employee 3
I need to do something like binding a TextView UI element to the "Name" attribute of the element #2, what would result to show "Employee 2" on my view.
How can I do this?
Thanks in advance,
Geraldo.
You cannot bind a property to a node element. If you bind it to an attribute of a node with cardinality 0:N, you will always get the attribute value at the lead-selected element.
Armin
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello, do you mind sending me an example of how you achieved this?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Geraldo,
First you have to find the number of attributes of the node,then you can use any loop to get the attributes one by one and bind it to the textview using the getnodeInfo() and getChild() methods.
Kind Regards,
Saravanan K
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Geraldo,
Your question is binding the dynamic textview to a static context attribute? Is it Correct?
Regards
Saravanan K
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Saravanan,
First I populate the context node and it won't change during view's lifecycle. After that, I build my view and bind the TextView UI elements to the node context attributes elements.
If the node has 10 elements, I will build 10 TextView UI elements and bind them to each attribute element.
Regards,
Geraldo Brígido.
Geraldo,
Then you have to create 10 dynamic context nodes with the same attributes (and optionaly same nested structure) but with cardinality 0..1 or 1..1.
Next you have to dynamically create 10 TextView control and bind their "text" property to corresponding attribute in every dynamic node.
VS
User | Count |
---|---|
88 | |
10 | |
10 | |
9 | |
6 | |
6 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.