Hi,

your dropdown accesses the selected account via a model, so it should work regardless when you initialize the selectedAccount variable.

Put a breakpoint on that line and check the return value of getDefaultAccount().

BTW using Model<Account> and IChoiceRenderer gives you some advantages (always up-to-date account list, don't keep selected account in session, ...).

Sven

On 09/01/2010 04:02 PM, drf wrote:
Mike

Thanks - not sure if the problem is with the fact that the code is in the
constructor:
1) the In Action book seems to setup dropdowns ect in the constructor -
where else would I define the drop down?
2) the debugger and syout both show that selectedAccount has the correct
value prior to constructing the dropdown.

Re IChoseRenderer, the dropdown is displaying the correct values and also
updating selectedAccount correctly. So what does IChoseRenderer apart from
saving the effort to extract the raw account numbers - are you brining in
IChoseRenderer as good advice or are you saying that the fact I am not using
it is part of the issue?

I need to understand Models better, but I am wondering - do I have to write
another class to wrap Account with a Model implementation just to do this
simple thing? Also, if the selectedAccount is correctly set before calling
the constructor, will this still help?

David



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

Reply via email to