-
-
Notifications
You must be signed in to change notification settings - Fork 513
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
Bind Api: Make it easy to create forms with .bind like api. #3687
Comments
After a long summer holiday reflecting on this, I still think this functionality is key missing piece making Panel harder to use with the
|
Creating a form with a submit button is certainly a common pattern. I've had to add many forms to an app and we came up with a component that customizes that a little bit more. What you often find in a form is a I don't know if the solution to that is in a new API. For sure a first good step would be to document how to create a form with a submit button, with |
Request
Make it simple to create forms with
.bind
like api.Motivation
I'm trying to create an example for lighting.ai. One of the pages is a form.
I would like to
pn.bind
api as that is the recommended one.But I found it takes thinking and wrapper functions to support this very common workflow with the
pn.bind
api.Form code: As Is
I would like to avoid the
submit
wrapper function to make things simpler and more readable. I think this is a very common pattern and should be supported.Form Code: To Be
We could introduce
bind_as_form
This would make the api much simpler
Optionally
submit
could be a list such that multiple widgets could trigger a reexecution of theexecute_business_logic
function.Additional Context
I've tried to consider the other apis. But I don't want to use
interact
orParameterized
classes here aspn.bind
is the text book api to use. With watch you still need to create a wrapper function.Abstraction
Analyzing
bind_as_form
a bit more we can see that it really does several thingsIn principle
bind_as_form
could be replaced by a two step process generalized processThe text was updated successfully, but these errors were encountered: