Components and Types

1 view
Skip to first unread message

bruno.buzzi

unread,
Nov 19, 2019, 12:09:11 PM11/19/19
to orb...@googlegroups.com
Hi,

I got the following form:
https://demo.orbeon.com/demo/fr/bruno/bruno-01/new

If you click in option 2 or option 3 then the form report an error and
submit is not possible.

The type of the component has been changed from String to Boolean.
Not sure why if you select the first option it works ok, but with option 1
and 2 it fail.

The pattern here is:
1) Create a component (a radio button or boolean)
2) Mark it as mandatory field
3) Change the type of the component

In these cases it will be not possible to submit the form.

Maybe in some cases the Data Type combo should be read-only.

regards,
bruno

--
Sent from: http://discuss.orbeon.com/

Alessandro Vernet

unread,
Nov 19, 2019, 1:48:19 PM11/19/19
to Orbeon Forms
Hi Bruno,

I'm not sure if you're pointing to a more general problem, but in this case, you have radio buttons with 3 possible values: "1", "2", and "3". You say that the type is `xs:boolean`. And the thing is that, in XPath, "1" can be casted to a boolean (it corresponds to `true()`), however "2" and "3" can't be casted to a boolean, hence the error when you select the 2nd and 3rd radios, as the values for those aren't valid boolean values.

You can check this with:

'1' castable as xs:boolean ⇒ true()
'2' castable as xs:boolean ⇒ false()
'3' castable as xs:boolean ⇒ false()

But maybe this isn't the problem you were trying to show? In which case, could you share with us an example of that other issue?

‑Alex

--
You received this message because you are subscribed to the Google Groups "Orbeon Forms" group.
To unsubscribe from this group and stop receiving emails from it, send an email to orbeon+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/orbeon/1574183546538-0.post%40n4.nabble.com.

bruno.buzzi

unread,
Nov 20, 2019, 12:16:09 PM11/20/19
to orb...@googlegroups.com
Alex,

It this case i'm pointing out (maybe applicable in other cases when the
default type of the component is changed).

It is arguable if this has to be detected at design time or is the user
responsible for testing the form before publish it. I'm not sure which one
to choose :)

I just want to report that in some cases instances of a published form can't
be submitted.

Alessandro Vernet

unread,
Nov 20, 2019, 5:40:05 PM11/20/19
to orb...@googlegroups.com
Hi Bruno,

Got it: I imagine there can be cases where what you select with radio button
is really a boolean, but in most cases it is the form author who made a
mistake selecting that type in the Control Settings. I've just created a RFE
to issue a warning in this case (see link below). You'll let me know if this
would help.

https://github.com/orbeon/orbeon-forms/issues/4278

‑Alex

-----
--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet

bruno.buzzi

unread,
Nov 20, 2019, 5:44:07 PM11/20/19
to orb...@googlegroups.com
Alex,

Issue (https://github.com/orbeon/orbeon-forms/issues/4278) describe exactly
my point :)

An the proposed warning seems fair to me !

regards,
bruno

Alessandro Vernet

unread,
Nov 20, 2019, 6:00:07 PM11/20/19
to orb...@googlegroups.com
Excellent Bruno, glad to have finally understood your point :).

‑Alex

-----
--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet
Reply all
Reply to author
Forward
0 new messages