Foros de discusión

Get Expando Value

Wild Mr, modificado hace 9 años.

Get Expando Value

New Member Mensajes: 17 Fecha de incorporación: 9/12/13 Mensajes recientes
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, modificado hace 9 años.

RE: Get Expando Value

Regular Member Mensajes: 231 Fecha de incorporación: 23/03/11 Mensajes recientes
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, modificado hace 9 años.

RE: Get Expando Value

New Member Mensajes: 14 Fecha de incorporación: 11/05/13 Mensajes recientes
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