You might want to use ajax to show the textfield only after a specific
option in the dropdown is chosen.

Add, for example, OnChangeAjaxBehavior to the dropdown where you add
the textfield to the target. In the textfield's isVisible method you
evaluate whether to show it or not.

textfield = new textfield() {
  public boolean isVisible() {
     // should I show or should I not
  }
}
textfield.setOutputMarkupPlaceholderTag(true); // So that you can
update a hidden(not-shown) component

dropdown = new dropdown();
dropdown.add(new onchangeajaxbehavior() {
  onchange(target) {
    target.addComponent(textfield);
  }
});

**
Martin

2009/4/7 Chris Carlson <[email protected]>:
> New to wicket trying to figure out the best way to do custom validation. I
> have a dropdown and a textfield, only 1 of which is required.  I want the
> user to select from the dropdown, and if their option is not listed, be
> able to enter anything in the textfield
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to