Re: the choices is key instead of value when using DropDownChoice component

2018-01-29 Thread extraquoo
Hi ,just ignore my last reply. I should not override localizeDisplayValues to return true so as not to execute display = getLocalizer().getString(displayValue, this, displayValue);. your code is really helpful. Thank you very much indeed. -- Sent from: http://apache-wicket.1842946.n4.nabble.com

Re: the choices is key instead of value when using DropDownChoice component

2018-01-29 Thread extraquoo
yes, it is hard to explain the issue. the situation is if I put the key in the choices, then the i18n works fine for the front page ( when I click the locale change button ,the option got translated correctly), however ,since the key is in the choices, in pdf, it prints the verbiage key "forms.cf3

Re: the choices is key instead of value when using DropDownChoice component

2018-01-29 Thread Sven Meier
You wrote: "However, the choices object carries the key instead of the value in the backend." What do you want written into your object? The key, e.g. "forms.cf37.question8.oneTimeOrMonthly"? Then your first solution should work. If you want the value in your object's property, e.g. "One tim

Re: the choices is key instead of value when using DropDownChoice component

2018-01-29 Thread extraquoo
thanks for replying. Looks like it still put the value in the choices object. Maybe I am describing the issue incorrectly. so if put value in the choices object , construct the DropDownChoice and override localizeDisplayValues DropDownChoice selector = new DropDownChoice(fieldName, choices){

Re: the choices is key instead of value when using DropDownChoice component

2018-01-26 Thread Sven Meier
IModel> choices = new AbstractReadOnlyModel> {     public List getObject() {     List selectionDescription = new ArrayList(); selectionDescription.add(getString("forms.cf37.question8.oneTime")); selectionDescription.add(getString("forms.cf37.question8.otherSourcemonthly"));     return s

Re: the choices is key instead of value when using DropDownChoice component

2018-01-25 Thread extraquoo
Hi, I try to use GetString / StringResourceModel and put the key selectionDescription.add(new StringResourceModel("forms.cf37.question8.oneTime",this,parent).getObject()); or selectionDescription.add(getString("forms.cf37.question8.oneTime")); Both of them will return the values from xml however

Re: the choices is key instead of value when using DropDownChoice component

2018-01-24 Thread Sven Meier
Hi, put the localized values into the choices: selectionDescription.add(getString("forms.cf37.question8.oneTime")); Even better, put the above inside a ReadOnlyModel's getObject(). Have fun Sven ⁣Gesendet mit Blue ​ Am 25. Jan. 2018, 07:50, um 07:50, extraquoo schrieb: >Hi >I am adding a Fo

the choices is key instead of value when using DropDownChoice component

2018-01-24 Thread extraquoo
Hi I am adding a FormComponent DropDownChoice to display a dropdown list on the page like below To support the i18n, I add the key to a list of choices and override the localizeDisplayValues, the code is below private