Databases Reference
In-Depth Information
Type-specific controls —If you know an element is a specific data type, XForms can
automatically change the user interface control. Boolean true/false values
appear as true/false check boxes and date fields have calendars that allow you
to pick the date.
Autocomplete —As users enter characters in a field, you want to be able to suggest
the remainder of the text in a field. This is also known as autosuggest .
Although these aren't the only features that XForms supports, they give you some idea
of the complexity involved in creating forms. Now let's see how these features can be
added to forms without the need for complex JavaScript.
9.4.2
Using XRX to replace client JavaScript
and object-relational mapping
All of the features listed in the prior section could be implemented by writing
JavaScript within the web browser. Your custom JavaScript code would send your
objects to an object-relational mapping layer for storage within an RDBMS , which is
how many enterprise forms are created today. If you and your team are experienced
JavaScript developers and know your way around object-relational frameworks, this is
one option for you to consider. But NoSQL document stores provide a much simpler
option. With XRX , you can develop these complex forms without using JavaScript or
an object-relation layer. First let's review some terminology and then see how XRX can
make this process simpler.
Figure 9.6 shows the three main components of a form: model, binding, and view.
When a user fills out a form, the data that's stored when they click Save is called the
model . The components that are on the screen and visible to the user, including items
in a selection list, are referred to as the view components of a form. The process of
associating the model elements with the view is called binding . We call this a model-view
forms architecture .
To use a form in a web browser, you must first move the default or existing form
data from the database to the model. After the model data is in place, the form takes
over and manages movement of data from the model to and from the views using the
bindings. As a user enters information into a field, the model data is updated. When
Model
Binding
View
<item>
<id> 1 </id>
<name> Item Name </name>
<desc> Detailed description of item 1 </desc>
<category> medium </category>
<status> draft </status>
<tag> tag-1 </tag>
</item>
Figure 9.6 The main components in a form. The model holds the business data to be saved to the
server. The view displays the individual fields, including selection list options. The binding associates
the user interface fields with model elements.
Search WWH ::




Custom Search