Foros de discusión
RE: JSF, Primefaces and PortletPreferences - UnsupportedOperationException
Fabian Bouché, modificado hace 7 años.
RE: JSF, Primefaces and PortletPreferences - UnsupportedOperationException
New Member Mensajes: 12 Fecha de incorporación: 8/04/16 Mensajes recientesKyle 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, modificado hace 7 años.
RE: JSF, Primefaces and PortletPreferences - UnsupportedOperationException
Liferay Master Mensajes: 760 Fecha de incorporación: 14/01/13 Mensajes recientes
Thanks for posting your working code Fabian! Hopefully this will help other Liferay Faces users who want to use portlet preferences.
- Kyle
- Kyle