Forums

Home » Liferay Portal » English » 3. Development

Combination View Flat View Tree View
Threads [ Previous | Next ]
toggle
venka reddy
Re:Custom Fields
June 8, 2012 1:59 AM
Answer

venka reddy

Rank: Regular Member

Posts: 231

Join Date: March 23, 2011

Recent Posts

Hi,
How Can we define custom fields for plugin?

Is it possible?
Jignesh Vachhani
RE: Re:Custom Fields
June 8, 2012 3:19 AM
Answer

Jignesh Vachhani

Rank: Liferay Master

Posts: 785

Join Date: March 10, 2008

Recent Posts

Provide some more details.
David H Nebinger
RE: Re:Custom Fields
June 8, 2012 5:38 AM
Answer

David H Nebinger

Community Moderator

Rank: Liferay Legend

Posts: 11046

Join Date: September 1, 2006

Recent Posts

venka reddy:
Hi,
How Can we define custom fields for plugin?

Is it possible?


Yes, not a problem. There's a couple of ways you can do it. You could use a Spring InitializingBean's afterPropertiesSet() to poll the Expando services to see if the custom field has already been defined and create it if not, you can use a delayed tactic (i.e. use a LoginPostAction to check when a user logs in or just wait until the point in your code that the expando column is referenced, etc.).

The Expando API is pretty easy to follow, and I think there's even a wiki page on them...
venka reddy
RE: Re:Custom Fields
June 10, 2012 10:05 PM
Answer

venka reddy

Rank: Regular Member

Posts: 231

Join Date: March 23, 2011

Recent Posts

Hi Jignesh Vachhani,

We can define Custom Fields for Blogs Entry , Wiki Page,User,Organization & etc at controlpanel ,

Same as how can we define custom field for Plugin portlet?
David H Nebinger
RE: Re:Custom Fields
June 8, 2012 8:12 AM
Answer

David H Nebinger

Community Moderator

Rank: Liferay Legend

Posts: 11046

Join Date: September 1, 2006

Recent Posts

Custom fields are for pojos mapped to database entities, not for portlets.

The objects you've highlighted are for actual SB objects. They just happen to have the same name as their portlet counterparts.