I've got the following bits of code:

public HomePage(PageParameters parms) {
        this();
        Long accountId = parms.getLong("accountId");
        account = new ModelEntity(Account.class, accountId);
        setModel(account);
...

public class EditContactDetails extends Panel{
    public EditContactDetails(String id, final ModelEntity contact){
        super(id);
        Form form = new Form("form", new CompoundPropertyModel(contactObj)){
            @Override
            protected void onSubmit(){
                //do stuff

                //redraw the page
                HomePage hp = (HomePage) this.findPage();
                ModelEntity account = (ModelEntity)
parent.getInnermostModel();
                facade.logSevere(account.toString());
                hp.reloadAccount(account);
            }
        };
...

getInnermostModel() is returning null, instead of the model I set it to when
loading the page.  This all used to work until I added a panel to hierarchy
above EditContactDetails and I'm not sure why I can't get my hands on the
model now.

I'm using wicket 1.3.5.  Are there circumstances where findPage() would
return a new instance of HomePage?  Logging tells me that HomePage's model
does not contain null at the time it is set, and I'm not explicitly setting
it anywhere else, is there some trickery that could be resetting it for me?

Thanks for you time.
Loren

Reply via email to