I have a MVC template 3.
After validating a header field ( formfield
), set focus to grid
.
How to do this?
I have a MVC template 3.
After validating a header field ( formfield
), set focus to grid
.
How to do this?
It is not recommended to refresh the view within a template validation. Therefore the correct one is to use the mechanisms of the VIEW itself: in viewdef ....
bBloco := {|oV,cId,cField,xV|MinhaAcao(oV,cId,cField,xV)}
oView:SetFieldAction("CAMPO",bBloco)
To focus on the Grid:
Static function MinhaAcao(oView,cIDView,cField,xValue)
Local oGrid := oView:GetviewObject(cIDVIEW)
oGrid:SetFocus()
return
If you have not solved it, you need to be the code block in bGotFocus
da
FWFORMVIEW():AddGrid(<cViewID >, <oStruct >, [ cSubModelID ], <uParam4 >, [ bGotFocus ])
No bGotFocus
I made the following section, like this whenever the Grid
gets the focus it returns to the field I want, so I created a control variable for it.
oView:Refresh()
oView:GetViewObj("FIELDZZ5")[3]:getFWEditCtrl("ZZ5_QUANT"):oCtrl:SetFocus()