According to Wikipedia refers XML data binding to the process of representing the information in an XML document as an object in computer memory. This allows applications to access the data in the XML from the object rather than using the DOM to retrieve the data from a direct representation of the XML itself.
In other words you could tie HTML tables to Notes data and navigate through it without reloading the page.
For this SNTT demo I needed:
- a form to create Book documents with
- a view to present the books documents as XML
- a page on which I define an HTML table and connect the table to the XML view in order to give it content
- (a $$ViewTemplate for the Xml view)
- Create your Notes form with some fields. I choose Title, Author, ISBN and Price.
- Create a set of documents with this form.
- Create a view that presents the ‘Books’ documents as XML data.
- On the fifth tab under ‘Web access’ d not forget to set the option ‘Treat view contents as HTML’
- The view must start with an opener and closing tag for each document
- For each column you define sub child elements
- Setup a $$ViewTemplate for this View in order to be able to add a root element:
Reminder: do not forget to set the content-type for this Form as HTML.
- Create a Form/Page that will hold the HTML Table.
- Add the following HTML on it:
As you can see the Table is linked to a datasource, in this case the View books.xml. Each TD in the TBody part is linked to a datafield. In this setup the datapagesize is set to 5, meaning 5 documents at a time will be displayed.
By giving the table an ID (xmlTBL) you can add functions to navigate through the table such as:
- previous / next set of documents
- first / last set of documents
I bet you can imagine some much better pagination examples.
At the end your ‘bookstore’ will look like this:
I have included a working example here.