setNullValid 2010/3/18 David Chang <david_q_zh...@yahoo.com>: > In my case, the field is required. I make it required by setRequired(true), > but I want the blank/choose one is still there. > > Doable? > > > --- On Thu, 3/18/10, Matthias Keller <matthias.kel...@ergon.ch> wrote: > >> From: Matthias Keller <matthias.kel...@ergon.ch> >> Subject: Re: Select the "Choose one" of a required DropDownChoice >> To: users@wicket.apache.org >> Date: Thursday, March 18, 2010, 9:42 AM >> Hi >> >> Yes, exactly, but why do you have it set to required at all >> in first >> place if you want to allow the empty selection too? >> I dont think a DropDownChoice is required by default but if >> it is, try >> setRequired(false) ... >> >> Matt >> >> On 2010-03-18 14:36, David Chang wrote: >> > Matt, I already did that. >> > >> > DropDownChoice.setNullValid() makes "Choose one" >> always stay there. >> > I notice that DropDownChoice.setRequired() is the >> reason to generate the message and not get onUpdate called. >> > >> > Thanks. >> > >> > >> > --- On Thu, 3/18/10, Matthias Keller<matthias.kel...@ergon.ch> >> wrote: >> > >> > >> >> From: Matthias Keller<matthias.kel...@ergon.ch> >> >> Subject: Re: Select the "Choose one" of a required >> DropDownChoice >> >> To: users@wicket.apache.org >> >> Date: Thursday, March 18, 2010, 9:30 AM >> >> Hi >> >> >> >> Have a look at DropDownChoice.setNullValid() and >> >> .setRequired() >> >> >> >> Matt >> >> >> >> On 2010-03-18 14:26, David Chang wrote: >> >> >> >>> Hi, I am new in Wicket and am playing with >> different >> >>> >> >> components. >> >> >> >>> I have a two dropdown lists. One is a list of >> >>> >> >> countries, required field, controlling another >> list of >> >> states/provinces via >> AjaxFormComponentUpdatingBehavior. >> >> >> >>> The country list always has a blank >> (equivalent of >> >>> >> >> "Choose one") as the first option in the list. >> When I select >> >> different countries, the state/province list >> changes >> >> accordingly. However, when I change to the blank >> in the >> >> country list, the state list stops updating. I >> looked into >> >> it and found out that in this situation (required >> droopdown >> >> list) selecting blank makes Wicket issue a >> feedback message >> >> instead of calling >> >> AjaxFormComponentUpdatingBehavior#onUpdate, which >> is what I >> >> want. >> >> >> >> >> >> >> > > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org > For additional commands, e-mail: users-h...@wicket.apache.org > >
--------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org