there is no "default" value. the value selected in the dropdown will be the one that is set in the model that the drop down uses. so when you submit, the selected object is pushed into the model, when dropdown renders the selected object is the one that is pulled from the model.

ie:

public Page extends WebPage {
   private List letters=Arrays.asList(new String[] { "A", "B", "C" }));


   public String selected="B";
  


  public Page() {
     Form form=new Form("form");
     DropDownChoice choice=new DropDownChoice("ddc", new PropertyModel(this, "selected", letters);
}

when this page renders, the letter B will be selected because it is the object inside the drop down's model.


-Igor


On 4/4/06, Stefan Lindner <[EMAIL PROTECTED]> wrote:
-igor writes

"initialize the drop down choice' model to the default value when you
first render the page."

Does that really mean, that I can't create a subclass of DropDownChoice
that konws of it's default value by itself? Only when the page gets
rendered I have to add code for the default value? How about a panel
with a standard component that should be reused at several pages?


-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmdlnk&kid0944&bid$1720&dat1642
_______________________________________________
Wicket-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/wicket-user

Reply via email to