Page 1 of 1

Call a codeblock when exiting a Popup ?

Posted: Tue Dec 28, 2010 8:28 am
by GeneB
I'm looking for a way to call a code block upon exiting a popup. I would like to refresh items on the screen based on the item chosen in a popup. The only way I can see to do this is to refresh with a codeblock called by Valid, but this requires exiting the Get. Perhaps a new "POPEXIT" ?

If there is a way to do this now, I would appreciate being pointed in the right direction.
Thanks in advance.
GeneB

Re: Call a codeblock when exiting a Popup ?

Posted: Tue Dec 28, 2010 8:52 am
by rdonnay
You can do what you want inside the current code block.
Just make sure that the last value returned by the code block is the value you want put into the get.

Code: Select all

@ .. DCGET cVar POPUP {|c|PickVar(c),RefreshItems(c,GetList),c}


FUNCTION PickVar( c )

.. pick something

RETURN c

FUNCTION RefreshItems( c, GetList )

IF c == 'TEST'
  DC_GetRefresh(GetList,'TEST')
ENDIF

RETURN nil

Re: Call a codeblock when exiting a Popup ?

Posted: Tue Dec 28, 2010 7:34 pm
by GeneB
Works perfectly. Thanks for the tip.
Roger, you just turned a light bulb on in my head. I'm converting a huge program I wrote from Clipper to Express. I'm making headway, and it's a chore, but this one seemingly insignificant tip just made me see the power in manipulating Express's own code blocks. I'm finally starting to think in Express and not in Clipper.
Thanks again, GeneB

Re: Call a codeblock when exiting a Popup ?

Posted: Tue Dec 28, 2010 8:51 pm
by rdonnay
Excellent way to start the New Year. :dance: