//create calendar
List<String> days = DateTime.getDaysListForward(2, 4);
DropDownChoice arrivalChoices = new DropDownChoice("arrivalDate", days)
{
protected String getDefaultChoice(final Object selected)
{
return ""; //get rid of "Choose One" default
}
};
arrivalChoices.setChoiceRenderer(new IChoiceRenderer()
{
public String getDisplayValue(Object object)
{
return object.toString();
}
public String getIdValue(Object object, int index)
{
return object.toString();
}
});
form.add(arrivalChoices);
On 3/30/06,
Igor Vaynberg <
[EMAIL PROTECTED]> wrote:
you are putting getDefaultChoice into the renderer, when it actually belongs in the DropDownChoice
-IgorOn 3/30/06, Vincent Jenks < [EMAIL PROTECTED]> wrote:The code...
//create calendar
List<String> days = DateTime.getDaysListForward(2, 4);
//add quantity select list
form.add(new DropDownChoice("arrivalDate", days, new IChoiceRenderer()
{
protected String getDefaultChoice(final Object selected)
{
return ""; //get rid of "Choose One" default
}
public String getDisplayValue(Object object)
{
return object.toString();
}
public String getIdValue(Object object, int index)
{
return object.toString ();
}
}));
When rendered...I still get the "Choose One" option first. Did I lose too much sleep last night...what did I miss?