Disabled rating component: PropertyNotWritableException

UI Components for JSF
Post Reply
shuta
Posts: 15
Joined: 25 Dec 2010, 19:20

13 Jan 2011, 11:15

Hi,

I am using <p:rating> only for the display of ratings (I do not want the user to be able to change these ratings), so I have set the "disabled" flag to "true". To retrieve my ratings, I am using a method expression. This results in the following exception whenever I load the page:

Code: Select all

javax.el.PropertyNotWritableException: /index.xhtml at line 83 and column 147 value="#{controller.getRating(varStatus.Index, varStatus2.Index)}": Illegal Syntax for Set Operation
	at org.apache.myfaces.view.facelets.el.TagValueExpression.setValue(TagValueExpression.java:125) ~[myfaces-impl-2.0.3.jar:2.0.3]
	at javax.faces.component.UIInput.updateModel(UIInput.java:380) [myfaces-api-2.0.3.jar:2.0.3]
	at javax.faces.component.UIInput.processUpdates(UIInput.java:299) [myfaces-api-2.0.3.jar:2.0.3]
	at javax.faces.component.UIComponentBase.processUpdates(UIComponentBase.java:1258) [myfaces-api-2.0.3.jar:2.0.3]
	at org.apache.myfaces.view.facelets.component.UIRepeat.process(UIRepeat.java:629) [myfaces-impl-2.0.3.jar:2.0.3]
I have also tried replacing my method expression with a simple property expression, without having a setter (because I do not need one, and I do not want the property to be writable!). This then results in a PropertyNotFoundException:

Code: Select all

javax.el.PropertyNotFoundException: /evaluator/index.xhtml at line 83 and column 99 value="#{evaluatorIndexController.fixedRating}": Property 'fixedRating' not writable on type double
	at javax.faces.component.UIInput.updateModel(UIInput.java:398) ~[myfaces-api-2.0.3.jar:2.0.3]
	at javax.faces.component.UIInput.processUpdates(UIInput.java:299) ~[myfaces-api-2.0.3.jar:2.0.3]
	at javax.faces.component.UIComponentBase.processUpdates(UIComponentBase.java:1258) ~[myfaces-api-2.0.3.jar:2.0.3]
Can this be fixed? I guess there is no need for the setValue() method to be called if the component is disabled.

Thanks!

Post Reply

Return to “PrimeFaces”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 27 guests