[ 
https://issues.apache.org/jira/browse/WICKET-3868?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13060525#comment-13060525
 ] 

Maarten Billemont commented on WICKET-3868:
-------------------------------------------

No room for further discussion about whether we're doing the right thing?  
toString() was never intended for use in a localized context.

> Feedback message should be handled the same way everywhere.
> -----------------------------------------------------------
>
>                 Key: WICKET-3868
>                 URL: https://issues.apache.org/jira/browse/WICKET-3868
>             Project: Wicket
>          Issue Type: Bug
>            Reporter: Maarten Billemont
>            Assignee: Martin Grigorov
>             Fix For: 1.4.18, 1.5-RC6
>
>
> Feedback messages are Serializables.  While I personally don't agree with 
> that (since users want to see a String, not a Serializable object), it is the 
> way it is.  However, that means we should be careful that the feedback 
> message object is handled the same way everywhere.
> For instance, FeedbackPanel.newMessageDisplayComponent(String, 
> FeedbackMessage) does a toString() on it, while 
> AjaxEditableLabel.onError(AjaxRequestTarget) casts it to String if it's a 
> String and pretends it's not there if it's not.
> Presumably, the latter is not the intended way of using the message, and it 
> should be corrected to act like the former.
> I believe it raises the issue of danger with using the wrong type of object 
> very well, though.  It opens the road for bugs like this one, where your 
> feedback message that isn't a message isn't handled properly because the 
> framework assumes it's a message.  IMO, we should make it a String and the 
> user should put whatever their toString would generate in a feedback message, 
> instead of the object itself.  KISS.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to