[ 
https://issues.apache.org/jira/browse/TAP5-1990?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13720012#comment-13720012
 ] 

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

(doto (.createPageRenderLinkWithContext Mypage code) (.setAnchor entry))

... oh, sorry, that's Clojure.

This would be an improvement though changing an existing public interface 
arbitrarily is always suspect.
                
> Link interface should be more fluid to allow setting of anchor, etc., more 
> concisely
> ------------------------------------------------------------------------------------
>
>                 Key: TAP5-1990
>                 URL: https://issues.apache.org/jira/browse/TAP5-1990
>             Project: Tapestry 5
>          Issue Type: Improvement
>            Reporter: Angelo Chen
>
> first, the use case:
> You might be in a situation adding Backbonejs router to your existing 
> Tapestry5 app, you got one like this:
> Object onActivate(String code, String entry);   // 
> localhost:8080/mypage/0001/e001
> and you would like to redirect this to your backbonejs version which is: 
> localhost:8080/mypage/0001#e001
> you can do it now by:
> Object onActivate(String code, String entry) {
>       Link lnk = 
> renderLinkSource.createPageRenderLinkWithContext(Mypage.class, code);
>       lnk.setAnchor(entry);
>       return lnk
> }
> if setAnchor returns Link instead of void, then it can be simplified to:
> Object onActivate(String code, String entry) {
>   return renderLinkSource.createPageRenderLinkWithContext(Mypage.class, 
> code).setAnchor(entry);
> }

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Reply via email to