Open GoogleCodeExporter opened 9 years ago
Workaround info From Andrew:
Thanks Mitch, noted.
For anyone else bumping into this, the workaround I've used is to make use of
pulldata() to get the value from the same file as the search():
calculate sel_field selected-at(${catch_specie},position(..)-1)
calculate sel_label
pulldata('Species_Wcoast','name_Eng','name_key',${sel_field})
A further workaround is needed if you are dealing with multiple languages:
1) First you need to determine the language in use by the form. This is not
accessible within a variable, so you need to calculate it.
For this you look at the selected value of a multichoice question (select_one
or select_multiple) which does NOT load its options from a csv file, so that
you can still use jr:choice-name() .This can be used to test which language
label was displayed for the choice.
In my case I used a yes/no question - in English the labels are "Yes" and "No",
in Afrikaans "Ja" and "Nee". So if "Yes" or "No" was selected, then I know the
form is being displayed in English, and I must pulldata() from the English
label column
calculate yesno_label jr:choice-name(selected-at(${permit},0),
'${permit}')
calculate form_language if(${yesno_label}='Yes' or ${yesno_label}='No'
,'English','Afrikaans')
2) Second, you use the same pull_data as above, but select the correct language
label column depending on the calculated language:
calculate sel_field selected-at(${catch_specie},position(..)-1)
calculate sel_label if(${form_language}='English',
pulldata('Species_Wcoast','name_Eng','name_key',${sel_field}),
pulldata('Species_Wcoast','name_Afr','name_key',${sel_field}))
Hope that helps someone else!
Regards,
Andrew
Original comment by mitchellsundt@gmail.com
on 30 Jun 2015 at 4:53
Original issue reported on code.google.com by
mitchellsundt@gmail.com
on 29 Jun 2015 at 7:33Attachments: