This matter applies to all df versions with cdbCJGridColumnSuggestion,
The suggestion is - Enable up and down row navigation for cdbCJGridColumnSuggestion columns.
Problem demonstrated by:
Find a multiline order in orders.vw of the order entry database, position cursor in the Item ID column. Navigate rows with the down and up arrows. Performs as expected.
Change oInventory_Item_ID to cdbCJGridColumnSuggestion class.
When the suggestion list is not displayed, the up and down arrows no longer change rows for the Item ID column. << The bug.
This is caused by the following procedures In Winsuggestion.pkg
Code:
{ Visibility=Private }
Procedure Up
If (Focus(Desktop) = Self and ghoSuggestionList) Begin
Send ScrollUp of ghoSuggestionList
End
End_Procedure
{ Visibility=Private }
Procedure Down
If (Focus(Desktop) = Self and ghoSuggestionList) Begin
Send ScrollDown of ghoSuggestionList
End
End_Procedure
These limit up and down to only work when ghoSuggestionList is displayed (refer the and connector).
I subclassed cDbCJGridColumnSuggestionEdit with the following procedures
Code:
{ Visibility=Private }
Procedure Up
If (Focus(Desktop) = Self) Begin
If (ghoSuggestionList) Begin
Send ScrollUp of ghoSuggestionList
End
Else Begin
Send MoveUpRow
End
End
End_Procedure
{ Visibility=Private }
Procedure Down
If (Focus(Desktop) = Self) Begin
If (ghoSuggestionList) Begin
Send ScrollDown of ghoSuggestionList
End
Else Begin
Send MoveDownRow
End
End
End_Procedure
When subclassing cDbCJGridColumnSuggestion ensure you put the following in construct object
Set phcEditClass to (RefClass(cmyDbCJGridColumnSuggestionEdit))
Hat tip to Vincent who explained how to subclass cDbCJGridColumnSuggestionEdit in a recent post.
Voila up and down work as expected.
I expect this can be generalized if up and down navigation is required in suggestion forms which is the other place winsuggestion is used.