You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tapestry.apache.org by "nillehammer (JIRA)" <ji...@apache.org> on 2011/01/04 14:27:46 UTC

[jira] Created: (TAP5-1400) Change AbstractLink (and its subclasses) to optionally surround rendered text with a tag (e.g. span) when disabled

Change AbstractLink (and its subclasses) to optionally surround rendered text with a tag (e.g. span) when disabled
------------------------------------------------------------------------------------------------------------------

                 Key: TAP5-1400
                 URL: https://issues.apache.org/jira/browse/TAP5-1400
             Project: Tapestry 5
          Issue Type: Improvement
          Components: tapestry-core
            Reporter: nillehammer
            Priority: Minor


I frequently use Tapetry's Link components (PageLink, EventLink, ActionLink) to build up vertical menus. I like to style the rendered a-Tags with "display:block" by assigning an appropriate css-Class. This expands the area where the link is clickeable and makes a line break after the rendered link. The latter spares me from surrounding the a-Tags with an additional div. When using the disabled-Parameter of the Link compontents the text in the body is rendered as is, leaving me without any tags to apply styles to. So to ensure the line break I would have to insert tags myself into the template.

I was wondering, if it were possible to add an optional parameter to the Link compontents to make them render a tag around the text and apply the informal parameters "style" and "class" to them. I can think of a boolean value or a String value

/**
  * When set to true, this parameter causes Link to render a a span-Tag around the text that is rendered when link is disabled. When set to false (default), the text will be rendered as is.
 **/
@Parameter(defaultPrefix = BindingConstants.LITERAL, required = false, allowNull = true)
private boolean renderSpan;

Or second alternative

/**
  * When set to a non null value, the provided string will be used as a tag that is rendered around the text that is rendered when link is disabled. When set to null (default) or empty String, the text will be rendered as is.
  **/
@Parameter(defaultPrefix = BindingConstants.LITERAL, required = false, allowNull = true)
private String disabledTag;

This way the change would be backwards compatible.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] [Updated] (TAP5-1400) Change AbstractLink (and its subclasses) to optionally surround rendered text with a tag (e.g. span) when disabled

Posted by "nillehammer (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/TAP5-1400?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

nillehammer updated TAP5-1400:
------------------------------


Hi Howard,

you're right. This is more than easy. But I think just rendering the text of a disabled link changes the structure of the resulting document too much. Compare the following markup:

With links enabled:
<div>
  <a href="whatever">First Link</a>
  <a href="whatelse">Second Link</a>
</div>

With links disabled:
<div>
  First LinkSecondLink
</div>

In my opinion the link texts sorrounded by span-Tags is cleaner, because it is closer to the structure with enabled links.
<div>
  <span>First Link</span>
  <span>Second Link</span>
</div>

That being said, I think this should be part of the Link-components' behavior and not part of a mixin.

> Change AbstractLink (and its subclasses) to optionally surround rendered text with a tag (e.g. span) when disabled
> ------------------------------------------------------------------------------------------------------------------
>
>                 Key: TAP5-1400
>                 URL: https://issues.apache.org/jira/browse/TAP5-1400
>             Project: Tapestry 5
>          Issue Type: Improvement
>          Components: tapestry-core
>            Reporter: nillehammer
>            Priority: Minor
>
> I frequently use Tapetry's Link components (PageLink, EventLink, ActionLink) to build up vertical menus. I like to style the rendered a-Tags with "display:block" by assigning an appropriate css-Class. This expands the area where the link is clickeable and makes a line break after the rendered link. The latter spares me from surrounding the a-Tags with an additional div. When using the disabled-Parameter of the Link compontents the text in the body is rendered as is, leaving me without any tags to apply styles to. So to ensure the line break I would have to insert tags myself into the template.
> I was wondering, if it were possible to add an optional parameter to the Link compontents to make them render a tag around the text and apply the informal parameters "style" and "class" to them. I can think of a boolean value or a String value
> /**
>   * When set to true, this parameter causes Link to render a a span-Tag around the text that is rendered when link is disabled. When set to false (default), the text will be rendered as is.
>  **/
> @Parameter(defaultPrefix = BindingConstants.LITERAL, required = false, allowNull = true)
> private boolean renderSpan;
> Or second alternative
> /**
>   * When set to a non null value, the provided string will be used as a tag that is rendered around the text that is rendered when link is disabled. When set to null (default) or empty String, the text will be rendered as is.
>   **/
> @Parameter(defaultPrefix = BindingConstants.LITERAL, required = false, allowNull = true)
> private String disabledTag;
> This way the change would be backwards compatible.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (TAP5-1400) Change AbstractLink (and its subclasses) to optionally surround rendered text with a tag (e.g. span) when disabled

Posted by "Howard M. Lewis Ship (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/TAP5-1400?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13014290#comment-13014290 ] 

Howard M. Lewis Ship commented on TAP5-1400:
--------------------------------------------

Seems like something that could be done with a Mixin.

