Uploaded image for project: 'MyFaces Core'
  1. MyFaces Core
  2. MYFACES-1772

How to apply style/styleclass by calling getStyle() or getstyleclass()

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Invalid
    • 1.1.5
    • None
    • Extension Feature
    • None

    Description

      Hi The source code for many renderer classes say that style of button etc, can be overriden by overriding getStyle method.
      I wanted to know how to do that. I was thinking it should be setStyle method and not get method?
      Thanks
      Raghu
      /**

      • Can be overwritten by derived classes to overrule the style to be used.

      */

      protected String getStyle(FacesContext facesContext, UIComponent link) {

      if (link instanceof HtmlCommandLink)

      { return ((HtmlCommandLink) link).getStyle(); }

      else

      { return (String) link.getAttributes().get(HTML.STYLE_ATTR); }

      }

      /**

      • Can be overwritten by derived classes to overrule the style class to be used.

      */

      protected String getStyleClass(FacesContext facesContext, UIComponent link) {

      if (link instanceof HtmlCommandLink)

      { return ((HtmlCommandLink) link).getStyleClass(); }

      else

      { return (String) link.getAttributes().get(HTML.STYLE_CLASS_ATTR); }

      }

      Attachments

        Activity

          People

            Unassigned Unassigned
            rsapre Raghunandan Sapre
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: