Hy all,
i want to enable a cell of the selected row over code.
How can i do this ?
I dont know, how to get the UI-Element table of my view over code.
I have read the API and have seen all the method to change the properties, but not found the method to get any of my UI-Elements of the actual view.
Is there any method to get or browse all the UI-Elements of the view ?
Have anyone a code-example to get a UI-Element of a view ?
Thanks for help.
by Jürgen
Hi,
The only place where you can get access to UI controls is wdDoModifyView method of the View Controller.
Getting elements is simple:
IWDInputField input = (IWDInputField)view.getElement("<element-id>");
To traverse the whole tree you need first get access to root UI element of the view:
IWDUIElementContainer root = (IWDUIElementContainer)view.getElement("RootUIElementContainer");
The you can get all of its children:
IWDUIElement[] directChildren = root.getChildern();
Later you can traverse recursively by directChildren if concrete child is instance of IWDUIElementContainer.
Obviously, you can start from any container.
Hope this helps,
VS
Hy Valery,
my scenario is to enable a Button or LinkToURL UI-Element in a table cell of the selected row. The data in the table are mapped from a node und the Button/LinkToURL Element was insertet by visual editor with property enable = false.
I have a action onLeadSelection to get the parameters of the selected row to build the right URL.
Do I have access in the action to the wdDoModifyView-Method to change the property ?
How can i change the cell-enable-property of the selected row ?
I can get the table, the array of tablecolumns and an iterator over the table. But i have not found a method
to get the column like table.getColumn(XXX).
I have read the IDWTable API with the following text:
"Table columns are defined by aggregating TableColumn
objects. Each table column has a table cell editor.
Every property of the table cell editor may be bound
either
to an attribute of the context node X, or
to a context root attribute.
Now I am a little bit confused. Do I need a value attribute "URL" in my model node?
But this should not solve my problem to enable a Cell of a table, or ?
Thanks for help.
Jürgen
Hello Armin, hello Valery
thanks for help !
But it is not working in my Version 2.0.6.
If I want to create a new value attribute to my node a got a error message:
"Adding attributes is currently not supported if the node or the model class (for context model notes) has a dictionary structure binding"
What can i do ?
The only way i think is to create a new data node, copy the model node to the new node with the boolean extension, map the boolean to the "enable" property, and hope it works !
Regards
Jürgen
Add a comment