Ask Questions and Find Answers
Important:
Ask is now read-only. You can review any existing questions and answers, but not add anything new.
But - don't panic! While ask is no more, we've replaced it with discuss - the new Liferay Discussion Forum! Read more here here or just visit the site here:
discuss.liferay.com
RE: Is it possible to populate the fields of a Form before presenting it to the
An example: I would like to create a form with Multiple Selection elements.
Each Option must contain a value produced by a backend service that produces a list of values.
Thank you in advance for any clarification.
Hi Ivano, you can populate a Select from List field in the Forms application with a REST Data Provider. By default the Select from List field allows only one selection, but you can go into its Advanced properties and set it to allow multiple selections. This is what it looks like:
If you need to write your own data provider, see the developer documentation.
Hi Russel, thank you very much. Your comment was very clear and helpful.
Do you think it is possible to populate other types of fields (text, numeric, etc.) with values produced by REST Data Provider?
It should be possible. The Select form List field is the only one with the native configuration to populate from a data provider, but you should be able to use the Autofill Rule to populate a text or numeric field.
For example, use a country data provider, I should be able to configure an input (like, have the User enter their country) and then autofill a text field with the region (e.g., Europe). I tried this just now and couldn't get it to work though. I'll ask the team if there's a bug and get back to you.
Ivano, after discussing with the team I filed this bug ticket: LPS-152074. It contains steps that should work to autofill a text field with a data provider. Ovciously since it's a bug ticket the steps are not currently working, so let's hope the team can pick up this ticket soon.
Hi Russell,
Thank you very much for your support on this.
Ivano
Powered by Liferay™