留言板

How to Use Expando for extra field ??

piyush liferay,修改在11 年前。

How to Use Expando for extra field ??

Junior Member 帖子: 40 加入日期: 13-1-2 最近的帖子
how to use expando for inserting extra field which are not present in Liferay User class....
thumbnail
Juhi Kumari,修改在11 年前。

RE: How to Use Expando for extra field ??

Expert 帖子: 347 加入日期: 11-12-12 最近的帖子
Hi,

Check this link
and this wiki.

Regards
Juhi
piyush liferay,修改在11 年前。

RE: How to Use Expando for extra field ??

Junior Member 帖子: 40 加入日期: 13-1-2 最近的帖子
Juhi Kumari:
Hi,

Check this link
and this wiki.

Regards
Juhi


below code is right or not ??

i am adding a custom field mobileno and it's value is 1234567890

ExpandoValue expandoValue=ExpandoValueLocalServiceUtil.createExpandoValue(CounterLocalServiceUtil.increment());

expandoValue.getExpandoBridge().addAttribute("mobileNo");

expandoValue.getExpandoBridge().setAttribute("mobileNo","1234567890");
thumbnail
Jitendra Rajput,修改在11 年前。

RE: How to Use Expando for extra field ??

Liferay Master 帖子: 875 加入日期: 11-1-7 最近的帖子
ExpandoBridge userExpandoBridge = user.getExpandoBridge();

if (!userExpandoBridge.hasAttribute("mobile-no"))
{
userExpandoBridge.addAttribute("mobile-no", 11, Long.valueOf(-1L), false);
}

userExpandoBridge.setAttribute("mobile-no", Long.valueOf(12345), false);
Siby Mathew,修改在11 年前。

RE: How to Use Expando for extra field ??

Expert 帖子: 268 加入日期: 11-3-4 最近的帖子
Hi Piyush,
If you need to add custom attributes for the user, do :
userObj.getExpandoBridge().addAttribute()


Thanks,
Siby