Uploaded image for project: 'Tapestry 5'
  1. Tapestry 5
  2. TAP5-1990

Link interface should be more fluid to allow setting of anchor, etc., more concisely

VotersWatch issueWatchersLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 5.4
    • None
    • None

    Description

      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);
      }

      Attachments

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

            hlship Howard Lewis Ship
            angelochen960 Angelo Chen
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Slack

                Issue deployment