Callback Parameters

Posted on
Mon Nov 06, 2017 8:23 am
DaveL17 offline
User avatar
Posts: 6756
Joined: Aug 20, 2013
Location: Chicago, IL, USA

Callback Parameters

This has probably been asked before.... Is it possible to pass parameter values to a function callback? Something like:

Code: Select all
<Field id="aButton" type="button">
    <Label>A Label</Label>
    <Title>A Title</Title>
    <CallbackMethod>someCallbackMethod(parm1='foo', parm2='bar')</CallbackMethod>
</Field>
I tried a couple different constructions but came up empty.

I came here to drink milk and kick ass....and I've just finished my milk.

[My Plugins] - [My Forums]

Posted on
Mon Nov 06, 2017 8:43 am
kw123 offline
User avatar
Posts: 8366
Joined: May 12, 2013
Location: Dallas, TX

Re: Callback Parameters

I guess it’s the valuesdict only.
Q why would you want to not use the valuesdict?
You can have hidden fields you can read and set in the plugin



Sent from my iPhone using Tapatalk

Posted on
Mon Nov 06, 2017 8:52 am
DaveL17 offline
User avatar
Posts: 6756
Joined: Aug 20, 2013
Location: Chicago, IL, USA

Re: Callback Parameters

kw123 wrote:
Q why would you want to not use the valuesdict?

More for simplicity than anything really.

valuesDict will work but requires two controls for each callback (one for the control and one for the payload).

I came here to drink milk and kick ass....and I've just finished my milk.

[My Plugins] - [My Forums]

Posted on
Mon Nov 06, 2017 9:05 am
matt (support) offline
Site Admin
User avatar
Posts: 21417
Joined: Jan 27, 2003
Location: Texas

Re: Callback Parameters

No way to do this currently. When I've needed similar functionality I've created stub callback methods that then call through to a shared method with the constant argument added.

Image

Posted on
Mon Nov 06, 2017 9:16 am
DaveL17 offline
User avatar
Posts: 6756
Joined: Aug 20, 2013
Location: Chicago, IL, USA

Re: Callback Parameters

matt (support) wrote:
No way to do this currently. When I've needed similar functionality I've created stub callback methods that then call through to a shared method with the constant argument added.


Thanks Matt - you know what would be an awesome feature? :D

Code: Select all
<Field id="aButton" type="button">
    <Label>A Label</Label>
    <Title>A Title</Title>
    <CallbackMethod>someCallbackMethod(payload={'parm1': 1, 'parm2': 2})</CallbackMethod>
</Field>
Seriously though, passing the parms using a hidden control will work just fine for my purposes.

I came here to drink milk and kick ass....and I've just finished my milk.

[My Plugins] - [My Forums]

Page 1 of 1

Who is online

Users browsing this forum: No registered users and 3 guests