You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Guillaume Smet <gu...@gmail.com> on 2014/11/06 11:53:41 UTC

ResourceModel with default *key*

Hi all,

Maybe we are missing something but we haven't found an elegant way to
have a ResourceModel with a default *key* if the current key doesn't
exist.

There is a mechanism for a default *string* but it's not sufficient
for us (we want to be able to specialize the key if needed but have an
internationalized default if not).

Suggestions welcome!

Thanks.

-- 
Guillaume

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


Re: ResourceModel with default *key*

Posted by Martin Grigorov <mg...@apache.org>.
https://issues.apache.org/jira/browse/WICKET-5754

Martin Grigorov
Wicket Training and Consulting
https://twitter.com/mtgrigorov

On Mon, Nov 10, 2014 at 12:06 PM, Martin Grigorov <mg...@apache.org>
wrote:

> Hi,
>
> I also think this is good feature.
> In Wicket 7 StringResourceModel already uses IModel for the default value,
> so it is possible to do it.
> I'll improve ResourceModel too.
>
>
> Martin Grigorov
> Wicket Training and Consulting
> https://twitter.com/mtgrigorov
>
> On Thu, Nov 6, 2014 at 2:42 PM, Guillaume Smet <gu...@gmail.com>
> wrote:
>
>> Hi Tom,
>>
>> Thanks for your suggestion!
>>
>> That's the kind of thing I had in mind if we haven't missed anything
>> in the API but I was hoping we have missed something as it seems
>> generally useful!
>>
>> On Thu, Nov 6, 2014 at 12:49 PM, Tom Götz <to...@decoded.de> wrote:
>> > You could try something like this:
>> https://gist.github.com/tgoetz/0735b05d47b16acf2fd7 <
>> https://gist.github.com/tgoetz/0735b05d47b16acf2fd7>
>> >
>> > Cheers,
>> >    -Tom
>> >
>> >
>> >> On 06.11.2014, at 11:53, Guillaume Smet <gu...@gmail.com>
>> wrote:
>> >>
>> >> Hi all,
>> >>
>> >> Maybe we are missing something but we haven't found an elegant way to
>> >> have a ResourceModel with a default *key* if the current key doesn't
>> >> exist.
>> >>
>> >> There is a mechanism for a default *string* but it's not sufficient
>> >> for us (we want to be able to specialize the key if needed but have an
>> >> internationalized default if not).
>> >>
>> >> Suggestions welcome!
>> >>
>> >> Thanks.
>> >>
>> >> --
>> >> Guillaume
>> >
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>> For additional commands, e-mail: users-help@wicket.apache.org
>>
>>
>

Re: ResourceModel with default *key*

Posted by Martin Grigorov <mg...@apache.org>.
Hi,

I also think this is good feature.
In Wicket 7 StringResourceModel already uses IModel for the default value,
so it is possible to do it.
I'll improve ResourceModel too.


Martin Grigorov
Wicket Training and Consulting
https://twitter.com/mtgrigorov

On Thu, Nov 6, 2014 at 2:42 PM, Guillaume Smet <gu...@gmail.com>
wrote:

> Hi Tom,
>
> Thanks for your suggestion!
>
> That's the kind of thing I had in mind if we haven't missed anything
> in the API but I was hoping we have missed something as it seems
> generally useful!
>
> On Thu, Nov 6, 2014 at 12:49 PM, Tom Götz <to...@decoded.de> wrote:
> > You could try something like this:
> https://gist.github.com/tgoetz/0735b05d47b16acf2fd7 <
> https://gist.github.com/tgoetz/0735b05d47b16acf2fd7>
> >
> > Cheers,
> >    -Tom
> >
> >
> >> On 06.11.2014, at 11:53, Guillaume Smet <gu...@gmail.com>
> wrote:
> >>
> >> Hi all,
> >>
> >> Maybe we are missing something but we haven't found an elegant way to
> >> have a ResourceModel with a default *key* if the current key doesn't
> >> exist.
> >>
> >> There is a mechanism for a default *string* but it's not sufficient
> >> for us (we want to be able to specialize the key if needed but have an
> >> internationalized default if not).
> >>
> >> Suggestions welcome!
> >>
> >> Thanks.
> >>
> >> --
> >> Guillaume
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>

Re: ResourceModel with default *key*

Posted by Guillaume Smet <gu...@gmail.com>.
Hi Tom,

Thanks for your suggestion!

That's the kind of thing I had in mind if we haven't missed anything
in the API but I was hoping we have missed something as it seems
generally useful!

On Thu, Nov 6, 2014 at 12:49 PM, Tom Götz <to...@decoded.de> wrote:
> You could try something like this: https://gist.github.com/tgoetz/0735b05d47b16acf2fd7 <https://gist.github.com/tgoetz/0735b05d47b16acf2fd7>
>
> Cheers,
>    -Tom
>
>
>> On 06.11.2014, at 11:53, Guillaume Smet <gu...@gmail.com> wrote:
>>
>> Hi all,
>>
>> Maybe we are missing something but we haven't found an elegant way to
>> have a ResourceModel with a default *key* if the current key doesn't
>> exist.
>>
>> There is a mechanism for a default *string* but it's not sufficient
>> for us (we want to be able to specialize the key if needed but have an
>> internationalized default if not).
>>
>> Suggestions welcome!
>>
>> Thanks.
>>
>> --
>> Guillaume
>

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


Re: ResourceModel with default *key*

Posted by Tom Götz <to...@decoded.de>.
You could try something like this: https://gist.github.com/tgoetz/0735b05d47b16acf2fd7 <https://gist.github.com/tgoetz/0735b05d47b16acf2fd7>

Cheers,
   -Tom


> On 06.11.2014, at 11:53, Guillaume Smet <gu...@gmail.com> wrote:
> 
> Hi all,
> 
> Maybe we are missing something but we haven't found an elegant way to
> have a ResourceModel with a default *key* if the current key doesn't
> exist.
> 
> There is a mechanism for a default *string* but it's not sufficient
> for us (we want to be able to specialize the key if needed but have an
> internationalized default if not).
> 
> Suggestions welcome!
> 
> Thanks.
> 
> -- 
> Guillaume