Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Radio as button group doesn't trigger CDD #1224

Closed
trob opened this issue Apr 6, 2014 · 9 comments
Closed

Radio as button group doesn't trigger CDD #1224

trob opened this issue Apr 6, 2014 · 9 comments

Comments

@trob
Copy link

trob commented Apr 6, 2014

http://www.fabrikar.com/forums/index.php?threads/where-for-dbjoin-using-data-in-current-form.38195/
ok, if radio element is set to buttongroup=no

@trob trob closed this as completed May 10, 2014
@trob trob reopened this May 10, 2014
@trob
Copy link
Author

trob commented Sep 25, 2014

It seems button groups need "onclick" to trigger (e.g. in ajax calc, CDD,...)
http://www.fabrikar.com/forums/index.php?threads/show-or-hide-field-based-on-another-yes-no-field.39584/#post-199044

@cheesegrits
Copy link
Member

Hmmm. the only solution I can think of for that is to add an element model method, like changeEvent(), which in the main element model just return 'change', but can be overridden in specific element plugins to return 'click' if that's what the element knows it needs. Then in the calc element's elementJavascript(), where it builds the $opts->observe array (a list of element full names used by the calc), loop through the that array, load up the element model by name, call $elementModel->changeEvent() for each one, build an $opts->observeEvents array, and in the calc's attachToForm() method in the JS, use that for attaching the event that triggers the calc.

Long way round the houses, but I don't see any other way round it.

@trob
Copy link
Author

trob commented Feb 18, 2015

It's not only calc but also CDD

@cheesegrits
Copy link
Member

Ignore all that. I can just add a getChangeEvent() in element.js, and override it in specific elements, like yesno.js, then call that in the calc's init.

@cheesegrits
Copy link
Member

OK, should be fixed as of f648384

@Duke3D
Copy link

Duke3D commented Aug 29, 2015

Has the fix been confirmed? Does something need to be added to the element setup for calc to be triggered by a button group? Adding elements in watchlist with ..._raw did not help.

@trob
Copy link
Author

trob commented Aug 30, 2015

The fix was for yesno only, radiobutton is still missing.
#1531

I don't know if it can be removed from yesno then (extends radio)

@trob trob reopened this Aug 30, 2015
@cheesegrits
Copy link
Member

Should be fixed in 5267bd4

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants