RE: JSF portlet with custom configurations

thumbnail
Kapitan Spaulding, modified 5 Years ago. New Member Posts: 8 Join Date: 12/3/19 Recent Posts
Hello, I am looking for simple  sample JSF portlet with custom configurations for liferay 7.2
Regards, KS
thumbnail
Neil Griffin, modified 5 Years ago. Liferay Legend Posts: 2655 Join Date: 7/27/05 Recent Posts
Moved to the Liferay Faces category
thumbnail
Neil Griffin, modified 5 Years ago. Liferay Legend Posts: 2655 Join Date: 7/27/05 Recent Posts
Hi Kapitan,

When you get an opportunity, please provide details about what you mean by "custom configurations" -- does that mean samples/demos in general? Or do you mean usage of portlet preferences? Usage of the Liferay "configuration" (cog icon) for individual portlet configuration?


We have many different JSF portlet demos available. The source for the latest versions for Liferay 7.2 can be found here:


- https://github.com/liferay/liferay-faces-bridge-impl/tree/4.1.4/demo

- https://github.com/liferay/liferay-faces-portal/tree/3.0.5/demo


You can download released versions (binary WAR artifacts) from Maven Central:


- https://search.maven.org/search?q=com.liferay.faces.demo


Kind Regards,


Neil
ghadeer raad, modified 5 Years ago. Junior Member Posts: 51 Join Date: 6/2/20 Recent Posts
can i use code for auto refresh in liferay 7.2 ce portal
thumbnail
Kapitan Spaulding, modified 5 Years ago. New Member Posts: 8 Join Date: 12/3/19 Recent Posts
Hi, I need to get "id listy" value from jsf portlet (custom configurations show in attachment) to java beans. 
Best Regards,
KS
thumbnail
Neil Griffin, modified 5 Years ago. Liferay Legend Posts: 2655 Join Date: 7/27/05 Recent Posts
The normal way to use the Liferay "Configuration" feature is to create a class that implements the ConfigurationAction interface. Also, the FQCN of the class must be registered in the portlet WAR WEB-INF/liferay-portlet.xml with the configuration-action-class element. The lifecycle of your ConfigurationAction implementation takes place outside of the JSF lifecycle, so there would be no way for your JSF managed bean to participate in the lifecycle.

However, there might be a way. I recommend that you try registering GenericLiferayFacesPortlet instead of GenericFacesPortlet in your portlet.xml descriptor. I haven't tried that in a long time, but it might be that, according to line #41 in the GenericLiferayFacesPortlet.doDispatch() method, that it will detect the "Config" custom Liferay Portlet Mode and call GenericFacesPortlet.doView(), which will cause your JSF view to be rendered.
If you have time, please give that a try and let me know if it works. Thanks.