Re: Localization properties overriding

2010-01-25 Thread Marek Šabo

Hi Erik,

I understand this - I use it eg. HomePage has title=Home, UserHomePage 
has title=User's Home etc... and it works top-down as expected.


But why does this topmost property title, that should bind itself to 
key=title of wicket:messages attached to page component itself, got 
bounded to title two levels deeper in hierarchy precisely defined in 
lower most level (top-down should use the last found, shouldn't it?). 
According to what happens my UserHomePage should read only Home Page 
in it's title


Sorry to bother, regards,
Marek


On 01/25/2010 03:39 PM, Erik van Oosten wrote:

He Marek,

The idea of Wicket i18n is that when you use a component, you can 
override its default texts with your own. That's why the lookup is 
top-down and not bottom-up.


To solve this you'll need to use a more fine-grained name for the home 
page's title.


Regards,
   Erik.



Marek Šabo write:

Hi all,

I have a question regarding property binding when using localized 
property files, consider following:


UserHomePage page has one property for localization and that is 
title=User's Home which is then used in markup as:


head
titlewicket:message key=title //title
/head
...

This page has inside an UserAddPanel with form with following 
properties:


formContainer.uaForm.title=Title
formContainer.uaForm.name=First Name
...

for markup:

wicket:panel
div wicket:id=formContainer
form wicket:id=uaForm
label for=titlewicket:message key=title //label
label for=namewicket:message key=name //label
...

The name and other labels are generated fine (no reason not to) but 
the title is set to User's Home which is not desired. I would 
understood this behavior if I hadn't defined such 'fine-grained' 
property as formContainer.uaForm.title but why is it overriden when 
there is precise declaration on lower level?
Is there a way to achieve behavior which I described or do I have to 
rename title in form to something else?


TIA,

Marek







--
Marek Šabo
Chief Server Manager
Club SU CTU Buben
Bubenečská Kolej
Terronská 28, Prague 16000
XMPP: zeratul...@gmail.com


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



Re: Localization properties overriding

2010-01-25 Thread Erik van Oosten
The search for any given property key is top-down, the first result is 
found.


Why? As I said, to allow an override of the component (which may be 
third party).


Regards,
   Erik.


Marek Šabo wrote:

Hi Erik,

I understand this - I use it eg. HomePage has title=Home, UserHomePage 
has title=User's Home etc... and it works top-down as expected.


But why does this topmost property title, that should bind itself to 
key=title of wicket:messages attached to page component itself, got 
bounded to title two levels deeper in hierarchy precisely defined in 
lower most level (top-down should use the last found, shouldn't it?). 
According to what happens my UserHomePage should read only Home Page 
in it's title


Sorry to bother, regards,
Marek


On 01/25/2010 03:39 PM, Erik van Oosten wrote:

He Marek,

The idea of Wicket i18n is that when you use a component, you can 
override its default texts with your own. That's why the lookup is 
top-down and not bottom-up.


To solve this you'll need to use a more fine-grained name for the 
home page's title.


Regards,
   Erik.



Marek Šabo write:

Hi all,

I have a question regarding property binding when using localized 
property files, consider following:


UserHomePage page has one property for localization and that is 
title=User's Home which is then used in markup as:


head
titlewicket:message key=title //title
/head
...

This page has inside an UserAddPanel with form with following 
properties:


formContainer.uaForm.title=Title
formContainer.uaForm.name=First Name
...

for markup:

wicket:panel
div wicket:id=formContainer
form wicket:id=uaForm
label for=titlewicket:message key=title //label
label for=namewicket:message key=name //label
...

The name and other labels are generated fine (no reason not to) but 
the title is set to User's Home which is not desired. I would 
understood this behavior if I hadn't defined such 'fine-grained' 
property as formContainer.uaForm.title but why is it overriden when 
there is precise declaration on lower level?
Is there a way to achieve behavior which I described or do I have to 
rename title in form to something else?


TIA,

Marek


--
Erik van Oosten
http://day-to-day-stuff.blogspot.com/



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



Re: Localization properties overriding

2010-01-25 Thread Marek Šabo

Hi,

well I see where was the misunderstanding. The FIRST result found. What 
I'm used to when going from top to down is the LAST definition takes 
effect. Well maybe I will see to it when I will do some modules but for 
now I'll just rename it and won't use single name properties anymore to 
avoid this kind of problems.


Thanks


On 01/25/2010 04:05 PM, Erik van Oosten wrote:
The search for any given property key is top-down, the first result is 
found.


Why? As I said, to allow an override of the component (which may be 
third party).


Regards,
   Erik.


Marek Šabo wrote:

Hi Erik,

I understand this - I use it eg. HomePage has title=Home, 
UserHomePage has title=User's Home etc... and it works top-down as 
expected.


But why does this topmost property title, that should bind itself to 
key=title of wicket:messages attached to page component itself, got 
bounded to title two levels deeper in hierarchy precisely defined in 
lower most level (top-down should use the last found, shouldn't 
it?). According to what happens my UserHomePage should read only 
Home Page in it's title


Sorry to bother, regards,
Marek


On 01/25/2010 03:39 PM, Erik van Oosten wrote:

He Marek,

The idea of Wicket i18n is that when you use a component, you can 
override its default texts with your own. That's why the lookup is 
top-down and not bottom-up.


To solve this you'll need to use a more fine-grained name for the 
home page's title.


Regards,
   Erik.



Marek Šabo write:

Hi all,

I have a question regarding property binding when using localized 
property files, consider following:


UserHomePage page has one property for localization and that is 
title=User's Home which is then used in markup as:


head
titlewicket:message key=title //title
/head
...

This page has inside an UserAddPanel with form with following 
properties:


formContainer.uaForm.title=Title
formContainer.uaForm.name=First Name
...

for markup:

wicket:panel
div wicket:id=formContainer
form wicket:id=uaForm
label for=titlewicket:message key=title //label
label for=namewicket:message key=name //label
...

The name and other labels are generated fine (no reason not to) but 
the title is set to User's Home which is not desired. I would 
understood this behavior if I hadn't defined such 'fine-grained' 
property as formContainer.uaForm.title but why is it overriden when 
there is precise declaration on lower level?
Is there a way to achieve behavior which I described or do I have 
to rename title in form to something else?


TIA,

Marek





--
Marek Šabo
Chief Server Manager
Club SU CTU Buben
Bubenečská Kolej
Terronská 28, Prague 16000
XMPP: zeratul...@gmail.com


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