put the localized values into the choices:


Even better, put the above inside a ReadOnlyModel's getObject().

Have fun

⁣Gesendet mit Blue ​

Am 25. Jan. 2018, 07:50, um 07:50, extraquoo <extraq...@gmail.com> schrieb:
>I am adding a FormComponent DropDownChoice to display a dropdown list
>the page like below
>To support the i18n, I  add the key to a list of choices and override
>localizeDisplayValues, the code is below
>private FormComponent<?> getQuestion8Select(String fieldName,
>                       IModel<?> parent) {
>               List<String> selectionDescription = new ArrayList<String>();
>               selectionDescription.add("forms.cf37.question8.oneTime");
> selectionDescription.add("forms.cf37.question8.otherSourcemonthly");
>                       DropDownChoice<String> selector = new
>                               private static final long serialVersionUID = 1L;
>                                       @Override
>                                       protected boolean 
> localizeDisplayValues() {
>                                       return true;
>                                         }
>                                       };
>                                return selector;
>                               }
>the key forms.cf37.question8.oneTime and
>forms.cf37.question8.otherSourcemonthly has different values in
>corresponding XML files.
>  xxxx.xml
><entry key="forms.cf37.question8.oneTimeOrMonthly">One time or ongoing
><entry key="forms.cf37.question8.oneTime">One time payment</entry>
><entry key="forms.cf37.question8.oneTimeOrMonthly">Pago de solo una vez
>pago mensual:</entry>
><entry key="forms.cf37.question8.oneTime">Pago de solo una vez</entry>
>When I switch the locale to Spanish, the verbiage changes well on the
>However, the choices object carries the key instead of the value in the
>Is there anything I miss to code for the DropDownChoice?  The choices
>to carry the exact values.
>Sent from:
>To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
>For additional commands, e-mail: users-h...@wicket.apache.org

Reply via email to