留言板

Get Expando Value

Wild Mr,修改在9 年前。

Get Expando Value

New Member 帖子: 17 加入日期: 13-12-9 最近的帖子
Hi,

I would like to get some help form everybody about how to get expando value.
I created custom field for User called "Country" as Drop Down list type. But when I use u.getExpandoBridge().getAttribute("Country") to get value, it returns a list of country that I inputted for Country fields Drop List.

Please give me some hint to get selected Country of user.

Thanks,
venka reddy,修改在9 年前。

RE: Get Expando Value

Regular Member 帖子: 231 加入日期: 11-3-23 最近的帖子
hi,

I have tried with the following code it works

String user = null;
long companyId = themeDisplay.getCompanyId();
long userClassNameId = ClassNameLocalServiceUtil.getClassNameId(User.class.getName());
ExpandoTable table = ExpandoTableLocalServiceUtil.getDefaultTable(companyId, userClassNameId);
ExpandoColumn column = ExpandoColumnLocalServiceUtil.getColumn(table.getTableId(), "country");
ExpandoValue expdValue = ExpandoValueLocalServiceUtil.getValue(table.getTableId(), column.getColumnId(), userId);
if(expdValue!=null && expdValue.getStringArray() != null && expdValue.getStringArray().length > 0){
user = expdValue.getStringArray()[0];
}
kailash behara,修改在9 年前。

RE: Get Expando Value

New Member 帖子: 14 加入日期: 13-5-11 最近的帖子
Hi Wild Mr,

hope it will be helpful for you to more understand..


http://www.liferay.com/community/wiki/-/wiki/Main/Expando

http://www.liferay.com/community/wiki/-/wiki/Main/developing+with+Expando

http://www.liferay.com/community/forums/-/message_boards/message/960946


Thanks,
Kailash