On 26.02.2009, at 22:52, Brill Pappin wrote:

For some reason the DropDownChoice component doesn't have the same generics as ListView and it will not accept a model that listview will, despite its saying that it will accept an IModel.

Is anyone else having that sort of trouble with DropDownChoice?

- Brill

Can you give us more information on what exactly is not working for you?

DropDownChoice indeed does accept a model, see for instance the example in the class description at

  
http://wicket.apache.org/docs/1.4/org/apache/wicket/markup/html/form/DropDownChoice.html

This works for me.

Kaspar

--

<!-- HTML: -->
  <select wicket:id="site">
                <option>site 1</option>
                <option>site 2</option>
  </select>
  <ul>
   <li wicket:id="site2"><wicket:container wicket:id="sitename"/></li>
  </ul>

// Code
    List SITES = Arrays.asList(new String[] {
        "The Server Side", "Java Lobby", "Java.Net"
    });
    form.add(new DropDownChoice("site", SITES));
    form.add(new ListView("site2", SITES)
    {
      @Override
      protected void populateItem(ListItem item)
      {
        item.add(new Label("sitename", item.getModel()));
      }
    });


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

Reply via email to