TEXTGRIDCollection itemChanged method

When you invoke the itemChanged() method of a TEXTGRIDCollection, the selected line does not appear as selected (i.e. the line is not painted to YELLOW or whichever color you set)

…this is not the purpose of the method - the method just tells the textgrid that the line has changed.
Use the SELECTPROP (typically “selected”, but this is part of TEXTGRID definition!) and set it to true.

Bjoern

Well I think I asked the question in a wrong way. Let me tell you the problem from the beginning, in three steps:

1- A line of the grid is selected (by the user).
2- While the line is selected, user clicks a button on the page. And the event of that button changes the line and calls the itemChanged() method.
3- Suddenly the line appears as NOT SELECTED (it loses its highlight). But if you call the findLastSelectedItem() method, you get the selected line

I think now I expressed myself more clearly,

Thanks

… method “itemChanged” is just the signal to CAI to re-render the grid on UI side (“the textgrid’s change index is touched”). The item class provides for a property that indicates if the line is to be highlighted (defined at TEXTGRID-SELECTEDPROP within the XML layout). You may check that the property value is still TRUE after having changed the item (…eg. by a break point within the getter method…).

Martin