cancel
Showing results for 
Search instead for 
Did you mean: 

Updating table column

Former Member
0 Kudos

How can I update the column of a table, that is already created?

More precisely, I am having a table with five rows and five columns and I already put values in all by using the program.When user clicks a button, I have to show different values in each cells of my last column.

Thanks

Fahad Hamsa

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

Let's say you have a context node LastColumn and you have an attribute LastColumnValue within it. This attribute is bound to the TableCellEditor of your last column.

In the eventhandler for the onAction event of the button, you will need to use this code or something similar:


for(int i = 0;i < wdContext.nodeLastColumn().size(); i++){
wdContext.nodeLastColumn().setLeadSelection(i);
wdContext.nodeLastColumn.currentLastColumnElement().setAttributeValue("LastColumnValue",<new value>);
}

Regards,

Satyajit.

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi Fahad,

On the action of the button , Reinitialize the Table node by the appropriate method.

IPrivate<ViewName>.I<Table>Node node=wdContext.node<Table>();

node.invalidate();

//do the Retrieve value

IPrivate<ViewName>.I<Table>Element element=wdContext.current<Table>Element();

element.set<Param>("value");

node.addElement(element);

Kind Regards

Mukesh.

Former Member
0 Kudos

Thanks Satyajit

Your solution is perfectly working

Thanks alot

former_member182372
Active Contributor
0 Kudos

Hi Fahad,

In action handler iterate through data source context node and set appropriate property which is bound to last column cell editor.

Best regards, Maksim Rashchynski.