Foren
RE: JSF, Primefaces and PortletPreferences - UnsupportedOperationException
Fabian Bouché, geändert vor 7 Jahren.
RE: JSF, Primefaces and PortletPreferences - UnsupportedOperationException
New Member Beiträge: 12 Beitrittsdatum: 08.04.16 Neueste BeiträgeKyle Stiemann:
Split from this thread: https://web.liferay.com/community/forums/-/message_boards/message/72478640
Indeed. If adapted this example with Liferay Faces Alloy.
As alloy:commandButton has ajax="true" set by default, it is important to reverse it.
See my example:
<alloy:form>
<alloy:outputlabel for="foo-config" value="Foo-config" />
<alloy:inputtext id="foo-config" value="#{mutablePortletPreferencesValues['foo-config'].value}" />
<hr>
<!-- ajax="false" is necessary in order to properly switch the portlet to the view mode -->
<alloy:commandbutton ajax="false" action="#{portletPreferencesBackingBean.submit}">
<alloy:outputtext value="Submit" />
</alloy:commandbutton>
<!-- ajax="false" is necessary in order to properly switch the portlet to the view mode -->
<alloy:commandbutton ajax="false" action="#{portletPreferencesBackingBean.reset}">
<alloy:outputtext value="Reset" />
</alloy:commandbutton>
</alloy:form>
I also made sure to specifically log the ClassCastException inside of the PortletPreferencesBackingBean to remind whoever will update the config page of this very important information.
Kyle Joseph Stiemann, geändert vor 7 Jahren.
RE: JSF, Primefaces and PortletPreferences - UnsupportedOperationException
Liferay Master Beiträge: 760 Beitrittsdatum: 14.01.13 Neueste Beiträge
Thanks for posting your working code Fabian! Hopefully this will help other Liferay Faces users who want to use portlet preferences.
- Kyle
- Kyle