roGridScreen msg.isListItemFocused bug?

I’ve noticed another issue. Sometimes (quite often actually) the roGridScreenEvent message is returning incorrect values for the selected row/column. When checking msg.isListItemFocused, the msg.GetData() (column) value is “8801162” and/or the msg.GetIndex() (row) value “65536”. I’m not entirely sure how/when it’s happening – but it’s happening before the isListItemSelected event. Sometimes the row value is right and the column value is wrong – sometimes they’re both off. Attempting to use these values in conjunction with a backing store is problematic. For now, I’m putting in sanity checks. Has anyone else experienced this issue yet?

I saw something like this a while back, but it turned out to be an issue with my code and not the grid screen. I can’t remember what the problem was off the top of my head. If I come across the answer, I will post it here.

“RokuChris” wrote:
I saw something like this a while back, but it turned out to be an issue with my code and not the grid screen. I can’t remember what the problem was off the top of my head. If I come across the answer, I will post it here.

I think I figured it out. The focused event is getting fired every time I select something. So it’s like it fires focus and then select events when I press the button. The row/column values are wrong for the focus event and right for the selection event. Not sure what to do about that…other than to check for selection before focusing.

I have (pseudo-code):
if focused then

else if selected then

end if

when it might work better if I have this:
if selected then

else if focused then

end if

That doesn’t work. I’m seeing two distinct events. Not sure what to do about it other than my sanity check.

I ran into the same thing when I was iterating over all the rows and setting the focused item to the first one. I’d occasionally get a focused event with a row index of one more than should have been possible and a column that made no sense whatsoever - probably 8801162. I just added the sanity check and forgot about it.

-JT