PDA

View Full Version : How to implement Keyboard listener in TreeTable



livinglegends
1 Jun 2009, 1:59 AM
Hi,

I am facing one problem in TreeTable. I have implemented TreeTable in my project with 6 columns in it.

I have a button with TreeTable in form. When I select any row and click on button say "Edit" it should open one popup dialog with details of selected row and allow me to edit. I have achieved this thing.

But, my problem is that, if navigate TreeTable using keyboard navigation keys, select any row and click on "Edit" button, it opens up Popup with wrong value. It doesn't show value of row selected by navigating through keyboard but it shows value of row which I have selected by clicking on it.

Steps to reproduce:

I have 5 rows in TreeTable as shown below

Column1 Column2 Column3
------------------------------
1 value1 value2 value3
2 value4 value5 value6
3 value7 value8 value9
4 value10 value11 value12
5 value13 value14 value15

Step 1: Suppose I click on 3rd row and then click on "Edit" button, it opens up one popup dialog with selected row values(value7, value8, value9).

Step 2: Now, I navigate above table using keyboard and go on the 5th row. If I opens up popup dialog by clicking on "Edit" button, instead of showing up 5th rows details(value13, value14, value15), it shows me details of 3rd row(because I have selected that row first by clicking on it using mouse in Step 1).

Step 3: Now, If i click on 5th row using mouse and open up dialog box using "Edit" it shows me proper values in popup dialog.

Conclusion is, I have to implement key listener to achieve this and I have implemented it even. But I couldn't achieve it.

So, please guide me how to implement keylistener to get rid of above situation or suggest me some another way to achieve it.

Hope, my explanation would be easy to understand

Thanks and Regards