You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Oliver-Sven Fritsch <os...@3blogos.com> on 2009/11/05 11:36:01 UTC
HowTo change DataGrid NavigationLabel
Hi list!
I'm trying to change the default NavigationLabel for the inMethod
DataGrid. the documentation says :
The message can be overridden using the |NavigatorLabel| property key,
the default message is used is of the format |Showing ${from} to ${to}
of ${of}|. The message can also be configured pragmatically by setting
it as the model object of the label.
But I don't get how this is meant. Can anyone provide some example code
how to change the default text?
Regards
Oliver
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org
Re: HowTo change DataGrid NavigationLabel
Posted by Oliver-Sven Fritsch <os...@3blogos.com>.
Thanks!
That finally did the trick. :-)
Regards,
Oliver
Linda van der Pal schrieb:
> I've added
>
> NavigatorLabel=XXX
>
> to the global properties files of my app and it works like a charm. (I
> wanted to internationalise the label.)
>
> Regards,
> Linda
>
> Ernesto Reinaldo Barreiro wrote:
>> Is this NavigationLabel part of the GRID classes? I see a
>> NavigatorLabel?
>> and the code is like
>>
>> public NavigatorLabel(final String id, final DataGrid table) {
>> super(id);
>> setDefaultModel(new StringResourceModel("NavigatorLabel", this, new
>> Model(new LabelModelObject(table)),
>> "Showing ${from} to ${to} of ${of}"));
>> }
>>
>> So the "Showing ${from} to ${to} of ${of}" will only appear as a default
>> value if no resource "NavigatorLabel" can be found on the resources. Try
>> what I said and (I guess) that will work.
>>
>> Regards,
>>
>> Ernesto
>>
>>
>> On Thu, Nov 5, 2009 at 11:57 AM, Oliver-Sven Fritsch
>> <os...@3blogos.com>wrote:
>>
>>
>>> Thanks for your reply!
>>>
>>> Problem is that the message "Showing..." is hard coded into the
>>> NavigationLabel.class so property files won't affect it.
>>>
>>> Regards,
>>>
>>> Oliver
>>>
>>>
>>> Do not use inMethod (nice) data grid myself but from what I understand
>>>
>>>> from
>>>> your message you could either
>>>>
>>>> -Subclass the grid to a MyDataGrid, add a
>>>> MyDataGrid_lang.properties and,
>>>> e.g. add a NavigatorLabel = Paginas ${from} to ${to} of ${of} to last
>>>> property file.
>>>> -If you only want this for a page, say MyPage, add a
>>>> MyPage_lang.properties
>>>> and do the same as in previous step.
>>>>
>>>> Hope this works
>>>>
>>>> Regards,
>>>>
>>>> Ernesto
>>>>
>>>> On Thu, Nov 5, 2009 at 11:36 AM, Oliver-Sven Fritsch <osf@3blogos.com
>>>>
>>>>> wrote:
>>>>>
>>>>
>>>>
>>>>> Hi list!
>>>>>
>>>>> I'm trying to change the default NavigationLabel for the inMethod
>>>>> DataGrid.
>>>>> the documentation says :
>>>>>
>>>>> The message can be overridden using the |NavigatorLabel| property
>>>>> key,
>>>>> the
>>>>> default message is used is of the format |Showing ${from} to ${to} of
>>>>> ${of}|. The message can also be configured pragmatically by
>>>>> setting it as
>>>>> the model object of the label.
>>>>> But I don't get how this is meant. Can anyone provide some example
>>>>> code
>>>>> how
>>>>> to change the default text?
>>>>>
>>>>> Regards
>>>>> Oliver
>>>>>
>>>>> ---------------------------------------------------------------------
>>>>> 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
>>>
>>>
>>>
>>
>>
>> ------------------------------------------------------------------------
>>
>>
>> Geen virus gevonden in het binnenkomende-bericht.
>> Gecontroleerd door AVG - www.avg.com Versie: 9.0.698 / Virusdatabase:
>> 270.14.50/2481 - datum van uitgifte: 11/04/09 20:51:00
>>
>>
>
>
> ---------------------------------------------------------------------
> 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
Re: HowTo change DataGrid NavigationLabel
Posted by Ernesto Reinaldo Barreiro <re...@gmail.com>.
Yes, that will, for sure, set the same label for the whole application.
Creating a sub-class is a better option, IMHO, if you want to use the
same component at several applications...
Best,
Ernesto
On Thu, Nov 5, 2009 at 12:33 PM, Linda van der Pal <
lvdpal@heritageagenturen.nl> wrote:
> I've added
>
> NavigatorLabel=XXX
>
> to the global properties files of my app and it works like a charm. (I
> wanted to internationalise the label.)
>
> Regards,
> Linda
>
> Ernesto Reinaldo Barreiro wrote:
>
>> Is this NavigationLabel part of the GRID classes? I see a NavigatorLabel?
>> and the code is like
>>
>> public NavigatorLabel(final String id, final DataGrid table) {
>> super(id);
>> setDefaultModel(new StringResourceModel("NavigatorLabel", this, new
>> Model(new LabelModelObject(table)),
>> "Showing ${from} to ${to} of ${of}"));
>> }
>>
>> So the "Showing ${from} to ${to} of ${of}" will only appear as a default
>> value if no resource "NavigatorLabel" can be found on the resources. Try
>> what I said and (I guess) that will work.
>>
>> Regards,
>>
>> Ernesto
>>
>>
>> On Thu, Nov 5, 2009 at 11:57 AM, Oliver-Sven Fritsch <osf@3blogos.com
>> >wrote:
>>
>>
>>
>>> Thanks for your reply!
>>>
>>> Problem is that the message "Showing..." is hard coded into the
>>> NavigationLabel.class so property files won't affect it.
>>>
>>> Regards,
>>>
>>> Oliver
>>>
>>>
>>> Do not use inMethod (nice) data grid myself but from what I understand
>>>
>>>
>>>> from
>>>> your message you could either
>>>>
>>>> -Subclass the grid to a MyDataGrid, add a MyDataGrid_lang.properties
>>>> and,
>>>> e.g. add a NavigatorLabel = Paginas ${from} to ${to} of ${of} to last
>>>> property file.
>>>> -If you only want this for a page, say MyPage, add a
>>>> MyPage_lang.properties
>>>> and do the same as in previous step.
>>>>
>>>> Hope this works
>>>>
>>>> Regards,
>>>>
>>>> Ernesto
>>>>
>>>> On Thu, Nov 5, 2009 at 11:36 AM, Oliver-Sven Fritsch <osf@3blogos.com
>>>>
>>>>
>>>>> wrote:
>>>>>
>>>>>
>>>>
>>>>
>>>>
>>>>> Hi list!
>>>>>
>>>>> I'm trying to change the default NavigationLabel for the inMethod
>>>>> DataGrid.
>>>>> the documentation says :
>>>>>
>>>>> The message can be overridden using the |NavigatorLabel| property key,
>>>>> the
>>>>> default message is used is of the format |Showing ${from} to ${to} of
>>>>> ${of}|. The message can also be configured pragmatically by setting it
>>>>> as
>>>>> the model object of the label.
>>>>> But I don't get how this is meant. Can anyone provide some example code
>>>>> how
>>>>> to change the default text?
>>>>>
>>>>> Regards
>>>>> Oliver
>>>>>
>>>>> ---------------------------------------------------------------------
>>>>> 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
>>>
>>>
>>>
>>>
>>
>> ------------------------------------------------------------------------
>>
>>
>> Geen virus gevonden in het binnenkomende-bericht.
>> Gecontroleerd door AVG - www.avg.com Versie: 9.0.698 / Virusdatabase:
>> 270.14.50/2481 - datum van uitgifte: 11/04/09 20:51:00
>>
>>
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>
Re: HowTo change DataGrid NavigationLabel
Posted by Linda van der Pal <lv...@heritageagenturen.nl>.
I've added
NavigatorLabel=XXX
to the global properties files of my app and it works like a charm. (I
wanted to internationalise the label.)
Regards,
Linda
Ernesto Reinaldo Barreiro wrote:
> Is this NavigationLabel part of the GRID classes? I see a NavigatorLabel?
> and the code is like
>
> public NavigatorLabel(final String id, final DataGrid table) {
> super(id);
> setDefaultModel(new StringResourceModel("NavigatorLabel", this, new
> Model(new LabelModelObject(table)),
> "Showing ${from} to ${to} of ${of}"));
> }
>
> So the "Showing ${from} to ${to} of ${of}" will only appear as a default
> value if no resource "NavigatorLabel" can be found on the resources. Try
> what I said and (I guess) that will work.
>
> Regards,
>
> Ernesto
>
>
> On Thu, Nov 5, 2009 at 11:57 AM, Oliver-Sven Fritsch <os...@3blogos.com>wrote:
>
>
>> Thanks for your reply!
>>
>> Problem is that the message "Showing..." is hard coded into the
>> NavigationLabel.class so property files won't affect it.
>>
>> Regards,
>>
>> Oliver
>>
>>
>> Do not use inMethod (nice) data grid myself but from what I understand
>>
>>> from
>>> your message you could either
>>>
>>> -Subclass the grid to a MyDataGrid, add a MyDataGrid_lang.properties and,
>>> e.g. add a NavigatorLabel = Paginas ${from} to ${to} of ${of} to last
>>> property file.
>>> -If you only want this for a page, say MyPage, add a
>>> MyPage_lang.properties
>>> and do the same as in previous step.
>>>
>>> Hope this works
>>>
>>> Regards,
>>>
>>> Ernesto
>>>
>>> On Thu, Nov 5, 2009 at 11:36 AM, Oliver-Sven Fritsch <osf@3blogos.com
>>>
>>>> wrote:
>>>>
>>>
>>>
>>>> Hi list!
>>>>
>>>> I'm trying to change the default NavigationLabel for the inMethod
>>>> DataGrid.
>>>> the documentation says :
>>>>
>>>> The message can be overridden using the |NavigatorLabel| property key,
>>>> the
>>>> default message is used is of the format |Showing ${from} to ${to} of
>>>> ${of}|. The message can also be configured pragmatically by setting it as
>>>> the model object of the label.
>>>> But I don't get how this is meant. Can anyone provide some example code
>>>> how
>>>> to change the default text?
>>>>
>>>> Regards
>>>> Oliver
>>>>
>>>> ---------------------------------------------------------------------
>>>> 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
>>
>>
>>
>
>
> ------------------------------------------------------------------------
>
>
> Geen virus gevonden in het binnenkomende-bericht.
> Gecontroleerd door AVG - www.avg.com
> Versie: 9.0.698 / Virusdatabase: 270.14.50/2481 - datum van uitgifte: 11/04/09 20:51:00
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org
Re: HowTo change DataGrid NavigationLabel
Posted by Ernesto Reinaldo Barreiro <re...@gmail.com>.
Is this NavigationLabel part of the GRID classes? I see a NavigatorLabel?
and the code is like
public NavigatorLabel(final String id, final DataGrid table) {
super(id);
setDefaultModel(new StringResourceModel("NavigatorLabel", this, new
Model(new LabelModelObject(table)),
"Showing ${from} to ${to} of ${of}"));
}
So the "Showing ${from} to ${to} of ${of}" will only appear as a default
value if no resource "NavigatorLabel" can be found on the resources. Try
what I said and (I guess) that will work.
Regards,
Ernesto
On Thu, Nov 5, 2009 at 11:57 AM, Oliver-Sven Fritsch <os...@3blogos.com>wrote:
> Thanks for your reply!
>
> Problem is that the message "Showing..." is hard coded into the
> NavigationLabel.class so property files won't affect it.
>
> Regards,
>
> Oliver
>
>
> Do not use inMethod (nice) data grid myself but from what I understand
>> from
>> your message you could either
>>
>> -Subclass the grid to a MyDataGrid, add a MyDataGrid_lang.properties and,
>> e.g. add a NavigatorLabel = Paginas ${from} to ${to} of ${of} to last
>> property file.
>> -If you only want this for a page, say MyPage, add a
>> MyPage_lang.properties
>> and do the same as in previous step.
>>
>> Hope this works
>>
>> Regards,
>>
>> Ernesto
>>
>> On Thu, Nov 5, 2009 at 11:36 AM, Oliver-Sven Fritsch <osf@3blogos.com
>> >wrote:
>>
>>
>>
>>> Hi list!
>>>
>>> I'm trying to change the default NavigationLabel for the inMethod
>>> DataGrid.
>>> the documentation says :
>>>
>>> The message can be overridden using the |NavigatorLabel| property key,
>>> the
>>> default message is used is of the format |Showing ${from} to ${to} of
>>> ${of}|. The message can also be configured pragmatically by setting it as
>>> the model object of the label.
>>> But I don't get how this is meant. Can anyone provide some example code
>>> how
>>> to change the default text?
>>>
>>> Regards
>>> Oliver
>>>
>>> ---------------------------------------------------------------------
>>> 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
>
>
Re: HowTo change DataGrid NavigationLabel
Posted by Oliver-Sven Fritsch <os...@3blogos.com>.
Thanks for your reply!
Problem is that the message "Showing..." is hard coded into the
NavigationLabel.class so property files won't affect it.
Regards,
Oliver
> Do not use inMethod (nice) data grid myself but from what I understand from
> your message you could either
>
> -Subclass the grid to a MyDataGrid, add a MyDataGrid_lang.properties and,
> e.g. add a NavigatorLabel = Paginas ${from} to ${to} of ${of} to last
> property file.
> -If you only want this for a page, say MyPage, add a MyPage_lang.properties
> and do the same as in previous step.
>
> Hope this works
>
> Regards,
>
> Ernesto
>
> On Thu, Nov 5, 2009 at 11:36 AM, Oliver-Sven Fritsch <os...@3blogos.com>wrote:
>
>
>> Hi list!
>>
>> I'm trying to change the default NavigationLabel for the inMethod DataGrid.
>> the documentation says :
>>
>> The message can be overridden using the |NavigatorLabel| property key, the
>> default message is used is of the format |Showing ${from} to ${to} of
>> ${of}|. The message can also be configured pragmatically by setting it as
>> the model object of the label.
>> But I don't get how this is meant. Can anyone provide some example code how
>> to change the default text?
>>
>> Regards
>> Oliver
>>
>> ---------------------------------------------------------------------
>> 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
Re: HowTo change DataGrid NavigationLabel
Posted by Ernesto Reinaldo Barreiro <re...@gmail.com>.
Do not use inMethod (nice) data grid myself but from what I understand from
your message you could either
-Subclass the grid to a MyDataGrid, add a MyDataGrid_lang.properties and,
e.g. add a NavigatorLabel = Paginas ${from} to ${to} of ${of} to last
property file.
-If you only want this for a page, say MyPage, add a MyPage_lang.properties
and do the same as in previous step.
Hope this works
Regards,
Ernesto
On Thu, Nov 5, 2009 at 11:36 AM, Oliver-Sven Fritsch <os...@3blogos.com>wrote:
> Hi list!
>
> I'm trying to change the default NavigationLabel for the inMethod DataGrid.
> the documentation says :
>
> The message can be overridden using the |NavigatorLabel| property key, the
> default message is used is of the format |Showing ${from} to ${to} of
> ${of}|. The message can also be configured pragmatically by setting it as
> the model object of the label.
> But I don't get how this is meant. Can anyone provide some example code how
> to change the default text?
>
> Regards
> Oliver
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>