XForms

Mark Birbeck's picture

What is XForms?

XForms is a relatively recent standard from the W3C, designed to allow us to create sophisticated user interfaces using mark-up. This means that defining a user interface is much the same as using HTML, except that XForms has been designed from the ground up to cope with many of the things that we usually have to dive into script to do.

And XForms doesn't just make it easy to replace script in our applications, it also provides us with the means to manipulate and validate XML; unlike most languages that you might have used, XForms brings XML right into the heart of the language.

Mark Birbeck's picture

Introduction to XForms

A key idea of our approach to building internet applications is making good use of standards-based languages, in particular XForms.

XForms is an exciting new language from the W3C that can be used to create anything from simple forms to complex Web 2.0 applications. XForms are dynamic, cross-platform, accessible, script-free...and 100% standard.

This handbook covers everything you need to know to get started with XForms. You'll start with a simple walkthrough to get your development environment up and running, then create two fully functioning applications--one that saves links to del.icio.us, and another that searches Flickr. Both use CSS-driven Ajax animations.

Once you've seen what XForms can do, building web applications will never be the same!

Mark Birbeck's picture

A toolbar for searching the Prototype API documentation

formsPlayer toolbar for searching Prototype API docs

A recent announcement that documentation for the Prototype Ajax library was now available was followed almost immediately by a rather neat looking desktop gadget and a Firefox sidebar. Not to be outdone, I decided to put together a toolbar for Internet Explorer, and managed to do the whole thing with one XForms form control and an action handler--and of course, no script.

Mark Birbeck's picture

Understanding the XForms dependency-engine

A key component of an XForms processor is the dependency-engine. The idea is pretty straightforward, and will be familiar to anyone who has used a spreadsheet; if some item has its value set by a calculated expression that contains references to other items, then when any of those items change, the first item must be recalculated. It's not necessary to understand the dependency-engine when programming XForms, but having some familiarity with how it works may help when structuring forms.

Bubbling events beyond the document boundary

Backpack Reminders in the Sidewinder Viewer

We've just started developing a new sample for the Sidewinder Viewer which, among other things, demonstrates basic communication between a running script and the rendered document. The sample uses the Backpack web service, via its RESTful API, and is something that we shall continue to develop as the viewer becomes more powerful.

Message issue with xf:action

Hello,

<xf:action ev:observer="put-file" ev:event="xforms-submit-error">
<xf:message level="modal">Submit error</xf:message>
</xf:action>

This message appears when loading form at top left without dispatching action !!!
Regards

david_dupont73's picture

Synchronization problem with Dynamic XForm

Hi,
It seems they're a synchronisation problem when i execute Xform code which has injected dynamically with an AJAX Method (using AJAX.NET and ASPX page).
Here, the dynamic code with as inserted in my Xform Code after a the user action.
<xf:trigger>
<xf:label>Rallye Orpi du Maroc 2005</xf:label> <xf:action ev:event="DOMActivate">
<xf:setvalue
ref="instance('inst-browsing')/id_session_sheet"
value="2" />
<xf:setvalue
ref="instance('inst-session-id')/study_id"
value="2" /> <xf:message level="modal">First Message</xf:message>
<xf:dispatch name="set-study" target="document"/>
</xf:action>
</xf:trigger>

The Xform Action 'set-study' is including in my Xform Code.
Here a code sample:
...
<xf:action ev:event="set-study">

david_dupont73's picture

IE Crash after loading XML data in a complex Xform formular

I use a complex XForm formular to store data to a Server.
This complex formular (coding in Xform and Ajax) loading several Xform instance (with Submission) which are synchronised with an Observer attribut (on Action Xform componement).

But sometimes (and not at regular time) IE Crash. Two kind of error occurs.
this errors Occurs after serveral loading of Xform instance (something a the first time).
The first error is a javascript error:
Error opening registry key
Error: "HKEY_LOCAL_MACHINE\SYSTEM\cuurentControlSet\Services\Eventlog\Application\formsPlayer"
Code:0

The Second Error "Freeze" the IE Browser.
When i analyse the Error with "Microsoft WinDbg 6", I Obtain this Error message:


(880.87c): Unknown exception - code e0000001 (first chance)
(880.87c): Unknown exception - code e0000001 (first chance)

david_dupont73's picture

Html anchor bug inside <Select1> control

Hi,

When i click on the Anchor Html "Polarization" inside a <xf:label> of a <Select1> control , i Obtain Javascript Error.
Here a sample code which generate the error:
....
<xf:select1 bind="bnd-refPolarization" id="cboPolarization" model="document" appearance="minimal" class="editPolarization">
<xf:label>

<a href="#"
onclick="displayAdminControl(this,'refPolarization');">
Polarisation
</a>

</xf:label>

<xf:itemset model="document"
nodeset="instance('inst-empty')" >
<xf:label ref="empty" />
<xf:value ref="id_empty" /> </xf:itemset> </xf:select1>
....

Now, when i move <xf:label><a href=...></a></xf:label> outside the <Select1> Xform control, all work fine.

Problem displaying angle brackets in a select1 list

Hi there,

Is there any way to display angle brackets in a select1 list? I have the following code:

<xf:item>
<xf:label><10m</xf:label>
<xf:value><10m</xf:value>
</xf:item>

When rendered, the list displays &lt;10m rather than <10m

Alternatively, the following behaves in the same way:

<xf:item>
<xf:label>&lt;10m</xf:label>
<xf:value>&lt;10m</xf:value>
</xf:item>

Cheers,

Anu