Uploaded image for project: 'Wicket'
  1. Wicket
  2. WICKET-3868

Feedback message should be handled the same way everywhere.

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • None
    • 1.4.18, 1.5-RC6
    • None
    • None

    Description

      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.

      Attachments

        Activity

          People

            mgrigorov Martin Tzvetanov Grigorov
            lhunath Maarten Billemont
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: