Class CheckBoxMultipleChoice<T>

    • Method Detail

      • getPrefix

        public java.lang.String getPrefix()
        Returns:
        Prefix to use before choice
      • getPrefix

        protected java.lang.String getPrefix​(int index,
                                             T choice)
        Parameters:
        index - index of the choice
        choice - the choice itself
        Returns:
        Prefix to use before choice. The default implementation just returns getPrefix(). Override to have a prefix dependent on the choice item.
      • getSuffix

        protected java.lang.String getSuffix​(int index,
                                             T choice)
        Parameters:
        index - index of the choice
        choice - the choice itself
        Returns:
        Separator to use between radio options. The default implementation just returns getSuffix(). Override to have a prefix dependent on the choice item.
      • setPrefix

        public final CheckBoxMultipleChoice<T> setPrefix​(java.lang.String prefix)
        Parameters:
        prefix - Prefix to use before choice
        Returns:
        this
      • getSuffix

        public java.lang.String getSuffix()
        Returns:
        Separator to use between radio options
      • setSuffix

        public final CheckBoxMultipleChoice<T> setSuffix​(java.lang.String suffix)
        Parameters:
        suffix - Separator to use between radio options
        Returns:
        this
      • setLabelPosition

        public CheckBoxMultipleChoice<T> setLabelPosition​(AbstractChoice.LabelPosition labelPosition)
        Sets the preferred position of the <label> for each choice
        Parameters:
        labelPosition - The preferred position for the label
        Returns:
        this instance, for chaining
      • appendOptionHtml

        protected void appendOptionHtml​(org.apache.wicket.util.string.AppendingStringBuffer buffer,
                                        T choice,
                                        int index,
                                        java.lang.String selected)
        Generates and appends html for a single choice into the provided buffer
        Overrides:
        appendOptionHtml in class AbstractChoice<java.util.Collection<T>,​T>
        Parameters:
        buffer - Appending string buffer that will have the generated html appended
        choice - Choice object
        index - The index of this option
        selected - The currently selected string value
      • getAdditionalAttributesForLabel

        protected org.apache.wicket.util.value.IValueMap getAdditionalAttributesForLabel​(int index,
                                                                                         T choice)
        You may subclass this method to provide additional attributes to the <label ..> tag.
        Parameters:
        index - index of the choice
        choice - the choice itself
        Returns:
        tag attribute name/value pairs.
      • getAdditionalAttributes

        protected org.apache.wicket.util.value.IValueMap getAdditionalAttributes​(int index,
                                                                                 T choice)
        You may subclass this method to provide additional attributes to the <input ..> tag.
        Parameters:
        index -
        choice -
        Returns:
        tag attribute name/value pairs.
      • getCheckBoxMarkupId

        protected java.lang.String getCheckBoxMarkupId​(java.lang.String id)
        Creates markup id for the input tag used to generate the checkbox for the element with the specified id.

        NOTE It is useful to override this method if the contract for the generated ids should be fixed, for example in cases when the id generation pattern in this method is used to predict ids by some external javascript. If the contract is fixed in the user's code then upgrading wicket versions will guarantee not to break it should the default contract be changed at a later time.

        Parameters:
        id -
        Returns:
        markup id for the input tag