Class FeedbackPanel

    • Method Detail

      • anyErrorMessage

        public final boolean anyErrorMessage()
        Search messages that this panel will render, and see if there is any message of level ERROR or up. This is a convenience method; same as calling 'anyMessage(FeedbackMessage.ERROR)'.
        Returns:
        whether there is any message for this panel of level ERROR or up
      • anyMessage

        public final boolean anyMessage()
        Search messages that this panel will render, and see if there is any message.
        Returns:
        whether there is any message for this panel
      • anyMessage

        public final boolean anyMessage​(int level)
        Search messages that this panel will render, and see if there is any message of the given level.
        Parameters:
        level - the level, see FeedbackMessage
        Returns:
        whether there is any message for this panel of the given level
      • getFeedbackMessagesModel

        public final FeedbackMessagesModel getFeedbackMessagesModel()
        Returns:
        Model for feedback messages on which you can install filters and other properties
      • getSortingComparator

        public final java.util.Comparator<FeedbackMessage> getSortingComparator()
        Returns:
        The current sorting comparator
      • isVersioned

        public boolean isVersioned()
        Overrides:
        isVersioned in class Component
        Returns:
        true if this component should notify its holding page about changes in its state. If a Page is not versioned then it wont track changes in its components and will use the same Page.getPageId() during its lifetime
        See Also:
        Component.isVersioned()
      • setFilter

        public final FeedbackPanel setFilter​(IFeedbackMessageFilter filter)
        Sets a filter to use on the feedback messages model
        Parameters:
        filter - The message filter to install on the feedback messages model
        Returns:
        FeedbackPanel this.
      • setMaxMessages

        public final FeedbackPanel setMaxMessages​(int maxMessages)
        Parameters:
        maxMessages - The maximum number of feedback messages that this feedback panel should show at one time
        Returns:
        FeedbackPanel this.
      • setSortingComparator

        public final FeedbackPanel setSortingComparator​(java.util.Comparator<FeedbackMessage> sortingComparator)
        Sets the comparator used for sorting the messages.
        Parameters:
        sortingComparator - comparator used for sorting the messages.
        Returns:
        FeedbackPanel this.
      • getCSSClass

        protected java.lang.String getCSSClass​(FeedbackMessage message)
        Gets the css class for the given message.
        Parameters:
        message - the message
        Returns:
        the css class; by default, this returns feedbackPanel + the message level, eg 'feedbackPanelERROR', but you can override this method to provide your own
      • getCurrentMessages

        protected final java.util.List<FeedbackMessage> getCurrentMessages()
        Gets the currently collected messages for this panel.
        Returns:
        the currently collected messages for this panel, possibly empty
      • newFeedbackMessagesModel

        protected FeedbackMessagesModel newFeedbackMessagesModel()
        Gets a new instance of FeedbackMessagesModel to use.
        Returns:
        Instance of FeedbackMessagesModel to use
      • newMessageDisplayComponent

        protected Component newMessageDisplayComponent​(java.lang.String id,
                                                       FeedbackMessage message)
        Generates a component that is used to display the message inside the feedback panel. This component must handle being attached to span tags. By default a Label is used. Note that the created component is expected to respect feedback panel's Component.getEscapeModelStrings() value
        Parameters:
        id - parent id
        message - feedback message
        Returns:
        component used to display the message
      • newMessageItem

        protected ListItem<FeedbackMessage> newMessageItem​(int index,
                                                           IModel<FeedbackMessage> itemModel)
        Allows to define the listItem to use in the feedback's message list.
        Parameters:
        index - The index of the item
        itemModel - The model object of the item
        Returns:
        Container that holds components of the feedback MessageListView.