Fórumok

RE custom fields jsp view

thumbnail
Manikantha Rajamani, módosítva 9 év-val korábban

RE custom fields jsp view

Expert Bejegyzések: 258 Csatlakozás dátuma: 2014.03.25. Legújabb bejegyzések
Hi
Guys

I have added one custom field called home_town in user with text as type
now I needed that field in create_account.jsp.
I did the following
<liferay-ui:custom-attribute
className="<%= User.class.getName() %>"
classPK="<%= 0 %>"
editable="<%= true %>"
label="<%= true %>"
name="Home_town"/>
I also imported following tld
<%@ taglib uri="http://liferay.com/tld/ui" prefix="liferay-ui" %>
but still i'm unable to view that filed in create_account.jsp ones i deploy that hook

any one help for if a did any mistake then let me know

Thanks and regards
Manikantha R
thumbnail
Nagendra Kumar Busam, módosítva 9 év-val korábban

RE: RE custom fields jsp view

Liferay Master Bejegyzések: 678 Csatlakozás dátuma: 2009.07.07. Legújabb bejegyzések
As create account is for guest users (mostly), you need to give Update/View permission for home_town custom field. Hope it works
thumbnail
Manikantha Rajamani, módosítva 9 év-val korábban

RE: RE custom fields jsp view

Expert Bejegyzések: 258 Csatlakozás dátuma: 2014.03.25. Legújabb bejegyzések
Hi
Nagendra Kumar Busam

thank you for u r reply
accourding to u r guidence i have given view and update permission for guest
after that I have used following code in jsp page

<liferay-ui:custom-attribute
className="com.liferay.portal.model.User"
classPK="<%= (selUser != null) ? selUser.getUserId() : 0 %>"
editable="<%= true %>"
label="<%= true %>"
name="home_town"/>

After deploying the hook
i'm getting the empty page for create account with following error in log
it as showing the error in <liferay-ui:custom-attribute
i have attached the file please find the solution for thse


Thanks and regards
Manikantha R
thumbnail
Nagendra Kumar Busam, módosítva 9 év-val korábban

RE: RE custom fields jsp view

Liferay Master Bejegyzések: 678 Csatlakozás dátuma: 2009.07.07. Legújabb bejegyzések
Create account option is for guest user as far as I know (to allow strangers to register w/ portal). There is no selUser variable available in create_account.jsp as far as I know. Can you change it to below & try

<liferay-ui:custom-attribute className="com.liferay.portal.model.User" classPK="0" editable="<%= true %>" label="<%= true %>" name="home_town" />