Erwin's StarOffice Tango
Erwin Tenhumberg's Insights into Open Source and Dancing
... or why Open Competition matters

20050413 Mittwoch April 13, 2005

Just switch! - XML Form Documents in StarOffice 8
From some recent feedback I got the impression that many people are interested in the XForms technology. Therefore, I decided to do some kind of little tutorial about the XForms support in StarOffice 8 here in my blog.

Today I will start with a very simple form that I will try to enhance and extend in some of my future blog entries. In order to use a real life scenario for my demo, I decided to implement an expense report form. Hopefully at some point I even will be able to add a little backend system that processes the form data.

A new XML form document can be created via "File - New - XML Form Document":



In order to have all important tools easily accesible, one first should check if the right toolbars are activated. Under "View - Toolsbars" the first two "Form" related toolbars should be selected:



In the "Form Design" toolbar the "Data Navigator" should be selected, since we will need it later:



First, we type some text and create two text boxes with the "Text Box" tool:



Next, we select a text box and open the "Control ..." menu via right-click:



Now we set the name and the tab order for the first text box:



Then we pick the automatically created default XML data model "Model 1" and type in an arbitrary name for the binding expression:



Next, we perform the same steps for the second text box ...



... including the model and the binding:



Now we will use the Data Navigator that I mentioned earlier. Under the "Bindings" tab our defined bindings should be visible and the default model should be listed in the combo box on the left side of the "Models" button. If the default model "Model 1" is not listed, just deactivate and activate the Data Navigator one time (this is/was a bug). In the Data Navigator pick a binding, do a right-click and select edit:



In this dialog we can define that our fields are mandatory/required:



Now, we toggle between the design and run mode to test the form.



The red frame and the error message indicate that the fields are mandatory and have to be filled out:



Since we want to be able to do something with the data from the form, we need to add a "Submission". Thus, we toggle back to the design mode, go to the Data Navigator again and click on the "Add Submission" button:



Next we fill out the "Add Submission" dialog as shown below. In this simple case we just save the data to a file:



Once the submission has been created one can just select the submission item in the Data Navigator and do a "drag and drop" onto the document. This automatically creates a submission button:



Now, we can switch to the run/test mode again and press the button to save the form data to a file. The output looks as follows:



In the future I will show how to customize the error messages and to define dependencies between fields.
( Apr 13 2005, 03:25:04 PM CEST ) Permalink Kommentare [7]


Kommentare:

This is just so cool!!! I would be very happy to see more information about this in the future ;)

Gesendet von Shai am April 14, 2005 at 07:08 PM CEST #

And I'm particulary interesed in what widget theme you use? :-) It's very nice :-)

Gesendet von Adam Kruszewski am April 14, 2005 at 09:06 PM CEST #

Cool concept - how about a Webservices integration demo?

Gesendet von Manish Katyal am Oktober 18, 2005 at 06:36 PM CEST #

I have tried this with OpenOffice 2.0 on Linux and works just fine from the first time. When I try the same thing, ofcourse changing the Submission-Action with Windows path like file://c:\dmd\xform_test.xml it won't work. No file is created. I have played with the path, but still no progress. Any hint what I'm doing wrong? Thanks!

Gesendet von Miroslav Jovanovic am Dezember 17, 2005 at 11:27 PM CET #

Miroslav, try file:///c:/dmd/xform_test.xml. Works for me ;-). Regards, Lars

Gesendet von Lars Skjærlund am April 25, 2006 at 03:10 PM CEST #

Erwin. I just followed this through and got it to work under Sun's Open Office 2.0.2 on SuSE 10.0. It's cool - hope you have time for another tutorial. Peter H

Gesendet von 212.19.66.101 am Mai 24, 2006 at 12:16 PM CEST #

I do not know what here to write, you have not accepted the letter on ours The organizations, have accepted as a spam. Our invalid organization. Respectfully Jonas Gapsys Director Funda

Gesendet von Administrator/Jonas Gapsys am August 06, 2007 at 06:16 AM CEST #

Senden Sie einen Kommentar:

Kommentare sind ausgeschaltet.

Archive
Links
Referenzierte URLs