You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@myfaces.apache.org by "John Singleton (JIRA)" <de...@myfaces.apache.org> on 2006/08/11 11:26:13 UTC

[jira] Created: (TOMAHAWK-592) panelTabbedPane: Duplicate class attributes

panelTabbedPane: Duplicate class attributes
-------------------------------------------

                 Key: TOMAHAWK-592
                 URL: http://issues.apache.org/jira/browse/TOMAHAWK-592
             Project: MyFaces Tomahawk
          Issue Type: Bug
    Affects Versions: 1.1.3
         Environment: Tomcat 5.5, Java 5, Firefox
            Reporter: John Singleton


The panelTabbedPane here:
<t:panelTabbedPane 
			styleClass="subtab"
			rendered="#{configuration.configNetworkEntity.id != 0}"
			serverSideTabSwitch="true"
	        activeTabStyleClass="activeTab"
	        inactiveTabStyleClass="inactiveTab"
	        disabledTabStyleClass="disabledTab"
	        activeSubStyleClass="activeSub"
	        inactiveSubStyleClass="inactiveSub"
	        tabContentStyleClass="tabContent">
....

is being rendered as 

<table id="main__id18" class="myFaces_panelTabbedPane" cellspacing="0" class="subtab">

The problem seems to be in HtmlTabbedPaneRenderer :


    protected void writeTableStart(ResponseWriter writer,
                                   FacesContext facesContext,
                                   HtmlPanelTabbedPane tabbedPane)
        throws IOException
    {
        String oldBgColor = tabbedPane.getBgcolor();
        tabbedPane.setBgcolor(null);

        writer.startElement(HTML.TABLE_ELEM, tabbedPane);
        writer.writeAttribute(HTML.ID_ATTR, getTableStylableId(tabbedPane,facesContext), null);
        writer.writeAttribute(HTML.CLASS_ATTR, "myFaces_panelTabbedPane", null);
        writer.writeAttribute(HTML.CELLSPACING_ATTR, "0", null);
        HtmlRendererUtils.renderHTMLAttributes(writer, tabbedPane, HTML.TABLE_PASSTHROUGH_ATTRIBUTES);
        writer.flush();

        tabbedPane.setBgcolor(oldBgColor);
    }

this method is writing the class attribute, and then the HtmlRendererUtils.renderHTMLAttributes method writes the class attribute based on the 'styleClass' attribute from the panelTabbedPane tag.



-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Commented: (TOMAHAWK-592) panelTabbedPane: Duplicate class attributes

