Monday, October 1, 2012

Getting XForms and JavaScript to be even better friends

Brothers Compared to general purpose languages, XForms and tools like Form Builder provide higher level abstractions tailored for a specific job: creating forms.

When you can implement your validation logic in a declarative way, does it instead make sense to program it in JavaScript, adapt that JavaScript to run on all mainstream browsers, and then write it again in Java so validation can also run on the server? Most likely not.

So, can we all forget about JavaScript, and use XForms instead? Certainly not! Orbeon Forms is itself implemented using general purposes languages, and there are time when the abstractions provided by XForms or Form Builder are not the right tool for the job. In those cases, you’ll want to write client-side or server-side code, and for that reason we’re working hard not only on making Form Builder better, but also on making underlying technologies better. This includes moving to modern and powerful technologies like Scala, CoffeeScript, LESS, and Bootstrap, but also improving the way those technologies integrate with XForms.

As an exemple, we’ve recently extended the JavaScript API to allow properties, or set of key/value pairs, to be sent along events, when dispatching an event from JavaScript to XForms. This makes it easier for your JavaScript code to communicate with your XForms code, something you would typically do when implementing your own widgets or form components using XBL.

No comments:

Post a Comment