I am trying to write a generic behavior which needs to work for any
DropDownChoice.  I need to retrieve the selected option's display string.
The problem is, much of the time I only store the ID (not the display), so
using getModelObject() and running it through the
DropDownChoice.getChoiceRenderer().getDisplayValue(T) does not work and only
returns null.
i.e. ddc.getChoiceRenderer().getDisplayValue(ddc.getModelObject());

I also cannot guarantee that the ID class's equals and hashcode functions
will be implemented as expected, so this will not work:
i.e. ddc.getChoices().get(ddc.getChoices().indexOf(ddc.getModelObject()));

Is there a method I'm missing which I can call to return the
dropdownchoice's display value of its internal list's selected option?  Any
other ideas?

Reply via email to