Foren

Is it possible to populate Country list on liferay-ui:custom-attribute

Viththal Joshi, geändert vor 6 Jahren.

Is it possible to populate Country list on liferay-ui:custom-attribute

New Member Beiträge: 6 Beitrittsdatum: 28.08.13 Neueste Beiträge
I want to add Country dropdown in the registration form and that has to populate the values from country table. Can I achieve this with custom field? if yes, any help would be appreciated

Thanks
thumbnail
Andrew Jardine, geändert vor 6 Jahren.

RE: Is it possible to populate Country list on liferay-ui:custom-attribute

Liferay Legend Beiträge: 2416 Beitrittsdatum: 22.12.10 Neueste Beiträge
Hi Viththal,

First question would be which version of Liferay are you using? That will likely affect the best solution to your problem.
Viththal Joshi, geändert vor 6 Jahren.

RE: Is it possible to populate Country list on liferay-ui:custom-attribute

New Member Beiträge: 6 Beitrittsdatum: 28.08.13 Neueste Beiträge
Thanks for the response Andrew Jardine, I am using Liferay 6.1.2 CE
thumbnail
Andrew Jardine, geändert vor 6 Jahren.

RE: Is it possible to populate Country list on liferay-ui:custom-attribute

Liferay Legend Beiträge: 2416 Beitrittsdatum: 22.12.10 Neueste Beiträge
Hi Viththal,

From my perspective, using the custom attributes tag here feels a bit like shoving a square peg into a round hole. I think I would opt for a JSP hook that uses the CountryLocalService to get the values you need and then in a JSTL foreach loop add your <aui:option/> values inside an <aui:select/>.

Alternatively, I suppose you could define your own taglib, but if you did that I would probably try to do something more generic where yo ucan pass in a Map with the data the you want bound to the list. In fact, I'll bet such a taglib already exists out there that you can use. The quickest solution though I think would be the one I outlines above.
Viththal Joshi, geändert vor 6 Jahren.

RE: Is it possible to populate Country list on liferay-ui:custom-attribute

New Member Beiträge: 6 Beitrittsdatum: 28.08.13 Neueste Beiträge
Yes, You are right Andrew.
Thanks