Forums de discussion

RE: JSF, Primefaces and PortletPreferences - UnsupportedOperationException

thumbnail
Fabian Bouché, modifié il y a 7 années.

RE: JSF, Primefaces and PortletPreferences - UnsupportedOperationException

New Member Publications: 12 Date d'inscription: 08/04/16 Publications récentes
Kyle 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. emoticon
thumbnail
Kyle Joseph Stiemann, modifié il y a 7 années.

RE: JSF, Primefaces and PortletPreferences - UnsupportedOperationException

Liferay Master Publications: 760 Date d'inscription: 14/01/13 Publications récentes
Thanks for posting your working code Fabian! Hopefully this will help other Liferay Faces users who want to use portlet preferences.

- Kyle