You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by nino martinez wael <ni...@gmail.com> on 2011/10/07 14:53:59 UTC

1.5.1 DropDownChoice howto change default text, not working

I cant get the below to work in 1.5.1 (only version I've tried it in
for a long time)

http://www.mail-archive.com/wicket-user@lists.sourceforge.net/msg10790.html

my code:

			DropDownChoice<Entrance> ddEntrance = new DropDownChoice<Entrance>(
					idEntranceOrIvrMenu, entranceModel,
					backendDaoService.getCustomerEntranceList(),
					new DropDownRenderer<Entrance>()) {
				 @Override
				 protected CharSequence getDefaultChoice(String arg0) {
				
				 return new ResourceModel("chooseone.customerentrance")
				 .getObject();
				 }
			};

property file:

chooseone.ivr=Vælg IVR Menu
chooseone.customerentrance=Vælg Kundeindgang
chooseone.shadowentrance=Vælg Skyggeindgang


Screen shots:
top one are where I override (theres actually no default text just the
first option) , bottom one where i don't.
http://imgur.com/a/SJwOt


-regards Nino

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


Re: 1.5.1 DropDownChoice howto change default text, not working

Posted by Igor Vaynberg <ig...@gmail.com>.
use Component#getString(key) method

-igor

On Fri, Oct 7, 2011 at 5:53 AM, nino martinez wael
<ni...@gmail.com> wrote:
> I cant get the below to work in 1.5.1 (only version I've tried it in
> for a long time)
>
> http://www.mail-archive.com/wicket-user@lists.sourceforge.net/msg10790.html
>
> my code:
>
>                        DropDownChoice<Entrance> ddEntrance = new DropDownChoice<Entrance>(
>                                        idEntranceOrIvrMenu, entranceModel,
>                                        backendDaoService.getCustomerEntranceList(),
>                                        new DropDownRenderer<Entrance>()) {
>                                 @Override
>                                 protected CharSequence getDefaultChoice(String arg0) {
>
>                                 return new ResourceModel("chooseone.customerentrance")
>                                 .getObject();
>                                 }
>                        };
>
> property file:
>
> chooseone.ivr=Vælg IVR Menu
> chooseone.customerentrance=Vælg Kundeindgang
> chooseone.shadowentrance=Vælg Skyggeindgang
>
>
> Screen shots:
> top one are where I override (theres actually no default text just the
> first option) , bottom one where i don't.
> http://imgur.com/a/SJwOt
>
>
> -regards Nino
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>

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