Using constraint attribute with select1 control

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

Using constraint attribute with select1 control

Nigel Harrison

All:

I am trying to use a select1 control which requires the user to select an entry.  It is possible to add a blank entry to the itemset used by the control, so now I want to constrain the value the user selects to be one of the non-blank entries.  In this way, I can guarantee that the user actually actively chooses an entry, rather than just opting, lazily, for the default.  However, the control does not show the red exclamation mark icon, nor does the control's background show as pink if I mark the element as required in the xforms:bind.  Is this because the spec doesn't permit this, or is there some way to get this behaviour in OPS which I am just missing?

I did try using the selection="open" appearance="xxforms:autocomplete" combination, which does show a required control with pink background, but doesn't show the validation failure icon.

(Incidentally, I also noted that the open/autocomplete combination let the user pick from the item/value elements, rather than the item/label elements, as I was expecting.  Easy to fiddle round, but was my expectation wrong?)

Thanks for your help (and fun product ...)

Nigel

Nigel Harrison
LeSoftCo Limited



--
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: Using constraint attribute with select1 control

Alessandro  Vernet
Administrator
Hi Nigel,

On 7/26/06, [hidden email] <[hidden email]> wrote:
> I did try using the selection="open"
> appearance="xxforms:autocomplete" combination, which does
> show a required control with pink background, but doesn't show the
> validation failure icon.

If you just have an <xforms:bind nodeset="..." required="true()"/>
then the red exclamation mark never shows because the control is not
considered invalid, according to the XForms specification. Does this
help clarify the behavior you are seeing?

> (Incidentally, I also noted that the open/autocomplete combination let the
> user pick from the item/value elements, rather than the item/label elements,
> as I was expecting.  Easy to fiddle round, but was my expectation wrong?)

We decided to go with the item/value, because if you type something
which is not in the items, then the value you type is sent. So for
consistency, what is displayed in the field is always the value (not
the label). The list could have the labels, but since it works as an
"auto-complete" on what you type, which is the value, it makes sense
to also have values in the list.

At this point labels are not used. In the future, they could be
displayed next to the value in the drop down list.

Alex
--
Blog (XML, Web apps, Open Source):
http://www.orbeon.com/blog/



--
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
--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet
Reply | Threaded
Open this post in threaded view
|

Re: Using constraint attribute with select1 control

Nigel Harrison

Alex:

Thanks for your reply.  What I was trying to do was to get a constraint to operate on the select1 control.  For instance, I wanted to be able to constrain the user to only select from a subset of the choices, depending on a value chosen for an earlier control.  However, just using more than one select1 control, and switching between them depending on the earlier value, does the job, so I was just looking in the wrong direction, I think.

However, if you use a selection="open" appearance="xxforms:autocomplete" combination (and use required="true" for the item in an xforms:bind), the control shows the pink background (sometimes yellow, with a pink border in IE, wierdly) until you enter something.

Regards

Nigel

Nigel Harrison
LeSoftCo Limited

[hidden email] wrote on 28/07/2006 04:33:36:

> Hi Nigel,
>
> On 7/26/06, [hidden email] <Nigel_Harrison@lesoftco.
> co.uk> wrote:
> > I did try using the selection="open"
> > appearance="xxforms:autocomplete" combination, which does
> > show a required control with pink background, but doesn't show the
> > validation failure icon.
>
> If you just have an <xforms:bind nodeset="..." required="true()"/>
> then the red exclamation mark never shows because the control is not
> considered invalid, according to the XForms specification. Does this
> help clarify the behavior you are seeing?
>
> > (Incidentally, I also noted that the open/autocomplete combination let the
> > user pick from the item/value elements, rather than the item/labelelements,
> > as I was expecting.  Easy to fiddle round, but was my expectation wrong?)
>
> We decided to go with the item/value, because if you type something
> which is not in the items, then the value you type is sent. So for
> consistency, what is displayed in the field is always the value (not
> the label). The list could have the labels, but since it works as an
> "auto-complete" on what you type, which is the value, it makes sense
> to also have values in the list.
>
> At this point labels are not used. In the future, they could be
> displayed next to the value in the drop down list.
>
> Alex
> --
> Blog (XML, Web apps, Open Source):
> http://www.orbeon.com/blog/
>
>
> --
> You receive this message as a subscriber of the ops-users@objectweb.
> org 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


--
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: Using constraint attribute with select1 control

Alessandro  Vernet
Administrator
Nigel,

The pink background and border comes from the required="true()". It
comes up when the field contains no value. Sometimes the background
can be yellow if you have installed a plugin/extension that
automatically fills forms. In particular, I have this on my Firefox as
I have the Google Toolbar extension installed.

Alex

On 7/28/06, [hidden email] <[hidden email]> wrote:

