LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Table property has strange behaviour

I'm trying to use a table control to enter/display data. The user wants to use a touch screen and that's why the following seems like a complicated way of doing things. What he wants to do is click in a cell of a table so that is the next place data is entered. He then presses another button to drop the appropriate data into the cell.
The Edit position property of the table gives the row column index of the cell just clicked. That seems to work fine and gives the correct cell as seen in the attached vi (v6.1). However you notice that the data in the string seems to be delayed in appearing in the cell location in the table. I've put a switch on the panel so that you can alternatively enter the row/column manually. This
way everything works fine. So somehow the data from the Edit Position property gets to the indicators correctly but doesn't get into the invoke node. A workaround is to click in the string text box after clicking in the table cell. This can be done programatically by setting the key focus of the string control in the loop (I haven't included an example of this).
I suspect this is some sort of race condition which I've seen some postings about with respect to property nodes but I don't understand why it happens in this case.
0 Kudos
Message 1 of 3
(2,803 Views)
Andrew,

Here is what I think is happening. When you first click on a cell in the table, you are then editing the contents of that table. This happens instantly. When you then set the data of that cell, the entering process must first finish before that new value will be recognized (visualized). This only happens when you press +, press the Check in the upper left corner to finish the text entering, or click outside of that cell. If your customer really wants to click the table cell, then enter text, I think that setting the key focus programmatically is the perfect thing to do. I would, however, clear the string control before setting key focus to it (take the data out of the cell that they clicked on and put that in the string control might be
even better).

Randy Hoskin
Applications Engineer
National Instruments
http://www.ni.com/ask
Message 2 of 3
(2,803 Views)
Thanks Randy
That explains why my "manual" method appeared to work. By clicking the manual row/col controls I effectively changed the focus to them and the data in the cell was visualised as you called it.
regards
Andrew
0 Kudos
Message 3 of 3
(2,803 Views)