on 07-06-2007 9:57 PM
Hi
I want to bind data to table which is cerated at design time. I know that we can do it using IPrivate<viewName> but i am not sure. Can any one help me.
Can you give more details? You have created a table at design time and what exactly do you want to do at runtime? Adding a column?
Armin
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Try to follow this tutorial. It shows how you can create UI elements dynamically, bind them to context and populate the context.
Regards,
Ashwani Kr Sharma
The following code adds a table column to an existing table and uses an input field as cell editor. A boolean attribute "addColumn" is used to control whether the column should be added.
Code is for NW04. In NW04s, use addGroupedColumn(). The table data source node is named "Rows" in this example.
wdDoModifyView()
{
if ( wdContext.currentContextElement().getAddColumn() )
{
/* Get the table instance */
IWDTable table = (IWDTable) view.getElement("TableID");
/* Create and add table column */
IWDTableColumn column = (IWDTableColumn) view.createElement(IWDTableColumn.class, null);
table.addColumn(column);
/* Create and add column editor */
IWDInputField editor = (IWDInputField) view.createElement(IWDInputField.class, null);
editor.bindValue(IPrivate<View>.IRowsElement.<ATTRIBUTE_NAME>);
column.setCellEditor(editor);
/* Create and add column header */
IWDCaption header = (IWDCaption) view.createElement(IWDCaption.class, null);
header.setText("Here I am!");
column.setHeader(header);
/* Reset flag to avoid adding multiple times */
wdContext.currentContextElement().setAddColumn(false);
}
}
Armin
User | Count |
---|---|
81 | |
10 | |
10 | |
9 | |
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.