Customizing liferay hook custom fields

帅比萌擦擦* 提交于 2019-12-24 12:27:43

问题


I need to add a Custom Field to Site create page, i went to Portal > Custom Fields > Site and added a custom field named "licence".

I followed this tutorial http://www.liferay.com/pt/community/wiki/-/wiki/Main/Custom+Fields+and+JSP+Hooks

I'm trying to access this field in details.jsp page. It's located at of tomcat-7.0.27\webapps\ROOT\html\portlet\sites_admin\site i tryed to do this:

<liferay-ui:custom-attribute
        label="Licence"
        className="<%= Site.class.getName() %>"
        classPK="<%= 0 %>"
        editable="<%= true %>"
        name="licence"
    />

but it's wrong. How can I access the Site custom field that i added??

Thanks!!

Update I solved like this

    <liferay-ui:custom-attribute        
    className="<%= Group.class.getName() %>"
    classPK="<%= (liveGroup != null) ? liveGroup.getGroupId() : 0 %>"
    editable="<%= true %>"
    label="<%= true %>"
    name="tipo-licenca"
/>

来源:https://stackoverflow.com/questions/18168713/customizing-liferay-hook-custom-fields

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!