Hi @StuckDuckF . I started a discussion below recently, that involves an issue regarding on_click callback and the event argument, which includes some proposed solutions. Does that help?
Mr. @ahuang11 I did not see where in the documentation it says that the event argument is necessary for the callback to be functional or it silently passes.
I unfortunately am not allowed to install discord on my organisation property.
I got a silent non execution but I have encountered the expected 2 arguments error before. I am just not clear when it is required and when it is not (different context make it work or not as in a param.Parametrized class or in a notebook)
I see the handler logic but I am not understanding how or where the necessary argument event is defined and the logic behind it. I assume it is unwrapped along with other args and passed to Bokeh directly. I’ll add it to the list of things I wish i could document on Holoviz Thank you so much for your effort.
I need to work on something else right now but I suspect I will have to investigate this whole callback for FileDownload working but not simple on_click inside param.Parametrized class.
@ahuang11 How come the official example Glaciers uses the hacky clear_button.param.watch(clear_selections, 'clicks'); instead of the .on_click notation?
I personnaly also use the clicks hack because .on_click is not consistent or stable in my experience, but I am curious if perhaps that is just the official way of doing it and on_click is used for a specific case apart?
I have not been able to deploy Panel applications using Buttons placed in the sidebar or dynamically created that use on_click with the effect of executing the passed callback.
I am still learning how Parametrized and Viewable classes work and what dynamically creating and linking objects in a live application based on them. I wonder if this is a begginer, intermediate or advanced type tutorial?
Do you have these issues only when using a template? Does it work without problems when you use it the code within in a Notebook without deploying to the web with a template?
Does it always fail silently? Can you post other code examples where it fails silently?
Can you post code where it fails with an error, and what is the error?
Have you tried the fixes below, and do they work?
You have to handle the event passed to the callback function, or prevent it from being passed. If the callback function only has (self), you should get the 2 arguments error.
Do you get that error when only using (self), or does it fail silently? Does changing your code to (self, …) as below fix it?