Currently, the select control renders showing the first item in the list. Is there anyway to render the control so that the input control is blank and the user has to actually select an item from the list.
|
You can put an element with a blank value into your instance.
A. On Jun 29, 2008, at 5:14 PM, jalateras wrote: > > Currently, the select control renders showing the first item in the > list. Is > there anyway to render the control so that the input control is > blank and > the user has to actually select an item from the list. > -- > View this message in context: http://www.nabble.com/Selection-Control-tp18181891p18181891.html > Sent from the ObjectWeb OPS - Users mailing list archive at > Nabble.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 > OW2 mailing lists service home page: http://www.ow2.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 OW2 mailing lists service home page: http://www.ow2.org/wws |
How do you get the first item in a drop-down list to be blank?
Currently, it renders the first item in the list and that won't even populate the instance (i.e. it doesn't count as a selection). I've inluded an old thread on this topic below. I don't like the idea of inserting a blank into the instance for a number of reasons: 1) it's a pain to do so if you are accessing external instances 2) it violates mvc principles to add something irrelevant to the "model" for the sake of a view workaround. Besides, other xforms implementations (like Mozilla pugin) provide that blank first option. Thanks a lot. Hopefully the answer is simple. On 30-Jun-08, at 7:12 AM, Alexander Zatko wrote: > You can put an element with a blank value into your instance. > > A. > > On Jun 29, 2008, at 5:14 PM, jalateras wrote: > >> >> Currently, the select control renders showing the first item in the >> list. Is >> there anyway to render the control so that the input control is >> blank and >> the user has to actually select an item from the list. >> -- >> View this message in context: http://www.nabble.com/Selection-Control-tp18181891p18181891.html >> Sent from the ObjectWeb OPS - Users mailing list archive at >> Nabble.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 >> OW2 mailing lists service home page: http://www.ow2.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 > OW2 mailing lists service home page: http://www.ow2.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 OW2 mailing lists service home page: http://www.ow2.org/wws |
You may want to try this ...
<xforms:select1 ref="post_addx_district"> <xforms:item> <xforms:label>Choose One...</xforms:label><xforms:value/> </xforms:item> <xforms:itemset nodeset="instance('districts-instance')/district"> <xforms:label ref="name"/><xforms:value ref="value"/> </xforms:itemset> <xforms:alert>Invalid Data</xforms:alert> </xforms:select1><br/> Add a <xforms:item> before the actual <xforms:itemset nodeset="instance('districts-instance')/district"> Your model for the drop-down select is with relevant data and the blank option is in the view. HTH
|
Heh. Knew it would be embarassingly simple. Thanks :)
On 10-Sep-09, at 1:59 PM, hoichong wrote: > > You may want to try this ... > > <xforms:select1 ref="post_addx_district"> > <xforms:item> > <xforms:label>Choose One...</xforms:label><xforms:value/> > </xforms:item> > <xforms:itemset nodeset="instance('districts-instance')/district"> > <xforms:label ref="name"/><xforms:value ref="value"/> > </xforms:itemset> > <xforms:alert>Invalid Data</xforms:alert> > </xforms:select1><br/> > > Add a <xforms:item> before the actual <xforms:itemset > nodeset="instance('districts-instance')/district"> > > Your model for the drop-down select is with relevant data and the > blank > option is in the view. > > HTH > > > > > Paul Kelly-5 wrote: >> >> How do you get the first item in a drop-down list to be blank? >> Currently, it renders the first item in the list and that won't even >> populate the instance (i.e. it doesn't count as a selection). I've >> inluded an old thread on this topic below. I don't like the idea of >> inserting a blank into the instance for a number of reasons: >> >> 1) it's a pain to do so if you are accessing external instances >> 2) it violates mvc principles to add something irrelevant to the >> "model" for the sake of a view workaround. Besides, other xforms >> implementations (like Mozilla pugin) provide that blank first option. >> >> Thanks a lot. Hopefully the answer is simple. >> >> >> On 30-Jun-08, at 7:12 AM, Alexander Zatko wrote: >> >>> You can put an element with a blank value into your instance. >>> >>> A. >>> >>> On Jun 29, 2008, at 5:14 PM, jalateras wrote: >>> >>>> >>>> Currently, the select control renders showing the first item in the >>>> list. Is >>>> there anyway to render the control so that the input control is >>>> blank and >>>> the user has to actually select an item from the list. >>>> -- >>>> View this message in context: >>>> http://www.nabble.com/Selection-Control-tp18181891p18181891.html >>>> Sent from the ObjectWeb OPS - Users mailing list archive at >>>> Nabble.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 >>>> OW2 mailing lists service home page: http://www.ow2.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 >>> OW2 mailing lists service home page: http://www.ow2.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 >> OW2 mailing lists service home page: http://www.ow2.org/wws >> >> > > -- > View this message in context: http://www.nabble.com/Selection-Control-tp18181891p25388080.html > Sent from the ObjectWeb OPS - Users mailing list archive at > Nabble.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 > OW2 mailing lists service home page: http://www.ow2.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 OW2 mailing lists service home page: http://www.ow2.org/wws |
Free forum by Nabble | Edit this page |