You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Gatos <eg...@gmail.com> on 2009/08/27 14:45:34 UTC
Choose one
After I choose something in DropDownChoice then 'Choose one' item is removed
from the list.
If I will try to use "setNullValid(true)" then 'Choose one' string is
replaced with '' (emptry string).
How is it possible to display 'Choose one' if another item has been
selected?
Re: Choose one
Posted by Gatos <eg...@gmail.com>.
Thank you. The case is solved.
Maybe it would be a good idea to add nullValid to Wicket global translation
files, then it won't be needed to create a new record in my file. nullValid
could be used if I wan't something to override. It's something similar to
Convention over Configuration.
On Thu, Aug 27, 2009 at 4:12 PM, Matthias Keller
<ma...@ergon.ch>wrote:
> Hi
> The implementation tries these keys:
> getId() + ".nullValid"
> "nullValid"
>
> So you could also have a global 'nullValid' entry somewhere in your
> resources which would be the default for ALL AbstractSingleSelectChoices
> such as DropDownChoice and RadioChoice
>
> Matt
>
>
> Gatos wrote:
>
>> Is it possible to reuse existing translation - I like 'Choose one'?
>>
>> If my app has 32 languages, then I should create 32 records in each file?
>>
>>
>> On Thu, Aug 27, 2009 at 3:58 PM, Dipu <di...@googlemail.com> wrote:
>>
>>
>>
>>> add this in your .properties file
>>>
>>> yourForm.yourDropDownId.nullValid = Choose One (or what ever you want
>>> to appear)
>>>
>>> regards
>>>
>>>
>>> On Thu, Aug 27, 2009 at 1:45 PM, Gatos<eg...@gmail.com> wrote:
>>>
>>>
>>>> After I choose something in DropDownChoice then 'Choose one' item is
>>>>
>>>>
>>> removed
>>>
>>>
>>>> from the list.
>>>>
>>>> If I will try to use "setNullValid(true)" then 'Choose one' string is
>>>> replaced with '' (emptry string).
>>>>
>>>> How is it possible to display 'Choose one' if another item has been
>>>> selected?
>>>>
>>>>
>>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>>> For additional commands, e-mail: users-help@wicket.apache.org
>>>
>>>
>>>
>>>
>>
>>
>>
>
>
Re: Choose one
Posted by Matthias Keller <ma...@ergon.ch>.
Hi
The implementation tries these keys:
getId() + ".nullValid"
"nullValid"
So you could also have a global 'nullValid' entry somewhere in your
resources which would be the default for ALL AbstractSingleSelectChoices
such as DropDownChoice and RadioChoice
Matt
Gatos wrote:
> Is it possible to reuse existing translation - I like 'Choose one'?
>
> If my app has 32 languages, then I should create 32 records in each file?
>
>
> On Thu, Aug 27, 2009 at 3:58 PM, Dipu <di...@googlemail.com> wrote:
>
>
>> add this in your .properties file
>>
>> yourForm.yourDropDownId.nullValid = Choose One (or what ever you want
>> to appear)
>>
>> regards
>>
>>
>> On Thu, Aug 27, 2009 at 1:45 PM, Gatos<eg...@gmail.com> wrote:
>>
>>> After I choose something in DropDownChoice then 'Choose one' item is
>>>
>> removed
>>
>>> from the list.
>>>
>>> If I will try to use "setNullValid(true)" then 'Choose one' string is
>>> replaced with '' (emptry string).
>>>
>>> How is it possible to display 'Choose one' if another item has been
>>> selected?
>>>
>>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>> For additional commands, e-mail: users-help@wicket.apache.org
>>
>>
>>
>
>
Re: Choose one
Posted by Gatos <eg...@gmail.com>.
Is it possible to reuse existing translation - I like 'Choose one'?
If my app has 32 languages, then I should create 32 records in each file?
On Thu, Aug 27, 2009 at 3:58 PM, Dipu <di...@googlemail.com> wrote:
> add this in your .properties file
>
> yourForm.yourDropDownId.nullValid = Choose One (or what ever you want
> to appear)
>
> regards
>
>
> On Thu, Aug 27, 2009 at 1:45 PM, Gatos<eg...@gmail.com> wrote:
> > After I choose something in DropDownChoice then 'Choose one' item is
> removed
> > from the list.
> >
> > If I will try to use "setNullValid(true)" then 'Choose one' string is
> > replaced with '' (emptry string).
> >
> > How is it possible to display 'Choose one' if another item has been
> > selected?
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>
Re: Choose one
Posted by Dipu <di...@googlemail.com>.
add this in your .properties file
yourForm.yourDropDownId.nullValid = Choose One (or what ever you want
to appear)
regards
On Thu, Aug 27, 2009 at 1:45 PM, Gatos<eg...@gmail.com> wrote:
> After I choose something in DropDownChoice then 'Choose one' item is removed
> from the list.
>
> If I will try to use "setNullValid(true)" then 'Choose one' string is
> replaced with '' (emptry string).
>
> How is it possible to display 'Choose one' if another item has been
> selected?
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org
RE: Choose one
Posted by Warren Bell <Wa...@clarksnutrition.com>.
I needed to do the same thing. I saw this on another post and it works
fine. Override getDefaultChoice:
protected CharSequence getDefaultChoice(Object selected)
{
return "<option selected=\"selected\" value=\"\">Choose One</option>";
}
You can use
getLocalizer().getString("yourpage.dropdownchoice.defaultvalue", this)
for your different languages.
Warren
-----Original Message-----
From: Gatos [mailto:egatos@gmail.com]
Sent: Thursday, August 27, 2009 5:46 AM
To: users@wicket.apache.org
Subject: Choose one
After I choose something in DropDownChoice then 'Choose one' item is
removed from the list.
If I will try to use "setNullValid(true)" then 'Choose one' string is
replaced with '' (emptry string).
How is it possible to display 'Choose one' if another item has been
selected?
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org
Re: Choose one
Posted by Erik van Oosten <e....@grons.nl>.
Call setRequired(false) on the dropdownchoice.
Regards,
Erik.
Gatos wrote:
> After I choose something in DropDownChoice then 'Choose one' item is removed
> from the list.
>
> If I will try to use "setNullValid(true)" then 'Choose one' string is
> replaced with '' (emptry string).
>
> How is it possible to display 'Choose one' if another item has been
> selected?
>
>
--
Erik van Oosten
http://www.day-to-day-stuff.blogspot.com/
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org