> Change AbstractLink (and its subclasses) to optionally surround rendered text with a tag (e.g. span) when disabled
> ------------------------------------------------------------------------------------------------------------------
>
>                 Key: TAP5-1400
>                 URL: https://issues.apache.org/jira/browse/TAP5-1400
>             Project: Tapestry 5
>          Issue Type: Improvement
>          Components: tapestry-core
>            Reporter: nillehammer
>            Priority: Minor
>
> I frequently use Tapetry's Link components (PageLink, EventLink, ActionLink) to build up vertical menus. I like to style the rendered a-Tags with "display:block" by assigning an appropriate css-Class. This expands the area where the link is clickeable and makes a line break after the rendered link. The latter spares me from surrounding the a-Tags with an additional div. When using the disabled-Parameter of the Link compontents the text in the body is rendered as is, leaving me without any tags to apply styles to. So to ensure the line break I would have to insert tags myself into the template.
> I was wondering, if it were possible to add an optional parameter to the Link compontents to make them render a tag around the text and apply the informal parameters "style" and "class" to them. I can think of a boolean value or a String value
> /**
>   * When set to true, this parameter causes Link to render a a span-Tag around the text that is rendered when link is disabled. When set to false (default), the text will be rendered as is.
>  **/
> @Parameter(defaultPrefix = BindingConstants.LITERAL, required = false, allowNull = true)
> private boolean renderSpan;
> Or second alternative
> /**
>   * When set to a non null value, the provided string will be used as a tag that is rendered around the text that is rendered when link is disabled. When set to null (default) or empty String, the text will be rendered as is.
>   **/
> @Parameter(defaultPrefix = BindingConstants.LITERAL, required = false, allowNull = true)
> private String disabledTag;
> This way the change would be backwards compatible.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (TAP5-1400) Change AbstractLink (and its subclasses) to optionally surround rendered text with a tag (e.g. span) when disabled

Posted by "Howard M. Lewis Ship (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/TAP5-1400?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13014290#comment-13014290 ] 

Howard M. Lewis Ship commented on TAP5-1400:
--------------------------------------------

Seems like something that could be done with a Mixin.

> Change AbstractLink (and its subclasses) to optionally surround rendered text with a tag (e.g. span) when disabled
> ------------------------------------------------------------------------------------------------------------------
>
>                 Key: TAP5-1400
>                 URL: https://issues.apache.org/jira/browse/TAP5-1400
>             Project: Tapestry 5
>          Issue Type: Improvement
>          Components: tapestry-core
>            Reporter: nillehammer
>            Priority: Minor
>
> I frequently use Tapetry's Link components (PageLink, EventLink, ActionLink) to build up vertical menus. I like to style the rendered a-Tags with "display:block" by assigning an appropriate css-Class. This expands the area where the link is clickeable and makes a line break after the rendered link. The latter spares me from surrounding the a-Tags with an additional div. When using the disabled-Parameter of the Link compontents the text in the body is rendered as is, leaving me without any tags to apply styles to. So to ensure the line break I would have to insert tags myself into the template.
> I was wondering, if it were possible to add an optional parameter to the Link compontents to make them render a tag around the text and apply the informal parameters "style" and "class" to them. I can think of a boolean value or a String value
> /**
>   * When set to true, this parameter causes Link to render a a span-Tag around the text that is rendered when link is disabled. When set to false (default), the text will be rendered as is.
>  **/
> @Parameter(defaultPrefix = BindingConstants.LITERAL, required = false, allowNull = true)
> private boolean renderSpan;
> Or second alternative
> /**
>   * When set to a non null value, the provided string will be used as a tag that is rendered around the text that is rendered when link is disabled. When set to null (default) or empty String, the text will be rendered as is.
>   **/
> @Parameter(defaultPrefix = BindingConstants.LITERAL, required = false, allowNull = true)
> private String disabledTag;
> This way the change would be backwards compatible.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Updated] (TAP5-1400) Change AbstractLink (and its subclasses) to optionally surround rendered text with a tag (e.g. span) when disabled

Posted by "nillehammer (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/TAP5-1400?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

nillehammer updated TAP5-1400:
------------------------------


Hi Howard,

you're right. This is more than easy. But I think just rendering the text of a disabled link changes the structure of the resulting document too much. Compare the following markup:

With links enabled:
<div>
  <a href="whatever">First Link</a>
  <a href="whatelse">Second Link</a>
</div>

With links disabled:
<div>
  First LinkSecondLink
</div>

In my opinion the link texts sorrounded by span-Tags is cleaner, because it is closer to the structure with enabled links.
<div>
  <span>First Link</span>
  <span>Second Link</span>
</div>

That being said, I think this should be part of the Link-components' behavior and not part of a mixin.

> Change AbstractLink (and its subclasses) to optionally surround rendered text with a tag (e.g. span) when disabled
> ------------------------------------------------------------------------------------------------------------------
>
>                 Key: TAP5-1400
>                 URL: https://issues.apache.org/jira/browse/TAP5-1400
>             Project: Tapestry 5
>          Issue Type: Improvement
>          Components: tapestry-core
>            Reporter: nillehammer
>            Priority: Minor
>
> I frequently use Tapetry's Link components (PageLink, EventLink, ActionLink) to build up vertical menus. I like to style the rendered a-Tags with "display:block" by assigning an appropriate css-Class. This expands the area where the link is clickeable and makes a line break after the rendered link. The latter spares me from surrounding the a-Tags with an additional div. When using the disabled-Parameter of the Link compontents the text in the body is rendered as is, leaving me without any tags to apply styles to. So to ensure the line break I would have to insert tags myself into the template.
> I was wondering, if it were possible to add an optional parameter to the Link compontents to make them render a tag around the text and apply the informal parameters "style" and "class" to them. I can think of a boolean value or a String value
> /**
>   * When set to true, this parameter causes Link to render a a span-Tag around the text that is rendered when link is disabled. When set to false (default), the text will be rendered as is.
>  **/
> @Parameter(defaultPrefix = BindingConstants.LITERAL, required = false, allowNull = true)
> private boolean renderSpan;
> Or second alternative
> /**
>   * When set to a non null value, the provided string will be used as a tag that is rendered around the text that is rendered when link is disabled. When set to null (default) or empty String, the text will be rendered as is.
>   **/
> @Parameter(defaultPrefix = BindingConstants.LITERAL, required = false, allowNull = true)
> private String disabledTag;
> This way the change would be backwards compatible.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira