Hello,
For your property discovery mechanism, I'm not sure I really see how
this works (sounds interesting though). However, what you want for
traversing the component hierarchy upon initializing your panel is to
delay the initialization after the panel has been added.
And there is a method defined in Component exactly for this purpose:
onInitialize() (well this is on wicket 1.5, but I don't think it has
changed in wicket 6). Basically you would do in this method (don't
forget to call super.onInitialize() though) whatever you would
otherwise have done in the constructor but requires access to the
component hierarchy.
++++
This method is meant to be used as an alternative to initialize
components. Usually the component's constructor is used for this task,
but sometimes a component cannot be initialized in isolation, it may
need to access its parent component or its markup in order to fully
initialize. This method is invoked once per component's lifecycle when
a path exists from this component to the Page thus providing the
component with an atomic callback when the component's environment is
built out.
++++
Hope this helps.
On Thu 28 Feb 2013 09:53:12 CET, Patrick Davids wrote:
Hi all,
I have a question concerning resuable panels, translation and the markup
traversing.
e.g. I have a page, which has its own property file providing
translation for a delete button.
This page deletes, lets say "Cars", so the buttons label should "delete
car".
On this page is a resuable panel for the delete action. Opening a
dialog... ask the user, to be sure etc. and here also, the headline
should be "delete car"
So, the panel should try to find the nearest label "delete" in the
markup hierarchy.
But: I always run into problems finding these labels, because the
component (on its init) is not part of a markup hierarchy, yet.
Cannot find key exception...
What I dont want to do is, giving all page specific texts and
translation to the reusable delete panel.
Doing so I loose this great wicket feature, just traversing the hierachy
tring to find the nearest matching translation.
What I'm doing wrong? How can I handle this in a best way?
Must be something easy, I just cannot see...
kind regards
Patrick
---------------------------------------------------------------------
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