on 04-03-2006 5:52 PM
Hi,
Anybody has an idea how to add a TextView Element to a TableCellEditor dynamically.
The rest of the stuff like creating a Table, adding a column to it, adding a header to a column, adding a TableCellEditor to a column etc seems straightforward.
Regards
MK
You cannot "add a TextView Element to a TableCellEditor".
TableCellEditor is a common interface for certain UI elements that may serve as table cell editor.
To set the table cell editor to a TextView for a table column programmatically, use code like
wdDoModifyView():
IWDTableColumn column = (IWDTableColumn) view.getElement("ID-of-column");
IWDTextView editor = (IWDTextView) view.createElement(IWDTextView.class, null);
column.setTableCellEditor(editor);
Armin
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Cardinality 0..n, singleton true
--NodeA
---ElementA1
---ElementA2
Code:
IWDTable testTable = (IWDTable) view.getElement("Table2");
IWDTableColumn testColumn = (IWDTableColumn)view.createElement(IWDTableColumn.class, "TestColumn1");
IWDTextView textView = (IWDTextView)view.createElement(IWDTextView.class, null);
textView.bindText("NodeA.ElementA1");
testColumn.setTableCellEditor(textView);
testTable.addColumn( testColumn );
MK,
So your table dataSource is not NodeA. Worse it, NodeA is not event a non-singleton child of table dataSource node. So this is normal table behavior.
You may do the following in your code (wdDoModify):
table.bindDataSource
(
wdContext.getNodeInfo().getChild("NodeA")
);
Now your design-time column will show same entry, but dynamically create column will work correctly.
VS
Hi Valery,
its SP11.
One interesting thing which i observed is that, on manually changing the leadselection of the table, all the
set of similar entries get replaced by another set of similar entries which actually belongs to that lead selection.
Eg:ElementA1
LeadSelection 0:
200001
200001
200001
LeadSelection 1:
200045
200045
200045
LeadSelection2:
200057
200057
200057
Hi Armin n Valery,
It was indeed a singleton/non-singleton issue.
The complete structure was:
.ParentNode(Singleton, 0..n)
..ChildNode(non-singleton, 0..1)
...ChildChildNode(Singleton, 0..n)
And the datasource for the table was the parent node which was incorrect.
Changing the datasource directly to the ChildChildNode solved the problem.
Thank u all.
User | Count |
---|---|
84 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.