留言板

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

Viththal Joshi,修改在6 年前。

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

New Member 帖子: 6 加入日期: 13-8-28 最近的帖子
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,修改在6 年前。

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

Liferay Legend 帖子: 2416 加入日期: 10-12-22 最近的帖子
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,修改在6 年前。

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

New Member 帖子: 6 加入日期: 13-8-28 最近的帖子
Thanks for the response Andrew Jardine, I am using Liferay 6.1.2 CE
thumbnail
Andrew Jardine,修改在6 年前。

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

Liferay Legend 帖子: 2416 加入日期: 10-12-22 最近的帖子
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,修改在6 年前。

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

New Member 帖子: 6 加入日期: 13-8-28 最近的帖子
Yes, You are right Andrew.
Thanks