Page 1 of 1

dcget and popup

Posted: Fri May 08, 2015 11:40 pm
by c-tec
Hello,
actually I stuck on a simple task: when a popup codeblock form get is called, I would like to call the action codeblock of another pushbutton.
In my case I choose a user in the popup and would like to set the filter immediatly after evaluating the popup codeblock. I have tried to send a mouse down event to the button object, but it does not work. Maybe there is a more elegant solution for this.
regards
Rudolf

Code: Select all

@ 1,1 dcsay "User" get nUser PICTURE "99999" SAYSIZE  0  POPUP {|c|pop_user(c,getlist,"BUTTONFILTER")}
...
@ 2, DCPUSHBUTTONXP CAPTION "Filter" SIZE 10,1.3 ACTION {||setfilter(nUser)}  ID "BUTTONFILTER"
...

function pop_user(c,aGetlist,cID)
...
oButton := DC_GetObject(aGetList,cID)
postappevent(xbeM_LbClick,,,oButton)

RETURN c

Re: dcget and popup

Posted: Sat May 09, 2015 5:36 am
by rdonnay
You can activate a button like so:

DC_GetObject(GetList, "BUTTONFILTER"):activate()

Re: dcget and popup

Posted: Sun May 10, 2015 9:02 am
by c-tec
Hello Roger,
thank you, but was a little bit tricky, the resultvalue from the popup is at this point not available, only after the function returns. So I did it this way:

in the popup:

Code: Select all

     
eval(DC_GetObject(aGetList,cClick):actionblock,[b]"USER:" + ntrim(c)[/b])
in the filter function:

Code: Select all

function filter_form(cF_SEITE,dF_DATUM,nF_PROJEKT,cF_ID,nF_UID,cF_AUFTRAG,nF_FSID,lQuartal,lOffene,cPara)
******************************************************************
...
if !empty(cPara)
     do case
          case "USER:" $ cPara
               nF_UID := val(token(cPara,":",2))
          case "PROJECT:" $ cPara
               nF_PROJEKT := val(token(cPara,":",2))
     endcase
endif
...
maybe there is a more elegant solution, but it works now.
regards
Rudolf