Ask Questions and Find Answers
Important:
Ask is now read-only. You can review any existing questions and answers, but not add anything new.
But - don't panic! While ask is no more, we've replaced it with discuss - the new Liferay Discussion Forum! Read more here here or just visit the site here:
discuss.liferay.com
RE: Custom Fields in User & Organization Edit Forms
Hi !
I m working on a full OSGI liferay using service builder. I need to add customs fields in organization and user edit pages. I found on this forum that hook is not possible with service builder. The problem is that i need to add a dropdown list populated with all users, in the Organization Edit Form. I have no idea how to populate my dropdown list, is there a way to use hook in Liferay 7.1 and service Builder ? Is there a way to populate it directly from the service builder ? Is there a way to had a new type of custom filed ?
I m working on a full OSGI liferay using service builder. I need to add customs fields in organization and user edit pages. I found on this forum that hook is not possible with service builder. The problem is that i need to add a dropdown list populated with all users, in the Organization Edit Form. I have no idea how to populate my dropdown list, is there a way to use hook in Liferay 7.1 and service Builder ? Is there a way to populate it directly from the service builder ? Is there a way to had a new type of custom filed ?
We usually populate those fields through rest services.
It is pretty simple. You create a new rest module with the functions you need (e.g. /getUsers). Then you add javascript code to populate the dropdown with the data from the rest module.
It is pretty simple. You create a new rest module with the functions you need (e.g. /getUsers). Then you add javascript code to populate the dropdown with the data from the rest module.
Thanks for you answer, but the problems is still the same, where do I put the javascript code ?
You would need to use a fragment to change the relevant jsp/jsps. It works similar to hooks.
https://dev.liferay.com/de/develop/tutorials/-/knowledge_base/7-0/overriding-a-modules-jsps
https://dev.liferay.com/de/develop/tutorials/-/knowledge_base/7-0/overriding-a-modules-jsps
I see, i was not sure about the fragment because it can make things unstable when the host module is upgraded. I will try this thank you !