Sorry, your browser cannot access this site
This page requires browser support (enable) JavaScript
Learn more >

I have experience with several rapid application development frameworks in python, all of which uniformly bind element actions to Python functions to trigger updates or changes. So I should be fairly experienced in this area. However, Taipy genuinely puzzles me———it occasionally throws errors for no apparent reason…

In Taipy, when we pass a function object directly to the on_action (or on_change) property, we may randomly encounter errors like “function not valid”. For example, the following code snippet might fail:

1
2
3
4
5
tgb.table(
...
on_action=update_prod_link, # Passing the function name directly
...
)

But if we use an anonymous function instead, the aforementioned problem disappears and everything works fine:

1
2
3
4
5
tgb.table(
...
on_action=lambda s, v, p: update_prod_link(s, v, p),
...
)

Since the official examples are relatively simple and always use anonymous functions, and I haven’t seen similar feedback in the issue tracker, for now I can only resort to this redundant workaround…

Comments

Please leave your comments here