Foren
Customization on announcement in liferay 6.1
Kiran Kumar Boyini, geändert vor 7 Jahren.
Customization on announcement in liferay 6.1
Expert Beiträge: 287 Beitrittsdatum: 02.06.11 Neueste Beiträge
Hi All,
we are using the liferay announcement in our application and we have customized the announcement creation page with hook .
Now I want to add 2 more field in announcement page and when ever I am going to save , I want to save that extra field in announcement table.
Is there any best way to do this in liferay.
Let say extra fields are : Region and Site to announcement table
In creation page when the user clicking on save button, we are using the below code
function <portlet:namespace />saveEntry() {
document.<portlet:namespace />fm.action = '<portlet:actionURL><portlet:param name="struts_action" value="/announcements/edit_entry" /></portlet:actionURL>';
document.<portlet:namespace />fm.target = '';
document.<portlet:namespace />fm.<portlet:namespace /><%= Constants.CMD %>.value = "<%= (entry == null) ? Constants.ADD : Constants.UPDATE %>";
document.<portlet:namespace />fm.<portlet:namespace />content.value = <portlet:namespace />getContent();
submitForm(document.<portlet:namespace />fm);
}
Please suggest me best and simple way how can I achieve this requirement.
Regards,
Kiran.
we are using the liferay announcement in our application and we have customized the announcement creation page with hook .
Now I want to add 2 more field in announcement page and when ever I am going to save , I want to save that extra field in announcement table.
Is there any best way to do this in liferay.
Let say extra fields are : Region and Site to announcement table
In creation page when the user clicking on save button, we are using the below code
function <portlet:namespace />saveEntry() {
document.<portlet:namespace />fm.action = '<portlet:actionURL><portlet:param name="struts_action" value="/announcements/edit_entry" /></portlet:actionURL>';
document.<portlet:namespace />fm.target = '';
document.<portlet:namespace />fm.<portlet:namespace /><%= Constants.CMD %>.value = "<%= (entry == null) ? Constants.ADD : Constants.UPDATE %>";
document.<portlet:namespace />fm.<portlet:namespace />content.value = <portlet:namespace />getContent();
submitForm(document.<portlet:namespace />fm);
}
Please suggest me best and simple way how can I achieve this requirement.
Regards,
Kiran.
Samuel Kong, geändert vor 7 Jahren.
RE: Customization on announcement in liferay 6.1
Liferay Legend Beiträge: 1902 Beitrittsdatum: 10.03.08 Neueste Beiträge
Do not try to modify the portal's database tables (including the announcement table). Instead, you should add your extra fields and the announcementId in a new table.
Arunjyoti Banik, geändert vor 7 Jahren.
RE: Customization on announcement in liferay 6.1
Junior Member Beiträge: 74 Beitrittsdatum: 26.08.14 Neueste Beiträge
Yes. Absolutely. Go for custom table or expandos.