You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by John <mu...@gmail.com> on 2008/09/02 13:00:44 UTC
Re: DropDownChoice - required, one item so preselection?
hi, the items in the DropDownChoice come from another part of the
application. someone could enter the page with the DropDownChoice on
it when there are three items in it but another user could delete two
of them and the first user could refresh the page and ideally it would
automatically select the only available option
when there is functionality that looks like it should be part of the
fabric of the application somewhere in a model or in a component but
i'm putting it on the page somewhere that will not activate in all
situations... i get the feeling that i'm doing something wrong. maybe
i am not
i will put the code in the constructor and will revisit this at a later date
thanks for all your responses
john
On Thu, Aug 28, 2008 at 2:13 PM, James Carman
<ja...@carmanconsulting.com> wrote:
> How are the items in the DDC changing?
>
> On Thu, Aug 28, 2008 at 9:02 AM, John <mu...@gmail.com> wrote:
>> hi, thanks for your response. i know i can set the model manually at
>> point of component creation but as i understand it that code won't be
>> executed if the page is redisplayed and the items in the
>> DropDownChoice have changed and it would need to be duplicated each
>> time i need this functionality. it seems to me that this
>> functionality should be in my custom extension of the component. i
>> could put such code in the constructor of my component but again it
>> would not be executed when the component is redisplayed.
>>
>> apologies... maybe i have got the wrong end of the stick here...
>>
>> maybe should this code only be executed once, and not again?
>>
>> john
>>
>>
>>
>> On Thu, Aug 28, 2008 at 11:37 AM, Nino Saturnino Martinez Vazquez Wael
>> <ni...@jayway.dk> wrote:
>>> just set the model to what you want selected:)
>>>
>>> John wrote:
>>>>
>>>> hi, when using a DropDownChoice is there a way to have the value
>>>> preselected if there is only one available and the field is required?
>>>>
>>>> i have looked through the code but cannot see any settings that might
>>>> control this, and am stumped trying to work out how to extend the
>>>> control in this way.
>>>>
>>>> john
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org