Re: DropDownChoice without preselection and without 'Please choose one'

2009-02-23 Thread pixologe

Hi Johan, hi Martin,

Just for the sake of completeness:
Having
select.null=
select.nullValid=
as string resources, an empty option is displayed as first item if nullValid
is true.
If it is false, there is still the 'Please choose one' option.

Anyway, I'll stick to the ListMultipleChoice solution I have described
before, it might not be the most elegant one, but I think the code is more
comprehensive this way.

Thanks again for your input on this.


Martin Makundi wrote:
> 
> DId you try setting the .null <- property value? If null
> is valid then try .nullValid , see
> 

-- 
View this message in context: 
http://www.nabble.com/DropDownChoice-without-preselection-and-without-%27Please-choose-one%27-tp22120191p22159080.html
Sent from the Wicket - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: DropDownChoice without preselection and without 'Please choose one'

2009-02-20 Thread pixologe

just had a deeper look at AbstractSingleChoice.
looks as if it did exactly this when the ###.null string resource is empty.

I will check that out tomorrow.

Thank you guys :)



jcompagner-2 wrote:
> 
> override the getDefaultChoice() and generate a  (yes
> empty)
> and the if selected is also empty generate 
> 

-- 
View this message in context: 
http://www.nabble.com/DropDownChoice-without-preselection-and-without-%27Please-choose-one%27-tp22120191p22125833.html
Sent from the Wicket - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: DropDownChoice without preselection and without 'Please choose one'

2009-02-20 Thread pixologe

Sorry, just saw your message.

Didn't know about the .null thing... quite confusing.

I will try this tomorrow.

Thanks a lot



Martin Makundi wrote:
> 
> DId you try setting the .null <- property value? If null
> is valid then try .nullValid , see
> http://wicket.sourceforge.net/apidocs/wicket/markup/html/form/DropDownChoice.html
> 
> **
> Martin
> 
> 2009/2/20 pixologe :
>>
>> I tried overriding getDefaultChoice already, returning an empty string,
>> this
>> did not work, unfortunately.
>>
>> The 'Please choose one' option is not rendered, however the first
>> 'normal'
>> option gets selected instead.
>> Also, inside AbstractSingleSelectChoice, there remains an empty string in
>> the options list, letting my ChoiceRenderer stumble when it tries to
>> interpret my idExpression :(
>>
>> If there are any more ideas regarding to this, please let me know.
>>
>> Thanks so far!
>>
>> btw.: nullValid is the correct 'Please choose one' string resource key
>>
>>
>>
>> Sergio García wrote:
>>>
>>> I guess that if you simply override the dropdownchoice i18n property
>>> value
>>> for that component/page with a plain "" it may work.
>>>
>>> DropDownChoice property key for "Please choose one" is "null", or at
>>> least
>>> i remember that.
>>>
>>>
>>>
>>
>> --
>> View this message in context:
>> http://www.nabble.com/DropDownChoice-without-preselection-and-without-%27Please-choose-one%27-tp22120191p22120404.html
>> Sent from the Wicket - User mailing list archive at Nabble.com.
>>
>>
>> -
>> 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
> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/DropDownChoice-without-preselection-and-without-%27Please-choose-one%27-tp22120191p22125830.html
Sent from the Wicket - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Solved: DropDownChoice without preselection and without 'Please choose one'

2009-02-20 Thread pixologe

I have found a solution for this after all, not quite elegant, but works like
charm :)


new ListMultipleChoice("select",new Model(new ArrayList(0)), new
PropertyModel(this, "choices"), renderer) {
@Override
protected void onComponentTag(ComponentTag tag) {
super.onComponentTag(tag);
tag.getAttributes().remove("multiple");
}
};


The trick is to use the multiselect component (because this one neither
requires preselection nor nullValid option.
Having an empty list in the model means nothing is preselected.
Since I do not want it to be multi-selectable, I removed the attribute by
overwriting onComponentTag. 

Thats it :)


-- 
View this message in context: 
http://www.nabble.com/DropDownChoice-without-preselection-and-without-%27Please-choose-one%27-tp22120191p22120439.html
Sent from the Wicket - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: DropDownChoice without preselection and without 'Please choose one'

2009-02-20 Thread Johan Compagner
override the getDefaultChoice() and generate a  (yes empty)
and the if selected is also empty generate 

On Fri, Feb 20, 2009 at 15:31, pixologe  wrote:

