problems with constraint attribute in bind in Orbeon 3.6

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

problems with constraint attribute in bind in Orbeon 3.6

Jozef Aerts - XML4Pharma
In Orbeon 3.6, I have trouble with the following binding:
 
<xforms:bind nodeset="/CRF/IG_PE_BASE/I_WEIGHT" required="true()" type="xforms:integer" constraint="(.&lt;150)"/>

Without the constraint, the form works perfect.
 
With the constraint however, when the user types the character "A" (clearly not an integer) an error message pops up, giving technical details about where the error occurred in the software, i.e. a message that a typical user would not like to see.
The message essentially says that "A" cannot be evaluated against the constraint.
 
Now, I would suspect that when the user typed "A", the first test would be that it is an integer, and a "!" would be generated right of the field, and that no further testing against the constraint is done.
 
Bug or feature ? Or am I doing something wrong in my "constraint" statement ?

Many thanks in advance,

Jozef Aerts
XML4Pharma



--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
ObjectWeb mailing lists service home page: http://www.objectweb.org/wws
Reply | Threaded
Open this post in threaded view
|

Re: problems with constraint attribute in bind in Orbeon 3.6

Jack Cox
Jozef,

I would use a constraint like this to protect against the error you're
seeing:

constraint="(. castable as xs:integer) and (. &lt; 150)"

This way the first test will fail in a controlled manner and report the
constraint violation rather than xpath throwing an exception.

Jack


On 8/20/07 8:27 AM, "[hidden email]" <[hidden email]> wrote:

> In Orbeon 3.6, I have trouble with the following binding:
>  
> <xforms:bind nodeset="/CRF/IG_PE_BASE/I_WEIGHT" required="true()"
> type="xforms:integer" constraint="(.&lt;150)"/>
>
> Without the constraint, the form works perfect.
>  
> With the constraint however, when the user types the character "A" (clearly
> not an integer) an error message pops up, giving technical details about where
> the error occurred in the software, i.e. a message that a typical user would
> not like to see.
> The message essentially says that "A" cannot be evaluated against the
> constraint.
>  
> Now, I would suspect that when the user typed "A", the first test would be
> that it is an integer, and a "!" would be generated right of the field, and
> that no further testing against the constraint is done.
>  
> Bug or feature ? Or am I doing something wrong in my "constraint" statement ?
>
> Many thanks in advance,
>
> Jozef Aerts
> XML4Pharma
>
>
> --
> You receive this message as a subscriber of the [hidden email]
> mailing list.
> To unsubscribe: mailto:[hidden email]
> For general help: mailto:[hidden email]?subject=help
> ObjectWeb mailing lists service home page: http://www.objectweb.org/wws
---------------------
Jack Cox
CapTech Ventures, Inc.
1118 W. Main St.
Richmond, VA 23220
804-545-8765




--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
ObjectWeb mailing lists service home page: http://www.objectweb.org/wws
Reply | Threaded
Open this post in threaded view
|

Re: problems with constraint attribute in bind in Orbeon 3.6

Alessandro Vernet
Administrator
On 8/20/07, Jack Cox <[hidden email]> wrote:
> constraint="(. castable as xs:integer) and (. &lt; 150)"

Exactly.

BTW, you can write ". lt 150" instead of ". &lt; 150". That's 2
characters saved! I'll have to use that trick myself quite a few time
before I save enough characters to compensate for this message :).

Alex
--
Orbeon Forms - Web 2.0 Forms, open-source, for the Enterprise
http://www.orbeon.com/



--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
ObjectWeb mailing lists service home page: http://www.objectweb.org/wws