Abhishek Goel | 15 Jan 23:04

Does the required attribute work on a bind?

I am new to xforms/apogee and haven't been able to find a resolution to a seemigly simple problem. I downloaded the three packages (org.nuxeo.xforms.core/ui/ui.editors) and am currently trying to learn by modifying the given examples.
 
In org.nuxeo.xforms.ui.test/Example1.java, I replaced the line

XInputSource src =

new URLInputSource(Example1.class.getResource( "example1.xhtml"));

with

  XInputSource src = new URLInputSource(Example1.class .getResource("document.xhtml"));

and commented out the lines (not inclusive) between

final UIForm uiForm = new SWTBuilder().build(form, shell); and shell.setBounds(10, 10, 400, 200);

As a result I was able to see the SWT form generated by document.xhtml. I then tried to submit the form by leaving the "title" field empty, but got an exception. This indicated that the minLength validation in document.xsd works. However, when I removed the minLength and maxLength validation and again tried to submit the form leaving the "title" field empty, I expected to get an exception but did not get one. I was expecting an exception because of the line

<bind nodeset="/document/metadata/title" id="title" required= "true()"/>

inside document.xhtml.

So, my question: Is the "required" validation feature not been implemented? If it has been can someone please guide me as to how do I validate a field to ensure that the user enters a value.

Thanks.

Abhishek Goel

 

 

_______________________________________________
Apogee mailing list
Apogee@...
http://lists.nuxeo.com/mailman/listinfo/apogee

Gmane