掲示板

Expando Concept

thumbnail
12年前 に Puneet Upadhyay によって更新されました。

Expando Concept

Regular Member 投稿: 234 参加年月日: 11/10/22 最新の投稿
Hi All,

Please let me know that how i can use expando concept in liferay.

Please mention the steps..... and one example.
thumbnail
12年前 に David H Nebinger によって更新されました。

RE: Expando Concept

Liferay Legend 投稿: 14916 参加年月日: 06/09/02 最新の投稿
Create a custom field in the control panel. You can specify it's type, default value, visibility, permissions, etc.

The custom field will be available in that portion of the control panel it belongs to (i.e. if you create a User custom field, it is available in the custom fields page of user details).

Programmatically you can access this value through a number of different ways - directly via the API, but also as getter methods on the object type the custom field belongs. So your User custom field can be accessed by calling userInstance.getExpandoBridge().getAttribute("my custom field name") and casting the result to your expected type. You can also set the value in a similar manner.

QED.
thumbnail
12年前 に Jitendra Rajput によって更新されました。

RE: Expando Concept

Liferay Master 投稿: 875 参加年月日: 11/01/07 最新の投稿
you can get custom attribute through this way



expandoBridge = user.getExpandoBridge();

 String attributeValue = (String) expandoBridge.getAttribute("Custom_Attr_name");