![Oracle Drags Its Feet in the JavaScript Trademark Dispute](https://cdn.sanity.io/images/cgdhsj6q/production/919c3b22c24f93884c548d60cbb338e819ff2435-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Oracle Drags Its Feet in the JavaScript Trademark Dispute
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
aurelia-formio
Advanced tools
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.
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.
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.
There are also a number of events that get fired for the form 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.
FAQs
Form.io renderer and builder for Aurelia.
We found that aurelia-formio demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.