Hi,
A quick xforms question.... I was wondering if there any way of restricting the number of selections that can be made with an xforms:select? I would like to allow users to, say, select between 2 and 5 choices from a selection box or list. Is there a pure way of doing this (with something like an xforms:bind) or do I have to use a repeating group, move items to that group and implement the restrictions myself? Chris. -- 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 |
Chris,
The selected items are stored in one element with a comma space '1','2' etc. as I recall Count(tokenize(/some/element,',')) should get you the number of currently selected items, you should be able to make the bind xpath from that Ryan Ryan Puddephatt Software Engineer Teleflex Group - IT UK 1 Michaelson Square Livingston West Lothian Scotland EH54 7DP e> [hidden email] t> +44(0)1506 407 110 f> +44(0)1506 407 108 >-----Original Message----- >From: Chris Bailey [mailto:[hidden email]] >Sent: 21 February 2007 17:04 >To: [hidden email] >Subject: [ops-users] Limiting the selections in an xforms:select > >Hi, > >A quick xforms question.... > >I was wondering if there any way of restricting the number of >selections that can be made with an xforms:select? > >I would like to allow users to, say, select between 2 and 5 >choices from a selection box or list. Is there a pure way of >doing this (with something like an xforms:bind) or do I have >to use a repeating group, move items to that group and >implement the restrictions myself? > >Chris. > > > -- 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 |
Administrator
|
On 2/21/07, Ryan Puddephatt <[hidden email]> wrote:
> The selected items are stored in one element with a comma space > '1','2' etc. as I recall Yes, they are are stored as a string in a node. The separator is just a space instead of a comma. Alex -- Orbeon Forms - Web 2.0 Forms 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 |
Administrator
|
In reply to this post by Chris Bailey-2
Hi Chris,
On 2/21/07, Chris Bailey <[hidden email]> wrote: > I was wondering if there any way of restricting the number of selections > that can be made with an xforms:select? Like Ryan said, you can have an <xforms:bind constraint="..."> that checks if less than x values are selected. This won't prevent users from selecting more values, but if they do the control will become invalid. You can also have your own event handler for xforms-value-changed, and set the value of the node to the first x values. This way when the user selects too many values, the last value will be automatically removed. You can also imagine a UI with 2 lists, when the user moves items from the first to the second by pointing to an item in the first list and clicking on a button. When x values are selected, then you disable the button with a bind readonly. Alex -- Orbeon Forms - Web 2.0 Forms 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 |
Alex,
The second option that you have described where you have two select and move one item from one select to another... Is there a chance we could have a widget that does just that... instead of having to build it every single time. I am just asking :-) or maybe you can point me in a direction that would allow an easy template usage... Yep I am lazy... I think it would be a nice feature >From: "Alessandro Vernet" <[hidden email]> >Reply-To: [hidden email] >To: [hidden email] >Subject: Re: [ops-users] Limiting the selections in an xforms:select >Date: Wed, 21 Feb 2007 15:09:14 -0800 > >Hi Chris, > >On 2/21/07, Chris Bailey <[hidden email]> wrote: >>I was wondering if there any way of restricting the number of selections >>that can be made with an xforms:select? > >Like Ryan said, you can have an <xforms:bind constraint="..."> that >checks if less than x values are selected. This won't prevent users >from selecting more values, but if they do the control will become >invalid. > >You can also have your own event handler for xforms-value-changed, and >set the value of the node to the first x values. This way when the >user selects too many values, the last value will be automatically >removed. > >You can also imagine a UI with 2 lists, when the user moves items from >the first to the second by pointing to an item in the first list and >clicking on a button. When x values are selected, then you disable the >button with a bind readonly. > >Alex >-- >Orbeon Forms - Web 2.0 Forms 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 _________________________________________________________________ http://local.live.com/default.aspx?v=2&cp=43.658648~-79.383962&style=r&lvl=15&tilt=-90&dir=0&alt=-1000&scene=3702663&cid=7ABE80D1746919B4!1329 From January 26 to February 8, 2007 -- 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 |
Marco,
You could use /config/xforms-widget.xsl to add another widget to it. This is where Orbeon add there widgets. Ryan ----- Original Message ----- From: Marco Lebel <[hidden email]> Date: Thursday, February 22, 2007 12:32 pm Subject: Re: [ops-users] Limiting the selections in an xforms:select To: [hidden email] > Alex, > > The second option that you have described where you have two select > and move > one item from one select to another... Is there a chance we could > have a > widget that does just that... instead of having to build it every > single > time. I am just asking :-) or maybe you can point me in a > direction that > would allow an easy template usage... Yep I am lazy... > > I think it would be a nice feature > > > >From: "Alessandro Vernet" <[hidden email]> > >Reply-To: [hidden email] > >To: [hidden email] > >Subject: Re: [ops-users] Limiting the selections in an xforms:select > >Date: Wed, 21 Feb 2007 15:09:14 -0800 > > > >Hi Chris, > > > >On 2/21/07, Chris Bailey <[hidden email]> wrote: > >>I was wondering if there any way of restricting the number of > selections>>that can be made with an xforms:select? > > > >Like Ryan said, you can have an <xforms:bind constraint="..."> that > >checks if less than x values are selected. This won't prevent users > >from selecting more values, but if they do the control will become > >invalid. > > > >You can also have your own event handler for xforms-value-changed, > and>set the value of the node to the first x values. This way when the > >user selects too many values, the last value will be automatically > >removed. > > > >You can also imagine a UI with 2 lists, when the user moves items > from>the first to the second by pointing to an item in the first > list and > >clicking on a button. When x values are selected, then you disable > the>button with a bind readonly. > > > >Alex > >-- > >Orbeon Forms - Web 2.0 Forms for the Enterprise > >http://www.orbeon.com/ > > > > > > > >-- > >You receive this message as a subscriber of the ops- > [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 > _________________________________________________________________ > http://local.live.com/default.aspx?v=2&cp=43.658648~- > 79.383962&style=r&lvl=15&tilt=-90&dir=0&alt=- > 1000&scene=3702663&cid=7ABE80D1746919B4!1329 > From January 26 to February 8, 2007 > > > -- 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 |
Administrator
|
At some point in the future, we would like to add a real notion of
components to XForms. Some implementations have already started experimenting with UBL, for example. This would give you the ability to write components in XForms and usable and reusable in XForms documents. For now, yeah, using xforms-widgets.xsl is a rough way of building components. -Erik [hidden email] wrote: > Marco, > You could use /config/xforms-widget.xsl to add another widget to it. This is where Orbeon add there widgets. > > Ryan > > ----- Original Message ----- > From: Marco Lebel <[hidden email]> > Date: Thursday, February 22, 2007 12:32 pm > Subject: Re: [ops-users] Limiting the selections in an xforms:select > To: [hidden email] > >> Alex, >> >> The second option that you have described where you have two select >> and move >> one item from one select to another... Is there a chance we could >> have a >> widget that does just that... instead of having to build it every >> single >> time. I am just asking :-) or maybe you can point me in a >> direction that >> would allow an easy template usage... Yep I am lazy... >> >> I think it would be a nice feature >> >> >>> From: "Alessandro Vernet" <[hidden email]> >>> Reply-To: [hidden email] >>> To: [hidden email] >>> Subject: Re: [ops-users] Limiting the selections in an xforms:select >>> Date: Wed, 21 Feb 2007 15:09:14 -0800 >>> >>> Hi Chris, >>> >>> On 2/21/07, Chris Bailey <[hidden email]> wrote: >>>> I was wondering if there any way of restricting the number of >> selections>>that can be made with an xforms:select? >>> Like Ryan said, you can have an <xforms:bind constraint="..."> that >>> checks if less than x values are selected. This won't prevent users >> >from selecting more values, but if they do the control will become >>> invalid. >>> >>> You can also have your own event handler for xforms-value-changed, >> and>set the value of the node to the first x values. This way when the >>> user selects too many values, the last value will be automatically >>> removed. >>> >>> You can also imagine a UI with 2 lists, when the user moves items >> from>the first to the second by pointing to an item in the first >> list and >>> clicking on a button. When x values are selected, then you disable >> the>button with a bind readonly. >>> Alex >>> -- >>> Orbeon Forms - Web 2.0 Forms for the Enterprise >>> http://www.orbeon.com/ >>> >> >>> -- >>> You receive this message as a subscriber of the ops- >> [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 >> _________________________________________________________________ >> http://local.live.com/default.aspx?v=2&cp=43.658648~- >> 79.383962&style=r&lvl=15&tilt=-90&dir=0&alt=- >> 1000&scene=3702663&cid=7ABE80D1746919B4!1329 >> From January 26 to February 8, 2007 >> >> >> > -- Orbeon Forms - Web Forms for the Enterprise Done the Right Way 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 |
I like your notion of component... I like it a lot...
btw: Bravo for 3.5... and of course... can't wait to see what is in the plan for future releases >From: Erik Bruchez <[hidden email]> >Reply-To: [hidden email] >To: [hidden email] >Subject: Re: [ops-users] Limiting the selections in an xforms:select >Date: Thu, 22 Feb 2007 20:03:48 +0100 > >At some point in the future, we would like to add a real notion of >components to XForms. Some implementations have already started >experimenting with UBL, for example. This would give you the ability to >write components in XForms and usable and reusable in XForms documents. > >For now, yeah, using xforms-widgets.xsl is a rough way of building >components. > >-Erik > >[hidden email] wrote: >>Marco, >> You could use /config/xforms-widget.xsl to add another widget to it. >>This is where Orbeon add there widgets. >> >>Ryan >> >>----- Original Message ----- >>From: Marco Lebel <[hidden email]> >>Date: Thursday, February 22, 2007 12:32 pm >>Subject: Re: [ops-users] Limiting the selections in an xforms:select >>To: [hidden email] >> >>>Alex, >>> >>>The second option that you have described where you have two select and >>>move one item from one select to another... Is there a chance we could >>>have a widget that does just that... instead of having to build it every >>>single time. I am just asking :-) or maybe you can point me in a >>>direction that would allow an easy template usage... Yep I am lazy... >>> >>>I think it would be a nice feature >>> >>> >>>>From: "Alessandro Vernet" <[hidden email]> >>>>Reply-To: [hidden email] >>>>To: [hidden email] >>>>Subject: Re: [ops-users] Limiting the selections in an xforms:select >>>>Date: Wed, 21 Feb 2007 15:09:14 -0800 >>>> >>>>Hi Chris, >>>> >>>>On 2/21/07, Chris Bailey <[hidden email]> wrote: >>>>>I was wondering if there any way of restricting the number of >>>selections>>that can be made with an xforms:select? >>>>Like Ryan said, you can have an <xforms:bind constraint="..."> that >>>>checks if less than x values are selected. This won't prevent users >>> >from selecting more values, but if they do the control will become >>>>invalid. >>>> >>>>You can also have your own event handler for xforms-value-changed, >>>and>set the value of the node to the first x values. This way when the >>>>user selects too many values, the last value will be automatically >>>>removed. >>>> >>>>You can also imagine a UI with 2 lists, when the user moves items >>>from>the first to the second by pointing to an item in the first list and >>>>clicking on a button. When x values are selected, then you disable >>>the>button with a bind readonly. >>>>Alex >>>>-- >>>>Orbeon Forms - Web 2.0 Forms for the Enterprise >>>>http://www.orbeon.com/ >>>> >>> >>>>-- >>>>You receive this message as a subscriber of the ops- >>>[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 >>>_________________________________________________________________ >>>http://local.live.com/default.aspx?v=2&cp=43.658648~- >>>79.383962&style=r&lvl=15&tilt=-90&dir=0&alt=- >>>1000&scene=3702663&cid=7ABE80D1746919B4!1329 From January 26 to February >>>8, 2007 >>> >>> >>> >> > > >-- >Orbeon Forms - Web Forms for the Enterprise Done the Right Way >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 _________________________________________________________________ Buy what you want when you want it on Sympatico / MSN Shopping http://shopping.sympatico.msn.ca/content/shp/?ctId=2,ptnrid=176,ptnrdata=081805 -- 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 |
Free forum by Nabble | Edit this page |