Cancel
Showing results for 
Search instead for 
Did you mean: 

Observer Method for a single table column

Experimenter
Experimenter

I know that there is a simulation attribute called "Changed" for tables but that applies to the whole of the table, and thus is inadequate for my planned usage. Is there a way to have the changed attribute for a single column, my assumption would be to use a user attribute which monitors a single table column, meaning that whenever a cell in that column is changed, the observer method would be called, reading through the user manual and some books didn't really help in determining the way to handle the attribute for my purposes, though. 

 

Does anybody know a way to observe a single table column?

 

Thanks, Pedru.

3 REPLIES

Re: Observer Method for a single table column

Valued Contributor
Valued Contributor

Hi Pedru,

 

I think there is a way to solve your problem. We can create a new tablefile (named tablefile_b) which has only one column. Each time when the original tablefile (named tablefile_a) changed, we contrast the centain column in tablefile_a to tablefile_b, if the cell in the centain column of tablefile_a has been changed, then update the cell in the tablefile_b, the observer method of tablefile will be called, it means that a cell in the centain column of tablefile_a has been changed!

 

If I can't describe clearly, you can find more information in the attachment.

 

Regards!

 

Tao Yifei

Re: Observer Method for a single table column

Experimenter
Experimenter

No, thank you. Yeah, that seems like a good solution.

Re: Observer Method for a single table column

Gears Phenom Gears Phenom
Gears Phenom

You can also use the plausibility-control-method of tables, with the parameters "columnNr" and "rowNr". When somebody enters/changes a value in a table-cell, this method will be called with the column- and row-number of the edited cell (if you change something per copy-paste in multiple cells at once, this won't work). But if you really want to know the previous and new value of the cell, you'll have to use taoyifei2000's suggestion.

____________________________________________________________
Alex Dilg, Consultant at SimPlan AG (www.SimPlan.de)
This post was good and/or helpful to you? Please provide some Kudos, thank you!