Details

    • Type: Improvement Improvement
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 1.1.11-SNAPSHOT
    • Fix Version/s: 1.1.11
    • Component/s: None
    • Labels:
      None
    • Environment:
      Win XP, MyFaces 2.0.3-Snapshot, Tomahahwk20-1.1.11-Snapshot

      Description

      Hi,

      I'm using the collapsiblepanel component inside a h:form see the following code

      <t:collapsiblePanel id="aNewId" title="a title" style="margin-left: 30px;">
      <p>lorem ipsum</p>
      </t:collapsiblePanel>

      It get's rendered as follows:

      <div style="margin-left: 30px;" title="a title">
      <a href...>
      <span style="margin-left: 30px;">></span>
      <span style="margin-left: 30px;">a title</span>
      </a>
      </div>

      Why get the both span-tags the margin-left style too? Because the div has this style already and the first span has now a margin-left of 60px while the third span has a margin-left of 90px.

      How can i achieve it that the margin-left style is applied only to the surrounding div? Is this a bug or did I misconfigured sth?

      Greets Oli

      1. patch.txt
        1 kB
        Oliver Bayer

        Activity

        Oliver Bayer created issue -
        Hide
        Jakob Korherr added a comment -

        Hi Oliver,

        I guess this is an implementation detail (or bug?) and you certainly can't configure this otherwise (see [1]).

        However you could use a css file or a style-section in the html-head to apply the style to the outer div only instead of using the style attribute of the collapsiblePanel.

        [1] http://myfaces.apache.org/tomahawk-project/tomahawk20/tagdoc/t_collapsiblePanel.html

        Show
        Jakob Korherr added a comment - Hi Oliver, I guess this is an implementation detail (or bug?) and you certainly can't configure this otherwise (see [1] ). However you could use a css file or a style-section in the html-head to apply the style to the outer div only instead of using the style attribute of the collapsiblePanel. [1] http://myfaces.apache.org/tomahawk-project/tomahawk20/tagdoc/t_collapsiblePanel.html
        Hide
        Oliver Bayer added a comment -

        Hi Jakob,

        thanks for the fast answer and the info.

        If you can confirm this as an issue of the collapsiblepanel it should get fixed because you don't get the result someone would expect.
        Even though I know I can remove the unwanted margin of the span-tags via css or remove the inline style tag of the div.

        I'm not sure if the following lines are causing this issue - maybe you can take a look at it some time.

        HtmlCollapsiblePanelRenderer [L:213]
        protected HtmlCommandLink getLink(......){
        ...
        uiText.setStyleClass(collapsiblePanel.getStyleClass());
        uiText.setStyle(collapsiblePanel.getStyle());
        ...
        if (label != null)

        { ... uiText.setStyleClass(collapsiblePanel.getStyleClass()); uiText.setStyle(collapsiblePanel.getStyle()); }

        }

        I think the styleClass and the style-attribute shouldn't be added to the indicator and the label. What do you think?

        HTH Oli

        Show
        Oliver Bayer added a comment - Hi Jakob, thanks for the fast answer and the info. If you can confirm this as an issue of the collapsiblepanel it should get fixed because you don't get the result someone would expect. Even though I know I can remove the unwanted margin of the span-tags via css or remove the inline style tag of the div. I'm not sure if the following lines are causing this issue - maybe you can take a look at it some time. HtmlCollapsiblePanelRenderer [L:213] protected HtmlCommandLink getLink(......){ ... uiText.setStyleClass(collapsiblePanel.getStyleClass()); uiText.setStyle(collapsiblePanel.getStyle()); ... if (label != null) { ... uiText.setStyleClass(collapsiblePanel.getStyleClass()); uiText.setStyle(collapsiblePanel.getStyle()); } } I think the styleClass and the style-attribute shouldn't be added to the indicator and the label. What do you think? HTH Oli
        Hide
        Oliver Bayer added a comment -

        Hi Jakob,

        is there a chance of getting this bug (at least in my eyes) fixed or do I have to "css-hack" it myself?
        Did you find some time to look at the code snippet I mentioned? Is this the class to fix the css bug?

        Oli

        Show
        Oliver Bayer added a comment - Hi Jakob, is there a chance of getting this bug (at least in my eyes) fixed or do I have to "css-hack" it myself? Did you find some time to look at the code snippet I mentioned? Is this the class to fix the css bug? Oli
        Hide
        Jakob Korherr added a comment -

        Hi Oli,

        Big sorry for my very, very late answer.

        > I think the styleClass and the style-attribute shouldn't be added to the indicator and the label. What do you think?

        Yes, I think so too. Could you provide a patch for this one? Then I will commit it shortly

        Thanks!

        Show
        Jakob Korherr added a comment - Hi Oli, Big sorry for my very, very late answer. > I think the styleClass and the style-attribute shouldn't be added to the indicator and the label. What do you think? Yes, I think so too. Could you provide a patch for this one? Then I will commit it shortly Thanks!
        Oliver Bayer made changes -
        Field Original Value New Value
        Status Open [ 1 ] Patch Available [ 10002 ]
        Oliver Bayer made changes -
        Attachment patch.txt [ 12471510 ]
        Hide
        Oliver Bayer added a comment -

        patch

        Show
        Oliver Bayer added a comment - patch
        Oliver Bayer made changes -
        Attachment patch.txt [ 12471511 ]
        Oliver Bayer made changes -
        Attachment patch.txt [ 12471510 ]
        Hide
        Oliver Bayer added a comment -

        Hi Jakob,

        no problem. Better late than never .

        The attached patch (it's the first patch I'm contributing so I hope it's working for you too) removes the styleClass and style-attribute from the link and the indicator. If you want the ability to style the indicator and the link I would suggest creating two new attributes for the collapsiblePanel e.g. indicatorStyleClass/ indicatorStyle and labelStyleClass/ labelStyle.

        HTH Oli

        Show
        Oliver Bayer added a comment - Hi Jakob, no problem. Better late than never . The attached patch (it's the first patch I'm contributing so I hope it's working for you too) removes the styleClass and style-attribute from the link and the indicator. If you want the ability to style the indicator and the link I would suggest creating two new attributes for the collapsiblePanel e.g. indicatorStyleClass/ indicatorStyle and labelStyleClass/ labelStyle. HTH Oli
        Hide
        Leonardo Uribe added a comment -

        I added 4 new properties as suggested:

        indicatorStyleClass
        indicatorStyle
        titleStyleClass
        titleStyle

        It is a very simple task to do with myfaces builder plugin. And replaced the bad code with the usage of those properties. Thanks to Oliver Bayer for provide these hints.

        Show
        Leonardo Uribe added a comment - I added 4 new properties as suggested: indicatorStyleClass indicatorStyle titleStyleClass titleStyle It is a very simple task to do with myfaces builder plugin. And replaced the bad code with the usage of those properties. Thanks to Oliver Bayer for provide these hints.
        Leonardo Uribe made changes -
        Status Patch Available [ 10002 ] Resolved [ 5 ]
        Assignee Leonardo Uribe [ lu4242 ]
        Fix Version/s 1.1.11-SNAPSHOT [ 12315372 ]
        Resolution Fixed [ 1 ]
        Leonardo Uribe made changes -
        Fix Version/s 1.1.11 [ 12316480 ]
        Fix Version/s 1.1.11-SNAPSHOT [ 12315372 ]
        Leonardo Uribe made changes -
        Status Resolved [ 5 ] Closed [ 6 ]

          People

          • Assignee:
            Leonardo Uribe
            Reporter:
            Oliver Bayer
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development