Comments (11)
We created the following example to showcase what we would need from the form integration:
This Task uses 2 different error events, distinguished by the error code. The second one uses the optional error message. In the form, it could look like this if we embedd the buttons into the form
Here, the error would be handled by Tasklist the same as a submit, e.g. with an form.on('errorTrigger')
event. The event needs the error code and message.
If we want to use external submit buttons
The schema needs to contain information whether errors are possible, as well as the error codes and labels. We could reuse the programatic submit event if we know which element could contain the error message.
from form-js.
I will try my best :)
Real life scenario
In a human task workflow to review invoices. In case the Invoice is missing details, such as the correct Tax-ID, I want to trigger an error boundary event by clicking on a "Invoice incomplete" button in the form.
The button would be styled like the default button with custom label.
Data to be passed
- error or escalation ID: this does not depend on user input and is needed to identify which error event is triggered.
- (optional) error message: In case the user wants to add details for the error. This would depend on user input.
- Variables: The Form can still be completed and variable changes submitted. I am open to discuss if this would be the expected behavior or if the edit should be "aborted"
from form-js.
Sorry for not getting back to you, I wanted to run our options by product management first :)
In our case, external buttons would not be feasible, as Tasklist uses forms provided by the user. Not all Tasks will have error boundaries, so we need information whether the Form contains "error fields". We could define naming convention for error fields, but that would be inconvenient for the user.
@ThorbenLindhauer and me would like to discuss the possibilities in the next cross-team sync
from form-js.
To better understand the overall scenario, could you back up your issue with a simple, real world scenario?
How would that throw button look like?
What data would be passed? Would it depend on user input?
from form-js.
Thanks, I do understand better now.
From the core form renderer point of view that is likely two different kinds of submit
buttons, that trigger submit of different data.
From the Form SDK perspective, that is handling the different submits and triggering the respective follow up actions.
We'll keep this one on the back of our heads. Thanks for reporting.
from form-js.
Given the nature of this library (a pure form renderer / editor) we're inclined to not add such feature.
Do you see a way to handle the custom events use-case outside the form? Especially when you have external submit buttons, adding an extra button that extracts some form element value and does not complete but trigger an error seems to be straight forward to me.
from form-js.
@marstamm any feedback on https://github.com/bpmn-io/camunda-forms/issues/3#issuecomment-780635394?
from form-js.
Next step: Get a end-to-end example to work with further regarding this topic.
from form-js.
Additionally to this, I would like to have the possibility to create any kind of event (free text) and react to it.
Example scenario is a Form, where a field is used to enter a search term. A button (that does not submit the complete form) will then throw a custom event (for example 'search') that my js this form is embedded to can be subscribed to with a custom function.
from form-js.
Additionally to this, I would like to have the possibility to create any kind of event (free text) and react to it.
Could you share a mock-up of a form that requires this? Without having the full context I'd assume this is better handled via a custom form control.
from form-js.
After our very insightful talk, I created this issue: 230. Please regard my comment on this as obsolete.
from form-js.
Related Issues (20)
- Extend the Expression form component to compute variables when form is loaded / initiated HOT 1
- Elements disappear while after drag n drop on the editor HOT 1
- Adding Direction Property to Properties Panel - RTL support HOT 1
- `getSchemaVariables` ignores expression field expressions HOT 1
- Build out the `form-js-render` package HOT 2
- AI form generator cannot select a default value
- `parent` accesssor in feel expressions doesn't behave normally HOT 1
- Tasklist form is not fitting to the screen
- Ability to Restrict Available Form Elements in Form-js
- Labels are added to the schema for unlabeled fields
- When dragging, `rootRef.current` might be null HOT 2
- Clear out usages of shouldSort HOT 1
- Support configuring a form to read right to left via the properties panel HOT 6
- Packages not recognizing the current version of node when installing form-js HOT 1
- Jalali calendar support for form date-time element HOT 3
- Build out the `form-js-viewer-core` package HOT 1
- Can suport i18n feature
- Element disappears while dragging HOT 4
- Possibility to not submit a form component variable
- TypeError: Cannot read properties of undefined (reading 'layout') HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from form-js.