cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

How to update a row in an infoTable?

Highlighted
Level 4

How to update a row in an infoTable?

Hi Everyone,

So I would like to update a row in an InfoTable, but I couldn't find a snippet for it.

Basically, I would like to find my row first and then update an attribute of it and then push it back to InfoTable

like following:

var foundedRow = me.MyInfoTable.Find(myObject);

foundedRow.color = "blue";

me.MyInfoTable.UpdateRow(myObject,foundedRow)

7 REPLIES 7

Re: How to update a row in an infoTable?

MyInfoTable.myColumn=myNewValue;

Re: How to update a row in an infoTable?

Hi Mustafa,

To update an Infotable Property, you should never do it directly on the property, instead you should copy the Infotable Change it and set it again as a whole on the property ( see step 1 and 4 ):

1. var modified = me.MyInfoTable; // -- This creates a copy of the infotable not a reference

2. var row = modified.Find(myObject);

3. row.color = "Blue";

4. me.MyInfoTable = modified;

Re: How to update a row in an infoTable?

Can you explain why you should not modify the property directly?  There is no real difference in copying the infotable except for the fact that you now have another (potentially large) object occupying memory.

Re: How to update a row in an infoTable?

Hi Wayne,

That's the recommended way by R&D. Some reasons:

  • You can end you having big concurrency problems otherwise
  • Infotable Property Data Change event won't be thrown if you edit directly the inner row
  • Also, of that I'm not 100% sure, updates done at row level without "notifying the Property" won't be persisted after a Tomcat restart!

Best Regards,

Carles.

Re: How to update a row in an infoTable?

Thanks Carles

But I am not sure if you actually forgot to add this 5th step, or we didnt need that

1. var modified = me.MyInfoTable; // -- This creates a copy of the infotable not a reference

2. var row = modified.Find(myObject);

3. row.color = "Blue";

4*. modified.addRow(row);

5. me.MyInfoTable = modified;

Re: How to update a row in an infoTable?

You don't need 4* step to modify the row value.

Re: How to update a row in an infoTable?

Okay cool, thanks Carles! This was helpful.