I've had this same issue when trying to build a component instantiation
listener for inspecting hibernate annotations. Since the
IComponentInstantiationListener interface doesn't have a hook for
"onModelBinding", i've tried to use Behaviors instead. Can you try
something like this?
public MyComponentInstantiationListener implements
IComponentInstantiationListener {
public void onInstantiation(Component component) {
component.add(new MyBehavior());
}
}
public MyBehavior extends AbstractBehavior {
public void bind(Component component) {
super.bind(component);
//inspect the model of the component and do your crazy work here
}
}
On 6/18/07, Alberto Bueno <[EMAIL PROTECTED]> wrote:
Hi,
I'm using IComponentInstantiationListener to add additional
functionality to my components. But in this listener I need to know the
model of the component to condition this functionality.
If we inspect the code, we can see that the listeners are called before
assigning the model to the component:
public Component(final String id, final IModel model)
{
setId(id);
getApplication().notifyComponentInstantiationListeners(this);
this.model = wrap(model);
final IDebugSettings debugSettings =
Application.get().getDebugSettings();
if (debugSettings.getComponentUseCheck())
{
setMetaData(CONSTRUCTED_AT_KEY, Strings.toString(this, new
MarkupException(
"constructed")));
}
}
Are there any reason to do the notification in that moment?
Thanks
-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user
-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user