You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@click.apache.org by "Adrian A. (JIRA)" <ji...@apache.org> on 2009/04/30 13:44:30 UTC
[jira] Created: (CLK-543) SimpleLink control.
SimpleLink control.
-------------------
Key: CLK-543
URL: https://issues.apache.org/jira/browse/CLK-543
Project: Click
Issue Type: New Feature
Components: extras
Reporter: Adrian A.
There doesn't seem to be any "simple link" control in Click to be able to point to an arbitrary URL (internal but external too).
There's now the ExternalLink but it's just too specific :( - extending it would conflict with it's name (maybe a rename would be better).
In many cases there's no distinction in the application between an internal an external URL (e.g. because the external might be a subdomain).
Another problem is that AbstractLink is can't be used directly for these simple cases (being abstract).
Basically a SimpleLink code would look like ExternalLink, but it would have this additional snippet after L:106:
<code>
String ctxPath = getContext().getRequest().getContextPath();
if(!getTargetPath().contains("://")) {
buffer.append(ctxPath);
}
</code>
This would allow to use only one control, and in the application logic, depending on the target, to let the control itself render the required context path if needed.
Thank you,
A.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (CLK-543) SimpleLink control.
Posted by "Malcolm Edgar (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/CLK-543?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12711968#action_12711968 ]
Malcolm Edgar commented on CLK-543:
-----------------------------------
ExternalLink is supposed to be used for generating arbitary anchor tags. I would agree SimpleLink or Link might be a better name, but that's what we have. The name dates back to a component I added to Tapestry back in 2.x.
How about developing some conventions about appending the context path to ExternalLink and updating the Javadoc to make it more generalised.
> SimpleLink control.
> -------------------
>
> Key: CLK-543
> URL: https://issues.apache.org/jira/browse/CLK-543
> Project: Click
> Issue Type: New Feature
> Components: extras
> Reporter: Adrian A.
>
> There doesn't seem to be any "simple link" control in Click to be able to point to an arbitrary URL (internal but external too).
> There's now the ExternalLink but it's just too specific :( - extending it would conflict with it's name (maybe a rename would be better).
> In many cases there's no distinction in the application between an internal an external URL (e.g. because the external might be a subdomain).
> Another problem is that AbstractLink is can't be used directly for these simple cases (being abstract).
> Basically a SimpleLink code would look like ExternalLink, but it would have this additional snippet after L:106:
> <code>
> String ctxPath = getContext().getRequest().getContextPath();
> if(!getTargetPath().contains("://")) {
> buffer.append(ctxPath);
> }
> </code>
> This would allow to use only one control, and in the application logic, depending on the target, to let the control itself render the required context path if needed.
> Thank you,
> A.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (CLK-543) SimpleLink control.
Posted by "Adrian A. (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/CLK-543?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12711996#action_12711996 ]
Adrian A. commented on CLK-543:
-------------------------------
>How about developing some conventions about appending the context path to ExternalLink and updating the
>Javadoc to make it more generalised.
Most important of course, would be the functionality, so if it includes the above snippet than it would be an improvement to the actual situation. Because of the "historical naming" however, many users won't "guess" to use it.
Of course, a much better approach would be to refactor e.g. AbstractLink to Link (and make it non-abstract). Since it's abstract, users don't use it directly, so most of them won't be affected. IMHO Click should be as intuitive as possible, and in the case of a link, there's nothing more intuitive than "Link" :).
> SimpleLink control.
> -------------------
>
> Key: CLK-543
> URL: https://issues.apache.org/jira/browse/CLK-543
> Project: Click
> Issue Type: New Feature
> Components: extras
> Reporter: Adrian A.
>
> There doesn't seem to be any "simple link" control in Click to be able to point to an arbitrary URL (internal but external too).
> There's now the ExternalLink but it's just too specific :( - extending it would conflict with it's name (maybe a rename would be better).
> In many cases there's no distinction in the application between an internal an external URL (e.g. because the external might be a subdomain).
> Another problem is that AbstractLink is can't be used directly for these simple cases (being abstract).
> Basically a SimpleLink code would look like ExternalLink, but it would have this additional snippet after L:106:
> <code>
> String ctxPath = getContext().getRequest().getContextPath();
> if(!getTargetPath().contains("://")) {
> buffer.append(ctxPath);
> }
> </code>
> This would allow to use only one control, and in the application logic, depending on the target, to let the control itself render the required context path if needed.
> Thank you,
> A.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.