Page 1 of 1

Find group or ID of XBP in eventhandler

Posted: Mon Nov 28, 2022 6:01 am
by jdsoft
Hello,

A custom eventhandler is used in DCREAD.
In a browse, the F10 key adds a rown to the browse.
Now i have added a 2nd browse is the same dialog.
This second browse does not support the F10 key.

How can i test the ID or GROUP from the oXbp, so i can conditionaly suppress the F10 key ?

Code: Select all

FUNCTION MyEventHandler(nEvent,mp1,mp2,oXbp,oDlg)
LOCAL nDcGui            := DCGUI_NONE                             // Event verder afhandelen 
If nEvent = xbeP_Keyboard .and. ValType(oXbp) = "O"
   Do Case
      Case mp1 = xbeK_F10
         Do Case
            Case oXbp:IsderivedFrom("xbpbrowse")                  // F10 in browse is invoegen nieuw artikel 
               Oh_werkopdracht_Materiaal_Invoegen(oXbp)
               nDcGui := DCGUI_IGNORE
            Case oXbp:IsderivedFrom("xbpCellGroup")               // F10 in browse is invoegen nieuw artikel 
               Oh_werkopdracht_Materiaal_Invoegen(oXbp)
               nDcGui   := DCGUI_IGNORE
         Endcase 
   EndCase 
EndCase 
Return nDcGui 

Re: Find group or ID of XBP in eventhandler

Posted: Mon Nov 28, 2022 8:44 am
by reganc
You can use dc_getobjectid(oXbp) to get the Id.

Re: Find group or ID of XBP in eventhandler

Posted: Mon Nov 28, 2022 8:56 am
by rdonnay
This should give you what you want, Jack.

Code: Select all

LOCAL aGetListItem := oXbp:getList:getListArray[oXbp:getList:getListPointer]
LOCAL cId := aGetListItem[cGETLIST_ID]
LOCAL cGroup := aGetListItem[cGETLIST_GROUP]

Re: Find group or ID of XBP in eventhandler

Posted: Mon Nov 28, 2022 11:59 am
by jdsoft
Thanks for the reply's

Dc_GetObjectId(oXbp,GetList) does the job perfectly.