掲示板

RE: JSF, Primefaces and PortletPreferences - UnsupportedOperationException

thumbnail
7年前 に Fabian Bouché によって更新されました。

RE: JSF, Primefaces and PortletPreferences - UnsupportedOperationException

New Member 投稿: 12 参加年月日: 16/04/08 最新の投稿
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
7年前 に Kyle Joseph Stiemann によって更新されました。

RE: JSF, Primefaces and PortletPreferences - UnsupportedOperationException

Liferay Master 投稿: 760 参加年月日: 13/01/14 最新の投稿
Thanks for posting your working code Fabian! Hopefully this will help other Liferay Faces users who want to use portlet preferences.

- Kyle