Components and Types

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

Components and Types

bruno.buzzi
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/

--
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 [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/orbeon/1574183546538-0.post%40n4.nabble.com.
Reply | Threaded
Open this post in threaded view
|

Re: Components and Types

Alessandro  Vernet
Administrator
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

On Tue, Nov 19, 2019 at 9:09 AM bruno.buzzi <[hidden email]> wrote:
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/

--
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 [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/orbeon/1574183546538-0.post%40n4.nabble.com.

--
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 [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/orbeon/CANrzKkknd_yztPzy5T3weTWUHc%3DnpvVueK1_VeadgLZQj1b2Fw%40mail.gmail.com.
--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet
Reply | Threaded
Open this post in threaded view
|

Re: Components and Types

bruno.buzzi
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.

regards,
bruno


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

--
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 [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/orbeon/1574270373709-0.post%40n4.nabble.com.
Reply | Threaded
Open this post in threaded view
|

Re: Components and Types

Alessandro  Vernet
Administrator
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
--
Sent from: http://discuss.orbeon.com/

--
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 [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/orbeon/1574289811626-0.post%40n4.nabble.com.
--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet
Reply | Threaded
Open this post in threaded view
|

Re: Components and Types

bruno.buzzi
Alex,

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

An the proposed warning seems fair to me  !

regards,
bruno

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

--
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 [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/orbeon/1574290054654-0.post%40n4.nabble.com.
Reply | Threaded
Open this post in threaded view
|

Re: Components and Types

Alessandro  Vernet
Administrator
Excellent Bruno, glad to have finally understood your point :).

‑Alex

-----
--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet
--
Sent from: http://discuss.orbeon.com/

--
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 [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/orbeon/1574291014761-0.post%40n4.nabble.com.
--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet