This repository is now considered legacy and no longer supported. Please take a look at our recent repositories and help documentation at the following links.
- https://help.form.io
- https://github.com/formio/formio.js
- https://github.com/formio/formio
- https://github.com/formio/react
- https://github.com/formio/angular
- https://github.com/formio/vue
This is a JSON Form Renderer and Builder for the Aurelia Framework
To install this within your application, type the following.
npm install --save aurelia-formio
Now, within your application configuration, register this plugin as follows.
export function configure(aurelia: Aurelia) {
aurelia.use
.standardConfiguration()
.plugin(PLATFORM.moduleName('aurelia-formio'));
To embed the Form renderer within your application, you need to use the following component.
<formio></formio>
There are several parameters that can be passed to this component which are as follows.
- src - This is the Form.io Form URL
- form - The JSON schema of the form you wish to render.
- submission - The submission object to populate the form with.
- options - JSON options to pass to the renderer.
To render a Form.io form, you can pass the URL of that form to the form renderer like the following.
<formio src="https://examples.form.io/example"></formio>
To render a JSON form, you can create a JSON form object within your ModelView class and then bind it to the form parameter as follows.
app.ts
export class App {
private form: any = {
components: [
{
type: 'textfield',
input: true,
key: 'firstName',
label: 'First Name'
},
{
type: 'textfield',
input: true,
key: 'lastName',
label: 'Last Name'
}
]
};
}
app.html
<template>
<formio form.bind="form"></formio>
</template>
You can also set the submission of the form that is filled out using the following.
app.ts
export class App {
private submission: any = {
data: {
firstName: 'Joe',
lastName: 'Smith'
}
};
}
app.html
<formio src="https://examples.form.io/example" submission.bind="submission"></formio>
There are a number of options available to the Form.io renderer that can also be passed to this renderer.
app.ts
export class App {
private submission: any = {
data: {
firstName: 'Joe',
lastName: 'Smith'
}
};
private formOptions: any = {
readOnly: true
};
}
app.html
<formio src="https://examples.form.io/example" submission.bind="submission" options.bind="formOptions"></formio>
There are a number of events that also get fired within the renderer.
- change - Fired when the submission changes within the form.
- formLoad - Fired after the form is done loading.
- render - Fired after the form is done rendering.
- error - Fired when a submission error occurs.
- submit - Fired after a submit has been performed to the server.
You can register for events within this application as follows.
app.ts
export class App {
private submission: any = {
data: {
firstName: 'Joe',
lastName: 'Smith'
}
};
onSubmissionChange(changed: CustomEvent) {
console.log(changed);
}
}
app.html
<formio src="https://examples.form.io/example" submission.bind="submission" change.delegate="onSubmissionChange($event)"></formio>
This library also provides a robust Form Builder interface with the following component.
<form-builder form.bind="myForm"></form-builder>
The following options are provided to the form builder.
- form - The form JSON to provide as a default to the builder.
- options - The form builder options to provide to the builder.
There are also a number of events that get fired for the form builder.
- change - Triggered everytime the form schema changes in the builder.
Here is an example application that listens to the change events from the form builder as well as provides a default form.
app.ts
export class App {
private form: any = {
components: [
{
type: 'textfield',
input: true,
label: 'First Name',
key: 'firstName'
},
{
type: 'textfield',
input: true,
label: 'Last Name',
key: 'lastName'
}
]
};
onFormChanged(changed: CustomEvent) {
console.log(changed);
}
}
app.html
<form-builder form.bind="form" change.delegate="onFormChanged($event)"></form-builder>
For a working example application, take a look at the example folder found within this repository.
aurelia-formio's People
Forkers
brianjlacy koraypakyurek suresh44t kvivek4you raju1488 g0ncharuk-dev davidlni hungud leoglobant forkedit slamj1 appcoreopc udhayamgit markuplab-tech sangkyunyoon cac-groups timnape joaquimsn douglasadriani jeffdoolittle johanwasserman pros-pano mosfet2011 samanrabiei glyad mrcavalcanti swg2 gentijoaurelia-formio's Issues
glyphicons are not appearing or displayed.
Hi there,
You are creating awesome things and doing fabulous job.
I somehow implement the example in esnext, originally written in typescript.
So, here the problem is glypicons are not displayed as shown in the below image,and throws error as shown below:
And, there are so many things in form builder, how I can customise them, as per requirement, could you provide some details.
How do i customize the component settings?
How do I hide/customize the component settings(TextField etc). I don't want the user to customize the API or logic tab.
Self-hosted form
Environment
I'm currently evaluating formio in a aurelia environment. The application runs self-hosted and may not send data outside the firewall. So, I want to catch the submission of a form and process it locally, with the submission object.
- Hosting type
- [] Form.io
- Local deployment
- Formio.js version: current (installed: 02/2023)
- Frontend framework: aurelia
- Browser: Chrome
Steps to Reproduce
- Starters project of aurelia
- Installation of formio-aurelia as in guide
Expected behavior
Wanted: to be able to catch the submit event
Observed behavior
On submit the spinner in the button keeps turning and nog submit event seen.
Thanks for any advice
Error when run the example
I tried to run the example https://github.com/formio/aurelia-formio/tree/master/example
-
npm install
to install -
au run --watch
to run -
but when drag and drop the element, it not work, with error
TypeError: Cannot read property 'map' of undefined
at Webform.renderComponents (NestedComponent.js?e8fd:257)
at Webform.render (Webform.js?ede4:668)
at WebformBuilder.editComponent (WebformBuilder.js?7ff3:457)
at WebformBuilder.onDrop (WebformBuilder.js?7ff3:372)
at Object.eval (WebformBuilder.js?7ff3:308)
at emitter (emitter.js?f3f2:47)
at Array.forEach (<anonymous>)
at Object.eval (emitter.js?f3f2:46)
at Object.thing.emit (emitter.js?f3f2:38)
at drop (dragula.js?612e:261)
at HTMLHtmlElement.release (dragula.js?612e:245)
Please help. Thank you very much
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.