Forums

Home » Liferay Portal » English » 3. Development

Combination View Flat View Tree View
Threads [ Previous | Next ]
toggle
Hitoshi Ozawa
Adding new fields to User Information
December 13, 2010 1:41 AM
Answer

Hitoshi Ozawa

Rank: New Member

Posts: 3

Join Date: April 1, 2010

Recent Posts

I want to add new user information fields on the User Information page. Liferay6 has a new feature to add custom fields but the fields are added to there own page.
It is better to still use this feature and just change jsp so the fields will appear in the proper page or should I just add new fields as it was done in Liferay 5.
Saranya Sethurajan
RE: Adding new fields to User Information
December 13, 2010 3:25 AM
Answer

Saranya Sethurajan

Rank: Junior Member

Posts: 57

Join Date: October 7, 2009

Recent Posts

Yes you can go for Liferay6 new feature to add your custom field for User resource. Its simple.

-
Saranya.
Apoorva Prakash
RE: Adding new fields to User Information
December 14, 2010 2:21 AM
Answer

Apoorva Prakash

Rank: Liferay Master

Posts: 659

Join Date: June 15, 2010

Recent Posts

Hello Ozawa,
The thing you are talking about Liferay v5.x was Custom attributes, which is having new form in Liferay v6.x
If you are using Liferay v6.X, then there is no need to use the old features...

Thanks and Regards...
Hitoshi Ozawa
RE: Adding new fields to User Information
December 14, 2010 5:08 AM
Answer

Hitoshi Ozawa

Rank: Liferay Legend

Posts: 7949

Join Date: March 23, 2010

Recent Posts

Sorry that I didn't make myself clear. By old way, I meant adding new fields to the model, adding fields to access Hibernate and just adding a fields in jsp.

I really want to change the model but it seems easier to create a custom fields to a page. I was wondering if there is some kind of trade-off such as not being able to use the new field in another page.
Apoorva Prakash
RE: Adding new fields to User Information
December 14, 2010 8:21 AM
Answer

Apoorva Prakash

Rank: Liferay Master

Posts: 659

Join Date: June 15, 2010

Recent Posts

Hello again Ozawa,
Firstly make one thing clear that custom attributes are not only for JSP but can also be used in Action class...

Adding Custom Attribute
1Control panel >> User >> Custom Attribute >> Add Custom Attribute


Accessing programatically
1ThemeDisplay td = (ThemeDisplay) req.getAttribute(Web.Keys.THEME_DISPALY);
2User u=td.getUser();
3String s=u.getExpendoBrodge().getAttribute("AttributeName");


Showing at JSP
1<liferay-ui:custom-attribute-list
2className="com.liferay.portal.model.user"
3classPK=<%=01%>"
4editable="<%=true%>"
5label="<%=true%>" />


but this will not be visible due to permission, so login as administrator and give permission of view and update to user...


Secondly, for modifying models to use through hibernate, you have to make entry in service.xml, and build it again.

Thirdly and lastly, for v6, please refer this link...

Hope this will help...

Thanks and Regards...