Fórum
Custom editor for custom DDM fields
Patrik Holecka, modificado 9 Anos atrás.
Custom editor for custom DDM fields
Junior Member Postagens: 46 Data de Entrada: 21/10/13 Postagens Recentes
Hi all,
I am trying to develope custom field. This field should users allow to select some values which are stored in DB or can be accessed through liferay service API. I followed this little tutorial
but it only shows how to add new custom field which works fine.
Can anybody give me any hint how to create custom editor (select box) with options loaded from DB using liferay services API?
I tried to modify file
but nothing happend.
I am using LR 6.2 EE
Thanks,
Patrik
I am trying to develope custom field. This field should users allow to select some values which are stored in DB or can be accessed through liferay service API. I followed this little tutorial
https://www.liferay.com/community/wiki/-/wiki/Main/Dynamic+Data+Mapping+-+Field+Types+Customization
but it only shows how to add new custom field which works fine.
Can anybody give me any hint how to create custom editor (select box) with options loaded from DB using liferay services API?
I tried to modify file
/html/portlet/dynamic_data_lists/js/main.js
but nothing happend.
I am using LR 6.2 EE
Thanks,
Patrik
Oussama AMARA, modificado 8 Anos atrás.
RE: Custom editor for custom DDM fields
New Member Postagens: 2 Data de Entrada: 28/05/15 Postagens Recentes
Hi Patrik,
I'm trying to do the same thing as you described in your question, I successfully created a new type which is a dropdownlist field, but in the web content form, my field is a simple text field.
Have you found out how to customize the editor in the web form content?
Thanks,
I'm trying to do the same thing as you described in your question, I successfully created a new type which is a dropdownlist field, but in the web content form, my field is a simple text field.
Have you found out how to customize the editor in the web form content?
Thanks,
Patrik Holecka, modificado 8 Anos atrás.
RE: Custom editor for custom DDM fields
Junior Member Postagens: 46 Data de Entrada: 21/10/13 Postagens Recentes
Hi Oussama.
Yes I found the way how to create editor for your newly created custom field. The tutorial I mentioned above only let's you to create new custom field in structure creation form but does nothing with editor in web content creation form.
Now you have to create ext plugin where you have to add template for your own custom field. This template must be in folder "/com/liferay/portlet/dynamicdatamapping/dependencies/ddm" in your ext plugin template module. If your new custom field's name is for example "ddm-db-select" then you have to place in that folder file with name "db-select.ftl". Note that there is no prefix "ddm-". As example for your new template you can search for templates in portal-impl.jar on the same path as I mentioned.
Yes I found the way how to create editor for your newly created custom field. The tutorial I mentioned above only let's you to create new custom field in structure creation form but does nothing with editor in web content creation form.
Now you have to create ext plugin where you have to add template for your own custom field. This template must be in folder "/com/liferay/portlet/dynamicdatamapping/dependencies/ddm" in your ext plugin template module. If your new custom field's name is for example "ddm-db-select" then you have to place in that folder file with name "db-select.ftl". Note that there is no prefix "ddm-". As example for your new template you can search for templates in portal-impl.jar on the same path as I mentioned.
Vishal Kumar, modificado 8 Anos atrás.
RE: Custom editor for custom DDM fields
Regular Member Postagens: 198 Data de Entrada: 12/12/12 Postagens Recentes
So you got the solution?
Oussama AMARA, modificado 8 Anos atrás.
RE: Custom editor for custom DDM fields
New Member Postagens: 2 Data de Entrada: 28/05/15 Postagens Recentes
Thank you Patrick, this was very helpful for me.