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

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 5.4
    • Component/s: None
    • Labels:
      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

            People

            • Assignee:
              hlship Howard M. Lewis Ship
              Reporter:
              angelochen960 Angelo Chen
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: