initmodel isnt called until the first getmodel/object call. why would
that happen before the component is added to its parent?
-igor
On Thu, Oct 1, 2009 at 1:03 AM, Edmund Urbani wrote:
> Can't be done, because the component does not yet know its parent during
> object
> initialization. initMod
Can't be done, because the component does not yet know its parent during object
initialization. initModel/getDefaultModel needs to be called later, when the
component knows its place in the hierarchy. by giving the child component a
model that obtains the model from its parent (MyTextfield) the cal
why not
class mytextefield extends panel {
public mytextfield {
add(new textfield() { initmodel() { return
mytextfield.this.getdefaultmodel(); }});
}
}
since this is essentially what you want to do - have textfield use the
same model as the panel.
-igor
On Wed, Sep 30, 2009 at 9:47
You're right, getDefaultModel ensures initialization. I should have suggested
that instead of getModel (which is not available in the component class anymore
in 1.4.x).
However, I did not want to override the initModel() method (and copy most of its
code) just for that. So now I solved it by creat
The child model's initModel() gets called first
There are no especial ordering programing to initModels calls. Basically
they are called by
public final IModel getDefaultModel()
{
IModel model = getModelImpl();
// If model is null
if (model == null)
{
Hi,
I was just trying to create a component of my own which - in some of my pages -
is created without a model. In the initModel() method I would then call
super.initModel() and wrap the resulting model for use in a child component. The
problem is the initialization order:
The child model's initM