dcget and popup

This forum is for eXpress++ general support.
Post Reply
Message
Author
c-tec
Posts: 379
Joined: Tue Apr 20, 2010 1:36 am
Location: SALZBURG/AUSTRIA
Contact:

dcget and popup

#1 Post 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
Rudolf Reinthaler
digital pen & paper systems
http://www.formcommander.net

User avatar
rdonnay
Site Admin
Posts: 4813
Joined: Wed Jan 27, 2010 6:58 pm
Location: Boise, Idaho USA
Contact:

Re: dcget and popup

#2 Post by rdonnay »

You can activate a button like so:

DC_GetObject(GetList, "BUTTONFILTER"):activate()
The eXpress train is coming - and it has more cars.

c-tec
Posts: 379
Joined: Tue Apr 20, 2010 1:36 am
Location: SALZBURG/AUSTRIA
Contact:

Re: dcget and popup

#3 Post 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
Rudolf Reinthaler
digital pen & paper systems
http://www.formcommander.net

Post Reply