掲示板

RE custom fields jsp view

thumbnail
9年前 に Manikantha Rajamani によって更新されました。

RE custom fields jsp view

Expert 投稿: 258 参加年月日: 14/03/25 最新の投稿
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
9年前 に Nagendra Kumar Busam によって更新されました。

RE: RE custom fields jsp view

Liferay Master 投稿: 678 参加年月日: 09/07/07 最新の投稿
As create account is for guest users (mostly), you need to give Update/View permission for home_town custom field. Hope it works
thumbnail
9年前 に Manikantha Rajamani によって更新されました。

RE: RE custom fields jsp view

Expert 投稿: 258 参加年月日: 14/03/25 最新の投稿
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
9年前 に Nagendra Kumar Busam によって更新されました。

RE: RE custom fields jsp view

Liferay Master 投稿: 678 参加年月日: 09/07/07 最新の投稿
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" />