MichaelBluejay wrote:Thank you for your continued help. I had to put this project on the shelf for a while but I'm trying to get back to it. By the way, on Oct. 19 I sent you a virtual Kiva gift card to the support email address at Blue Mango, but Kiva informs me that it hasn't been redeemed yet. If the message that Kiva sent with the gift card # is lost then I can send it to you, just let me know how I should do that. You can write me directly at replies/at/michaelbluejay.com.
Continuing on my project, thanks to your help, I'm now able to tab from a column with a plain text field to a column with a popup menu, and have the popup automatically drop. After selecting an item from the popup menu, I'd like to tab to the next column, but pressing the tab key takes me out of the Data Grid and into another field on the card. I know that the Custom Field Editor script isn't seeing the tab because I put "put the seconds" into the "on tabKey" handler and nothing is showing up when I press the tab key.
I see two possible solutions but I don't know how to implement them. First, I could call EditFieldText from the "on menuPick" handler that's in the Column Behavior Script, so I can open a field for editing, so the Custom Field Editor script will see the tab key. But I don't know how to get the parameters to pass to EditFieldText.
Or, in the "on menuPick" handler in the Column Behavior script, I could hard-code the code that moves to the next field, but I tried that and it didn't work. The code I used was:
Code: Select all
send "DeleteFieldEditorAndOpenNext" to the dgControl of me in 0 seconds
set the CheckForMenuDrop of the dgControl of me to true
I'm guessing that "me" doesn't refer to the right thing when it's in the "on menuPick" handler.
How would you suggest I get the ability to tab to the next column? Thank you very much for your help.
Hi Michael,
I have not followed all the thread but it seems that with the help of Trevor, you have changed the FieldEditor behavior. The FieldEditor behavior is invoked when you edit text by using a message like EditText.
In your case, when you leave the content of a text cell to go in a popup cell, you have changed the FieldEditor to open the menu.
Internally when you invoke the DeleteFieldEditorAndOpenNext, the engine send an EditValue to the next column. In the EditValue you have placed a click statement to open the menu. However in the popup cell you have no field editor because you not invoke it by using an EditFieldText message. EditFieldText are usable when the cell contains a field.
I'm far to have the knowledge of Trevor, but here is a possible solution. This solution consists to let know to the datagrid that you used a menu control in a cell and manage the tab in this special case, inside the datagrid group.
1) Create a new property in your datagrid group script:
Code: Select all
local lTabToColumn
setProp uCurrentColumnWasNotField pTheCurrentColumn
put pTheCurrentColumn into lTabToColumn
end uCurrentColumnWasNotField
getProp uCurrentColumnWasNotField
return lTabToColumn
end uCurrentColumnWasNotField
This property will take the name of the column you need to manage the tabkey
2) In the menuPick handler located in the column behavior set the property with the name of the column
Code: Select all
on menuPick pTheMenuItem
doYourStuff --
set the uCurrentColumnWasNotField of the dgControl of me to "myPopupColName1"
end menuPick
3) Add a tabkey handler in the datagrid group:
Code: Select all
on tabKey
local tCurrentColumn, tCurrentRowNumber
put the uCurrentColumnWasNotField of me into tCurrentColumn
if (tCurrentColumn is not empty) then
put item 1 of the dgHilitedLines of me into tCurrentRowNumber
if (tCurrentColumn is "myPopupColName1") then
put "Name" into tPreviousCol
put "Col4" into tNextCol
else if (tCurrentColumn is "myPopupColName2") then
put "Col1" into tPreviousCol
put "Col3" into tNextCol
else
codeWhatYouNeedHere --
end if
if (the shiftKey is "Down") then
EditCell tPreviousCol,tCurrentRowNumber
else
EditCell tNextCol,tCurrentRowNumber
end if
set the uCurrentColumnWasNotField of me to empty
else
pass tabkey
end if
end tabKey
In the variables tPreviousCol and tNextCol, give the name of the previous and next column you want after the choice of a value in a popup menu. Use tab to edit the next column, use shift + tab to edit the previous column
Regards,