You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Janning Vygen <vy...@kicktipp.de> on 2010/01/06 13:23:00 UTC

DropDownBox should render as a label if only one choice is available

Hi,

I want a DropDownBox which renders as a Label if only one Choice is available.

I wrote a LabelDropDownPanel which you can see here

   http://pastie.org/768613 

(is it ok to use pastie here?)

My problem is, that the list of choices sometimes depends on another form 
Component. if i change this form component the choices of my dropdownlist 
should change too. It works fine with a normal dropdownChoice, beacuse the 
ChoiceModel and the other FormComponent share a common ModelObject.

if i use my LabelDropDownPanel is does not work.

The method isVisible() in my LabelDropDownPanel is called BEFORE the new input 
values from the other FormComponent are pushed into my model. So this method 
attaches the choices with the old value.

I wonder why "isVisible" is called before pushing the values from form 
submission.

I don't know how to solve my problem, but i am quite new to wicket, so please 
help me. 

kind regards
Janning


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