Posted by "Mike Kienenberger (JIRA)" <de...@myfaces.apache.org>.
    [ http://issues.apache.org/jira/browse/TOMAHAWK-592?page=comments#action_12428447 ] 
            
Mike Kienenberger commented on TOMAHAWK-592:
--------------------------------------------

John,

Wouldn't you need to unset the styleClass afterward?

-        writer.writeAttribute(HTML.CLASS_ATTR, "myFaces_panelTabbedPane", null);
+		String tabbedStyleClass = tabbedPane.getStyleClass();
+		tabbedPane.setStyleClass ((tabbedStyleClass == null) ? "myFaces_panelTabbedPane" : "myFaces_panelTabbedPane " + tabbedStyleClass);


Otherwise, the first time the page is displayed, you'd have "myFaces_panelTabbedPane " + tabbedStyleClass.
The next request it'd be "myFaces_panelTabbedPane " + "myFaces_panelTabbedPane " + tabbedStyleClass, the next time "myFaces_panelTabbedPane " + "myFaces_panelTabbedPane " + "myFaces_panelTabbedPane " + tabbedStyleClass and so on?

Also, this is changing the style the end-user will see if they programmically examine the pane.

I think it'd be better to somehow pass in the value rather than try to override the user-settable fields.


> panelTabbedPane: Duplicate class attributes
> -------------------------------------------
>
>                 Key: TOMAHAWK-592
>                 URL: http://issues.apache.org/jira/browse/TOMAHAWK-592
>             Project: MyFaces Tomahawk
>          Issue Type: Bug
>    Affects Versions: 1.1.3
>         Environment: Tomcat 5.5, Java 5, Firefox
>            Reporter: John Singleton
>         Attachments: HtmlTabbedPaneRenderer.java.patch
>
>
> The panelTabbedPane here:
> <t:panelTabbedPane 
> 			styleClass="subtab"
> 			rendered="#{configuration.configNetworkEntity.id != 0}"
> 			serverSideTabSwitch="true"
> 	        activeTabStyleClass="activeTab"
> 	        inactiveTabStyleClass="inactiveTab"
> 	        disabledTabStyleClass="disabledTab"
> 	        activeSubStyleClass="activeSub"
> 	        inactiveSubStyleClass="inactiveSub"
> 	        tabContentStyleClass="tabContent">
> ....
> is being rendered as 
> <table id="main__id18" class="myFaces_panelTabbedPane" cellspacing="0" class="subtab">
> The problem seems to be in HtmlTabbedPaneRenderer :
>     protected void writeTableStart(ResponseWriter writer,
>                                    FacesContext facesContext,
>                                    HtmlPanelTabbedPane tabbedPane)
>         throws IOException
>     {
>         String oldBgColor = tabbedPane.getBgcolor();
>         tabbedPane.setBgcolor(null);
>         writer.startElement(HTML.TABLE_ELEM, tabbedPane);
>         writer.writeAttribute(HTML.ID_ATTR, getTableStylableId(tabbedPane,facesContext), null);
>         writer.writeAttribute(HTML.CLASS_ATTR, "myFaces_panelTabbedPane", null);
>         writer.writeAttribute(HTML.CELLSPACING_ATTR, "0", null);
>         HtmlRendererUtils.renderHTMLAttributes(writer, tabbedPane, HTML.TABLE_PASSTHROUGH_ATTRIBUTES);
>         writer.flush();
>         tabbedPane.setBgcolor(oldBgColor);
>     }
> this method is writing the class attribute, and then the HtmlRendererUtils.renderHTMLAttributes method writes the class attribute based on the 'styleClass' attribute from the panelTabbedPane tag.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Commented: (TOMAHAWK-592) panelTabbedPane: Duplicate class attributes

Posted by "Mike Kienenberger (JIRA)" <de...@myfaces.apache.org>.
    [ http://issues.apache.org/jira/browse/TOMAHAWK-592?page=comments#action_12435079 ] 
            
Mike Kienenberger commented on TOMAHAWK-592:
--------------------------------------------

Hey John,

Sorry for the delay in getting back to you.   The last month was busy for me.

Yes, your approach looks great!

I'll commit this change when I get a chance, unless someone else beats me to it.


> panelTabbedPane: Duplicate class attributes
> -------------------------------------------
>
>                 Key: TOMAHAWK-592
>                 URL: http://issues.apache.org/jira/browse/TOMAHAWK-592
>             Project: MyFaces Tomahawk
>          Issue Type: Bug
>    Affects Versions: 1.1.3
>         Environment: Tomcat 5.5, Java 5, Firefox
>            Reporter: John Singleton
>         Attachments: HtmlTabbedPaneRenderer.java.patch, HtmlTabbedPaneRenderer.java.patch2.txt
>
>
> The panelTabbedPane here:
> <t:panelTabbedPane 
> 			styleClass="subtab"
> 			rendered="#{configuration.configNetworkEntity.id != 0}"
> 			serverSideTabSwitch="true"
> 	        activeTabStyleClass="activeTab"
> 	        inactiveTabStyleClass="inactiveTab"
> 	        disabledTabStyleClass="disabledTab"
> 	        activeSubStyleClass="activeSub"
> 	        inactiveSubStyleClass="inactiveSub"
> 	        tabContentStyleClass="tabContent">
> ....
> is being rendered as 
> <table id="main__id18" class="myFaces_panelTabbedPane" cellspacing="0" class="subtab">
> The problem seems to be in HtmlTabbedPaneRenderer :
>     protected void writeTableStart(ResponseWriter writer,
>                                    FacesContext facesContext,
>                                    HtmlPanelTabbedPane tabbedPane)
>         throws IOException
>     {
>         String oldBgColor = tabbedPane.getBgcolor();
>         tabbedPane.setBgcolor(null);
>         writer.startElement(HTML.TABLE_ELEM, tabbedPane);
>         writer.writeAttribute(HTML.ID_ATTR, getTableStylableId(tabbedPane,facesContext), null);
>         writer.writeAttribute(HTML.CLASS_ATTR, "myFaces_panelTabbedPane", null);
>         writer.writeAttribute(HTML.CELLSPACING_ATTR, "0", null);
>         HtmlRendererUtils.renderHTMLAttributes(writer, tabbedPane, HTML.TABLE_PASSTHROUGH_ATTRIBUTES);
>         writer.flush();
>         tabbedPane.setBgcolor(oldBgColor);
>     }
> this method is writing the class attribute, and then the HtmlRendererUtils.renderHTMLAttributes method writes the class attribute based on the 'styleClass' attribute from the panelTabbedPane tag.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Updated: (TOMAHAWK-592) panelTabbedPane: Duplicate class attributes

Posted by "John Singleton (JIRA)" <de...@myfaces.apache.org>.
     [ http://issues.apache.org/jira/browse/TOMAHAWK-592?page=all ]

John Singleton updated TOMAHAWK-592:
------------------------------------

    Status: Patch Available  (was: Open)

> panelTabbedPane: Duplicate class attributes
> -------------------------------------------
>
>                 Key: TOMAHAWK-592
>                 URL: http://issues.apache.org/jira/browse/TOMAHAWK-592
>             Project: MyFaces Tomahawk
>          Issue Type: Bug
>    Affects Versions: 1.1.3
>         Environment: Tomcat 5.5, Java 5, Firefox
>            Reporter: John Singleton
>         Attachments: HtmlTabbedPaneRenderer.java.patch
>
>
> The panelTabbedPane here:
> <t:panelTabbedPane 
> 			styleClass="subtab"
> 			rendered="#{configuration.configNetworkEntity.id != 0}"
> 			serverSideTabSwitch="true"
> 	        activeTabStyleClass="activeTab"
> 	        inactiveTabStyleClass="inactiveTab"
> 	        disabledTabStyleClass="disabledTab"
> 	        activeSubStyleClass="activeSub"
> 	        inactiveSubStyleClass="inactiveSub"
> 	        tabContentStyleClass="tabContent">
> ....
> is being rendered as 
> <table id="main__id18" class="myFaces_panelTabbedPane" cellspacing="0" class="subtab">
> The problem seems to be in HtmlTabbedPaneRenderer :
>     protected void writeTableStart(ResponseWriter writer,
>                                    FacesContext facesContext,
>                                    HtmlPanelTabbedPane tabbedPane)
>         throws IOException
>     {
>         String oldBgColor = tabbedPane.getBgcolor();
>         tabbedPane.setBgcolor(null);
>         writer.startElement(HTML.TABLE_ELEM, tabbedPane);
>         writer.writeAttribute(HTML.ID_ATTR, getTableStylableId(tabbedPane,facesContext), null);
>         writer.writeAttribute(HTML.CLASS_ATTR, "myFaces_panelTabbedPane", null);
>         writer.writeAttribute(HTML.CELLSPACING_ATTR, "0", null);
>         HtmlRendererUtils.renderHTMLAttributes(writer, tabbedPane, HTML.TABLE_PASSTHROUGH_ATTRIBUTES);
>         writer.flush();
>         tabbedPane.setBgcolor(oldBgColor);
>     }
> this method is writing the class attribute, and then the HtmlRendererUtils.renderHTMLAttributes method writes the class attribute based on the 'styleClass' attribute from the panelTabbedPane tag.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Updated: (TOMAHAWK-592) panelTabbedPane: Duplicate class attributes

Posted by "John Singleton (JIRA)" <de...@myfaces.apache.org>.
     [ http://issues.apache.org/jira/browse/TOMAHAWK-592?page=all ]

John Singleton updated TOMAHAWK-592:
------------------------------------

    Status: Open  (was: Patch Available)

> panelTabbedPane: Duplicate class attributes
> -------------------------------------------
>
>                 Key: TOMAHAWK-592
>                 URL: http://issues.apache.org/jira/browse/TOMAHAWK-592
>             Project: MyFaces Tomahawk
>          Issue Type: Bug
>    Affects Versions: 1.1.3
>         Environment: Tomcat 5.5, Java 5, Firefox
>            Reporter: John Singleton
>
> The panelTabbedPane here:
> <t:panelTabbedPane 
> 			styleClass="subtab"
> 			rendered="#{configuration.configNetworkEntity.id != 0}"
> 			serverSideTabSwitch="true"
> 	        activeTabStyleClass="activeTab"
> 	        inactiveTabStyleClass="inactiveTab"
> 	        disabledTabStyleClass="disabledTab"
> 	        activeSubStyleClass="activeSub"
> 	        inactiveSubStyleClass="inactiveSub"
> 	        tabContentStyleClass="tabContent">
> ....
> is being rendered as 
> <table id="main__id18" class="myFaces_panelTabbedPane" cellspacing="0" class="subtab">
> The problem seems to be in HtmlTabbedPaneRenderer :
>     protected void writeTableStart(ResponseWriter writer,
>                                    FacesContext facesContext,
>                                    HtmlPanelTabbedPane tabbedPane)
>         throws IOException
>     {
>         String oldBgColor = tabbedPane.getBgcolor();
>         tabbedPane.setBgcolor(null);
>         writer.startElement(HTML.TABLE_ELEM, tabbedPane);
>         writer.writeAttribute(HTML.ID_ATTR, getTableStylableId(tabbedPane,facesContext), null);
>         writer.writeAttribute(HTML.CLASS_ATTR, "myFaces_panelTabbedPane", null);
>         writer.writeAttribute(HTML.CELLSPACING_ATTR, "0", null);
>         HtmlRendererUtils.renderHTMLAttributes(writer, tabbedPane, HTML.TABLE_PASSTHROUGH_ATTRIBUTES);
>         writer.flush();
>         tabbedPane.setBgcolor(oldBgColor);
>     }
> this method is writing the class attribute, and then the HtmlRendererUtils.renderHTMLAttributes method writes the class attribute based on the 'styleClass' attribute from the panelTabbedPane tag.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Updated: (TOMAHAWK-592) panelTabbedPane: Duplicate class attributes

Posted by "Martin Marinschek (JIRA)" <de...@myfaces.apache.org>.
     [ http://issues.apache.org/jira/browse/TOMAHAWK-592?page=all ]

Martin Marinschek updated TOMAHAWK-592:
---------------------------------------

           Status: Resolved  (was: Patch Available)
    Fix Version/s: 1.1.4-SNAPSHOT
       Resolution: Fixed

Thanks to John Singleton.

> panelTabbedPane: Duplicate class attributes
> -------------------------------------------
>
>                 Key: TOMAHAWK-592
>                 URL: http://issues.apache.org/jira/browse/TOMAHAWK-592
>             Project: MyFaces Tomahawk
>          Issue Type: Bug
>    Affects Versions: 1.1.3
>         Environment: Tomcat 5.5, Java 5, Firefox
>            Reporter: John Singleton
>         Assigned To: Mike Kienenberger
>             Fix For: 1.1.4-SNAPSHOT
>
>         Attachments: HtmlTabbedPaneRenderer.java.patch, HtmlTabbedPaneRenderer.java.patch2.txt
>
>
> The panelTabbedPane here:
> <t:panelTabbedPane 
> 			styleClass="subtab"
> 			rendered="#{configuration.configNetworkEntity.id != 0}"
> 			serverSideTabSwitch="true"
> 	        activeTabStyleClass="activeTab"
> 	        inactiveTabStyleClass="inactiveTab"
> 	        disabledTabStyleClass="disabledTab"
> 	        activeSubStyleClass="activeSub"
> 	        inactiveSubStyleClass="inactiveSub"
> 	        tabContentStyleClass="tabContent">
> ....
> is being rendered as 
> <table id="main__id18" class="myFaces_panelTabbedPane" cellspacing="0" class="subtab">
> The problem seems to be in HtmlTabbedPaneRenderer :
>     protected void writeTableStart(ResponseWriter writer,
>                                    FacesContext facesContext,
>                                    HtmlPanelTabbedPane tabbedPane)
>         throws IOException
>     {
>         String oldBgColor = tabbedPane.getBgcolor();
>         tabbedPane.setBgcolor(null);
>         writer.startElement(HTML.TABLE_ELEM, tabbedPane);
>         writer.writeAttribute(HTML.ID_ATTR, getTableStylableId(tabbedPane,facesContext), null);
>         writer.writeAttribute(HTML.CLASS_ATTR, "myFaces_panelTabbedPane", null);
>         writer.writeAttribute(HTML.CELLSPACING_ATTR, "0", null);
>         HtmlRendererUtils.renderHTMLAttributes(writer, tabbedPane, HTML.TABLE_PASSTHROUGH_ATTRIBUTES);
>         writer.flush();
>         tabbedPane.setBgcolor(oldBgColor);
>     }
> this method is writing the class attribute, and then the HtmlRendererUtils.renderHTMLAttributes method writes the class attribute based on the 'styleClass' attribute from the panelTabbedPane tag.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Updated: (TOMAHAWK-592) panelTabbedPane: Duplicate class attributes

Posted by "John Singleton (JIRA)" <de...@myfaces.apache.org>.
     [ http://issues.apache.org/jira/browse/TOMAHAWK-592?page=all ]

John Singleton updated TOMAHAWK-592:
------------------------------------

    Status: Patch Available  (was: Open)

> panelTabbedPane: Duplicate class attributes
> -------------------------------------------
>
>                 Key: TOMAHAWK-592
>                 URL: http://issues.apache.org/jira/browse/TOMAHAWK-592
>             Project: MyFaces Tomahawk
>          Issue Type: Bug
>    Affects Versions: 1.1.3
>         Environment: Tomcat 5.5, Java 5, Firefox
>            Reporter: John Singleton
>
> The panelTabbedPane here:
> <t:panelTabbedPane 
> 			styleClass="subtab"
> 			rendered="#{configuration.configNetworkEntity.id != 0}"
> 			serverSideTabSwitch="true"
> 	        activeTabStyleClass="activeTab"
> 	        inactiveTabStyleClass="inactiveTab"
> 	        disabledTabStyleClass="disabledTab"
> 	        activeSubStyleClass="activeSub"
> 	        inactiveSubStyleClass="inactiveSub"
> 	        tabContentStyleClass="tabContent">
> ....
> is being rendered as 
> <table id="main__id18" class="myFaces_panelTabbedPane" cellspacing="0" class="subtab">
> The problem seems to be in HtmlTabbedPaneRenderer :
>     protected void writeTableStart(ResponseWriter writer,
>                                    FacesContext facesContext,
>                                    HtmlPanelTabbedPane tabbedPane)
>         throws IOException
>     {
>         String oldBgColor = tabbedPane.getBgcolor();
>         tabbedPane.setBgcolor(null);
>         writer.startElement(HTML.TABLE_ELEM, tabbedPane);
>         writer.writeAttribute(HTML.ID_ATTR, getTableStylableId(tabbedPane,facesContext), null);
>         writer.writeAttribute(HTML.CLASS_ATTR, "myFaces_panelTabbedPane", null);
>         writer.writeAttribute(HTML.CELLSPACING_ATTR, "0", null);
>         HtmlRendererUtils.renderHTMLAttributes(writer, tabbedPane, HTML.TABLE_PASSTHROUGH_ATTRIBUTES);
>         writer.flush();
>         tabbedPane.setBgcolor(oldBgColor);
>     }
> this method is writing the class attribute, and then the HtmlRendererUtils.renderHTMLAttributes method writes the class attribute based on the 'styleClass' attribute from the panelTabbedPane tag.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Commented: (TOMAHAWK-592) panelTabbedPane: Duplicate class attributes

Posted by "Mike Kienenberger (JIRA)" <de...@myfaces.apache.org>.
    [ http://issues.apache.org/jira/browse/TOMAHAWK-592?page=comments#action_12427537 ] 
            
Mike Kienenberger commented on TOMAHAWK-592:
--------------------------------------------

John,

Sounds like you've made good progress tracking this down.
Can you submit a patch?   Maybe remove the HTML.CLASS_ATTR and somehow append 'myFaces_panelTabbedPane' into the 'styleClass' attribute storage variable from the panelTabbedPane tag?

Either that or create a renderHTMLAttributesWithAdditions() method that also takes [HTML.CLASS_ATTR, "myFaces_panelTabbedPane"] as an argument (maybe two arrays or lists: one for attribute names, one for attribute values)


> panelTabbedPane: Duplicate class attributes
> -------------------------------------------
>
>                 Key: TOMAHAWK-592
>                 URL: http://issues.apache.org/jira/browse/TOMAHAWK-592
>             Project: MyFaces Tomahawk
>          Issue Type: Bug
>    Affects Versions: 1.1.3
>         Environment: Tomcat 5.5, Java 5, Firefox
>            Reporter: John Singleton
>
> The panelTabbedPane here:
> <t:panelTabbedPane 
> 			styleClass="subtab"
> 			rendered="#{configuration.configNetworkEntity.id != 0}"
> 			serverSideTabSwitch="true"
> 	        activeTabStyleClass="activeTab"
> 	        inactiveTabStyleClass="inactiveTab"
> 	        disabledTabStyleClass="disabledTab"
> 	        activeSubStyleClass="activeSub"
> 	        inactiveSubStyleClass="inactiveSub"
> 	        tabContentStyleClass="tabContent">
> ....
> is being rendered as 
> <table id="main__id18" class="myFaces_panelTabbedPane" cellspacing="0" class="subtab">
> The problem seems to be in HtmlTabbedPaneRenderer :
>     protected void writeTableStart(ResponseWriter writer,
>                                    FacesContext facesContext,
>                                    HtmlPanelTabbedPane tabbedPane)
>         throws IOException
>     {
>         String oldBgColor = tabbedPane.getBgcolor();
>         tabbedPane.setBgcolor(null);
>         writer.startElement(HTML.TABLE_ELEM, tabbedPane);
>         writer.writeAttribute(HTML.ID_ATTR, getTableStylableId(tabbedPane,facesContext), null);
>         writer.writeAttribute(HTML.CLASS_ATTR, "myFaces_panelTabbedPane", null);
>         writer.writeAttribute(HTML.CELLSPACING_ATTR, "0", null);
>         HtmlRendererUtils.renderHTMLAttributes(writer, tabbedPane, HTML.TABLE_PASSTHROUGH_ATTRIBUTES);
>         writer.flush();
>         tabbedPane.setBgcolor(oldBgColor);
>     }
> this method is writing the class attribute, and then the HtmlRendererUtils.renderHTMLAttributes method writes the class attribute based on the 'styleClass' attribute from the panelTabbedPane tag.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira