You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by algirdas <al...@gmail.com> on 2008/04/29 23:31:25 UTC

T5Components help - RatingField exception

If no star is selected and form is submitted, I get an exception


org.apache.tapestry.runtime.ComponentEventException
Failure writing parameter 'value' of component
Index:ratingfield1.radiogroup: Failure writing parameter 'value' of
component Index:ratingfield1:
org.apache.tapestry.ioc.internal.util.TapestryException


This happens when parameter that will hold rating value is a number (int)
and value is 0 (or it would be "not set"), e.g. 


	@Property

	private int _ratingValue1 = 0;



This does not happen when parameter is string.

	@Property

	private string _ratingValue1 = "";


Any suggestions? 
-- 
View this message in context: http://www.nabble.com/T5Components-help---RatingField-exception-tp16970977p16970977.html
Sent from the Tapestry - User mailing list archive at Nabble.com.

Re: T5Components help - RatingField exception

Posted by algirdas <al...@gmail.com>.
Understood. Thank you very much!
-- 
View this message in context: http://www.nabble.com/T5Components-help---RatingField-exception-tp16970977p16987402.html
Sent from the Tapestry - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: T5Components help - RatingField exception

Posted by Josh Canfield <jo...@thedailytube.com>.
Tapestry is trying to assign null to your value (when you don't select
a radiogroup nothing is returned). An int can't be null so you can
change your property type to Integer, then it will be null when you
choose nothing. If you want null to represent 0 then write your
setRatingValue method to do that translation.

Josh

On Tue, Apr 29, 2008 at 2:31 PM, algirdas <al...@gmail.com> wrote:
>
> If no star is selected and form is submitted, I get an exception
>
>
> org.apache.tapestry.runtime.ComponentEventException
> Failure writing parameter 'value' of component
> Index:ratingfield1.radiogroup: Failure writing parameter 'value' of
> component Index:ratingfield1:
> org.apache.tapestry.ioc.internal.util.TapestryException
>
>
> This happens when parameter that will hold rating value is a number (int)
> and value is 0 (or it would be "not set"), e.g.
>
>
>        @Property
>
>        private int _ratingValue1 = 0;
>
>
>
> This does not happen when parameter is string.
>
>        @Property
>
>        private string _ratingValue1 = "";
>
>
> Any suggestions?
> --
> View this message in context: http://www.nabble.com/T5Components-help---RatingField-exception-tp16970977p16970977.html
> Sent from the Tapestry - User mailing list archive at Nabble.com.
>



-- 
--
TheDailyTube.com. Sign up and get the best new videos on the internet
delivered fresh to your inbox.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org