Mike may have been referring to the usage of "this" when he was
talking about the constructor.  I create drop downs in constructors
with no issue, I have not however used a "this" with a property model.

Wild guess:  possibly java is in the process of constructing the
object, but DropDownChoice cannot access the "this" yet?

On occasion I am using drop downs without choice renderer and setting
the initial value OK.


On Wed, Sep 1, 2010 at 10:20 AM, Sven Meier <s...@meiers.net> 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: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>

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

Reply via email to