Dashboard > People > codesmell > 2008 > Mai > 11 > Wicket DropDownIdChoice
  codesmell Log In   View a printable version of the current page.  
  Wicket DropDownIdChoice
Added by Uwe Schaefer, last edited by Uwe Schaefer on Mai 11, 2008
Labels: 

This one is all about id <-> object mapping when using DropDowns:

/**
 * @author igor vaynberg 
 */
public class DropDownIdChoice extends DropDownChoice
{

    public DropDownIdChoice(String id, IModel model, IModel choices, IChoiceRenderer renderer, Class<?> type)
    {
        super(id, model, choices, renderer);
        setType(type);
    }

    @Override
    public String getModelValue()
    {
        final Object id = getModelObject();
        if (id != null)
        {
            return getConverter(getType()).convertToString(id, getLocale());
        }
        else
        {
            return NO_SELECTION_VALUE;
        }
    }
}
Mai 2008
Sun Mon Tue Wed Thu Fri Sat
        1 2 3
4 5 6 7 8 9 10
11 12 13 14 15 16 17
18 19 20 21 22 23 24
25 26 27 28 29 30 31
             

Wicket Breadcrumbs
Wicket ResubmitSafeForm

This site is powered by a free Atlassian Confluence Personal Server License. Evaluate Confluence for your organisation or read more about Confluence licensing here.
Powered by Atlassian Confluence, the Enterprise Wiki. (Version: 2.2.9 Build:#527 Sep 07, 2006) - Bug/feature request - Contact Administrators