>
> I tried overriding getDefaultChoice already, returning an empty string,
> this
> did not work, unfortunately.
>
> The 'Please choose one' option is not rendered, however the first 'normal'
> option gets selected instead.
> Also, inside AbstractSingleSelectChoice, there remains an empty string in
> the options list, letting my ChoiceRenderer stumble when it tries to
> interpret my idExpression :(
>
> If there are any more ideas regarding to this, please let me know.
>
> Thanks so far!
>
> btw.: nullValid is the correct 'Please choose one' string resource key
>
>
>
> Sergio García wrote:
> >
> > I guess that if you simply override the dropdownchoice i18n property
> value
> > for that component/page with a plain "" it may work.
> >
> > DropDownChoice property key for "Please choose one" is "null", or at
> least
> > i remember that.
> >
> >
> >
>
> --
> View this message in context:
> http://www.nabble.com/DropDownChoice-without-preselection-and-without-%27Please-choose-one%27-tp22120191p22120404.html
> Sent from the Wicket - User mailing list archive at Nabble.com.
>
>
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>


Re: DropDownChoice without preselection and without 'Please choose one'

2009-02-20 Thread Martin Makundi
DId you try setting the .null <- property value? If null
is valid then try .nullValid , see
http://wicket.sourceforge.net/apidocs/wicket/markup/html/form/DropDownChoice.html

**
Martin

2009/2/20 pixologe :
>
> I tried overriding getDefaultChoice already, returning an empty string, this
> did not work, unfortunately.
>
> The 'Please choose one' option is not rendered, however the first 'normal'
> option gets selected instead.
> Also, inside AbstractSingleSelectChoice, there remains an empty string in
> the options list, letting my ChoiceRenderer stumble when it tries to
> interpret my idExpression :(
>
> If there are any more ideas regarding to this, please let me know.
>
> Thanks so far!
>
> btw.: nullValid is the correct 'Please choose one' string resource key
>
>
>
> Sergio García wrote:
>>
>> I guess that if you simply override the dropdownchoice i18n property value
>> for that component/page with a plain "" it may work.
>>
>> DropDownChoice property key for "Please choose one" is "null", or at least
>> i remember that.
>>
>>
>>
>
> --
> View this message in context: 
> http://www.nabble.com/DropDownChoice-without-preselection-and-without-%27Please-choose-one%27-tp22120191p22120404.html
> Sent from the Wicket - User mailing list archive at Nabble.com.
>
>
> -
> 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



Re: DropDownChoice without preselection and without 'Please choose one'

2009-02-20 Thread pixologe

I tried overriding getDefaultChoice already, returning an empty string, this
did not work, unfortunately.

The 'Please choose one' option is not rendered, however the first 'normal'
option gets selected instead.
Also, inside AbstractSingleSelectChoice, there remains an empty string in
the options list, letting my ChoiceRenderer stumble when it tries to
interpret my idExpression :(

If there are any more ideas regarding to this, please let me know.

Thanks so far!

btw.: nullValid is the correct 'Please choose one' string resource key



Sergio García wrote:
> 
> I guess that if you simply override the dropdownchoice i18n property value
> for that component/page with a plain "" it may work.
> 
> DropDownChoice property key for "Please choose one" is "null", or at least
> i remember that.
> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/DropDownChoice-without-preselection-and-without-%27Please-choose-one%27-tp22120191p22120404.html
Sent from the Wicket - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: DropDownChoice without preselection and without 'Please choose one'

2009-02-20 Thread Sergio García

I guess that if you simply override the dropdownchoice i18n property value
for that component/page with a plain "" it may work.

DropDownChoice property key for "Please choose one" is "null", or at least i
remember that.


-- 
View this message in context: 
http://www.nabble.com/DropDownChoice-without-preselection-and-without-%27Please-choose-one%27-tp22120191p22120391.html
Sent from the Wicket - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: DropDownChoice without preselection and without 'Please choose one'

2009-02-20 Thread Fatih Mehmet Ucar
you can use setNullValid(true) method

2009/2/20 pixologe 

>
> Hi everybody,
>
> I might just be out of it or missing a clue - I'd just like to have a
> DropDownChoice without preselection and without 'Please choose one' option.
> Is this possible? How can I achieve this?
>
> Thanks in advance + regards
> --
> View this message in context:
> http://www.nabble.com/DropDownChoice-without-preselection-and-without-%27Please-choose-one%27-tp22120191p22120191.html
> Sent from the Wicket - User mailing list archive at Nabble.com.
>
>
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>


-- 
Fatih Mehmet UCAR, Software Engineer
Espresso Education Limited
Riverside Studios,
Crisp Road, London W6 9RL


DropDownChoice without preselection and without 'Please choose one'

2009-02-20 Thread pixologe

Hi everybody,

I might just be out of it or missing a clue - I'd just like to have a
DropDownChoice without preselection and without 'Please choose one' option.
Is this possible? How can I achieve this?

Thanks in advance + regards
-- 
View this message in context: 
http://www.nabble.com/DropDownChoice-without-preselection-and-without-%27Please-choose-one%27-tp22120191p22120191.html
Sent from the Wicket - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org