Combination View Flat View Tree View
Threads [ Previous | Next ]
toggle
Fabian Bouché
RE: JSF, Primefaces and PortletPreferences - UnsupportedOperationException
December 22, 2016 7:42 AM
Answer

Fabian Bouché

Rank: New Member

Posts: 2

Join Date: April 8, 2016

Recent Posts

Kyle Stiemann:


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:

 1
 2        <alloy:form>
 3            <alloy:outputLabel for="foo-config" value="Foo-config" />
 4            <alloy:inputText id="foo-config" value="#{mutablePortletPreferencesValues['foo-config'].value}" />
 5            <hr />
 6            <!-- ajax="false" is necessary in order to properly switch the portlet to the view mode -->
 7            <alloy:commandButton ajax="false" action="#{portletPreferencesBackingBean.submit}">
 8                <alloy:outputText value="Submit" />
 9            </alloy:commandButton>
10            <!-- ajax="false" is necessary in order to properly switch the portlet to the view mode -->
11            <alloy:commandButton ajax="false" action="#{portletPreferencesBackingBean.reset}">
12                <alloy:outputText value="Reset" />
13            </alloy:commandButton>
14        </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
Kyle Joseph Stiemann
RE: JSF, Primefaces and PortletPreferences - UnsupportedOperationException
December 22, 2016 7:43 AM
Answer

Kyle Joseph Stiemann

LIFERAY STAFF

Rank: Liferay Master

Posts: 501

Join Date: January 14, 2013

Recent Posts

Thanks for posting your working code Fabian! Hopefully this will help other Liferay Faces users who want to use portlet preferences.

- Kyle