have a breakpoint on that line - getDefaultAccount returns what I expect
On Wed, Sep 1, 2010 at 5:21 PM, Sven Meier [via Apache Wicket] <[email protected]> wrote: > 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: [hidden email] > For additional commands, e-mail: [hidden email] > > > > ________________________________ > View message @ > http://apache-wicket.1842946.n4.nabble.com/DropDownChoice-how-to-select-default-item-tp2402960p2403250.html > To unsubscribe from DropDownChoice - how to select default item, click here. > -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/DropDownChoice-how-to-select-default-item-tp2402960p2403304.html Sent from the Wicket - User mailing list archive at Nabble.com.