>
> Alex:
>
> Thanks for your reply.  What I was trying to do was to get a constraint to
> operate on the select1 control.  For instance, I wanted to be able to
> constrain the user to only select from a subset of the choices, depending on
> a value chosen for an earlier control.  However, just using more than one
> select1 control, and switching between them depending on the earlier value,
> does the job, so I was just looking in the wrong direction, I think.
>
> However, if you use a selection="open"
> appearance="xxforms:autocomplete" combination (and use
> required="true" for the item in an xforms:bind), the control shows the pink
> background (sometimes yellow, with a pink border in IE, wierdly) until you
> enter something.
>
> Regards
>
>
> Nigel
>
> Nigel Harrison
>  LeSoftCo Limited
>
> [hidden email] wrote on 28/07/2006 04:33:36:
>
>
>  > Hi Nigel,
>  >
>  > On 7/26/06, [hidden email] <Nigel_Harrison@lesoftco.
>  > co.uk> wrote:
>  > > I did try using the selection="open"
>  > > appearance="xxforms:autocomplete" combination, which
> does
>  > > show a required control with pink background, but doesn't show the
>  > > validation failure icon.
>  >
>  > If you just have an <xforms:bind nodeset="..." required="true()"/>
>  > then the red exclamation mark never shows because the control is not
>  > considered invalid, according to the XForms specification. Does this
>  > help clarify the behavior you are seeing?
>  >
>  > > (Incidentally, I also noted that the open/autocomplete combination let
> the
>  > > user pick from the item/value elements, rather than the
> item/labelelements,
>  > > as I was expecting.  Easy to fiddle round, but was my expectation
> wrong?)
>  >
>  > We decided to go with the item/value, because if you type something
>  > which is not in the items, then the value you type is sent. So for
>  > consistency, what is displayed in the field is always the value (not
>  > the label). The list could have the labels, but since it works as an
>  > "auto-complete" on what you type, which is the value, it makes sense
>  > to also have values in the list.
>  >
>  > At this point labels are not used. In the future, they could be
>  > displayed next to the value in the drop down list.
>  >
>  > Alex
>  > --
>  > Blog (XML, Web apps, Open Source):
>  > http://www.orbeon.com/blog/
>  >
>  >
>  > --
>  > You receive this message as a subscriber of the ops-users@objectweb.
>  > org 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
>
>
> --
> 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
>
>
>

--
Blog (XML, Web apps, Open Source):
http://www.orbeon.com/blog/



--
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
--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet
Reply | Threaded
Open this post in threaded view
|

Re: Using constraint attribute with select1 control

Nigel Harrison

Alex:

Thanks.  I got the yellow background with IE, in fact, which is not the browser I use myself normally (but, inevitably, our larger customers require their staff to use).  My Firefox (1.5) (also with the Google toolbar) doesn't have this problem!  I'll investigate to see if others get the same result wit IE.  As far as I could see, the HTML generated was as expected.

Nigel

Nigel Harrison
LeSoftCo Limited


[hidden email] wrote on 12/08/2006 04:20:53:

> Nigel,
>
> The pink background and border comes from the required="true()". It
> comes up when the field contains no value. Sometimes the background
> can be yellow if you have installed a plugin/extension that
> automatically fills forms. In particular, I have this on my Firefox as
> I have the Google Toolbar extension installed.
>
> Alex
>
> On 7/28/06, [hidden email] <Nigel_Harrison@lesoftco.
> co.uk> wrote:
> >
> > Alex:
> >
> > Thanks for your reply.  What I was trying to do was to get a constraint to
> > operate on the select1 control.  For instance, I wanted to be able to
> > constrain the user to only select from a subset of the choices, depending on
> > a value chosen for an earlier control.  However, just using more than one
> > select1 control, and switching between them depending on the earlier value,
> > does the job, so I was just looking in the wrong direction, I think.
> >
> > However, if you use a selection="open"
> > appearance="xxforms:autocomplete" combination (and use
> > required="true" for the item in an xforms:bind), the control shows the pink
> > background (sometimes yellow, with a pink border in IE, wierdly) until you
> > enter something.
> >
> > Regards
> >
> >
> > Nigel
> >
> > Nigel Harrison
> >  LeSoftCo Limited
> >
> > [hidden email] wrote on 28/07/2006 04:33:36:
> >
> >
> >  > Hi Nigel,
> >  >
> >  > On 7/26/06, [hidden email] <Nigel_Harrison@lesoftco.
> >  > co.uk> wrote:
> >  > > I did try using the selection="open"
> >  > > appearance="xxforms:autocomplete" combination, which
> > does
> >  > > show a required control with pink background, but doesn't show the
> >  > > validation failure icon.
> >  >
> >  > If you just have an <xforms:bind nodeset="..." required="true()"/>
> >  > then the red exclamation mark never shows because the control is not
> >  > considered invalid, according to the XForms specification. Does this
> >  > help clarify the behavior you are seeing?
> >  >
> >  > > (Incidentally, I also noted that the open/autocomplete combination let
> > the
> >  > > user pick from the item/value elements, rather than the
> > item/labelelements,
> >  > > as I was expecting.  Easy to fiddle round, but was my expectation
> > wrong?)
> >  >
> >  > We decided to go with the item/value, because if you type something
> >  > which is not in the items, then the value you type is sent. So for
> >  > consistency, what is displayed in the field is always the value (not
> >  > the label). The list could have the labels, but since it works as an
> >  > "auto-complete" on what you type, which is the value, it makes sense
> >  > to also have values in the list.
> >  >
> >  > At this point labels are not used. In the future, they could be
> >  > displayed next to the value in the drop down list.
> >  >
> >  > Alex
> >  > --
> >  > Blog (XML, Web apps, Open Source):
> >  > http://www.orbeon.com/blog/
> >  >
> >  >
> >  > --
> >  > You receive this message as a subscriber of the ops-users@objectweb.
> >  > org 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
> >
> >
> > --
> > 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
> >
> >
> >
>
>
> --
> Blog (XML, Web apps, Open Source):
> http://www.orbeon.com/blog/
>
>
> --
> You receive this message as a subscriber of the ops-users@objectweb.
> org 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


--
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