Uploaded image for project: 'Wicket'
  1. Wicket
  2. WICKET-2111

Ability to generate markup ids in alternate fashion

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Major
    • Resolution: Won't Fix
    • 1.3.5, 1.3.6, 1.4-RC3
    • None
    • None
    • None

    Description

      In the attempts to setup integrated testing one particular piece of wicket code isn't quite extendible enough for our needs, which is the generation of markup ids by the wicket session class. The ability to extend this functionality is not limited to the particular use case, I'd like to propose a small change.

      The issue is the following; when a Component has no explicit markup-id set, the markup id is generated by the Session which has an internal counter and uses an increment of this to generate a mark-id. The flaw IMHO is that a Component requests the Session to generate an id, without passing it any context. Especially the most logical context, i.e. "please session, generate a markup id for ME" is missing. Therefore I'd propose that the Session.getMarkupId() is passes the Component object for which the markup id is to be generated.

      By default, the operation should remain as is and the Session object falls back to the default getMarkupId() without parameters, which is already overrideable. But now you can override the getMarkupId() and generate more useful markup ids.

      In our case, we are able to generate markup ids which contain part of the hierarchy and in this manner generate stable Ids, namely those which do not change after several requests. This particular usage may just work for our case (one page application, no back-button support, etc), but the fundamental overrideable method to generate more useful IDs is more widely applicable, hence this change request.

      Attachments

        1. patch
          2 kB
          Berry van Halderen
        2. wicket-2111.patch
          26 kB
          Juegen Donnerstag
        3. wicket-2111.patch
          26 kB
          Juegen Donnerstag
        4. wicket-2111.patch
          25 kB
          Juegen Donnerstag
        5. wicket-2111.patch
          37 kB
          Juegen Donnerstag

        Issue Links

          Activity

            People

              Unassigned Unassigned
              halderen Berry van Halderen
              Votes:
              4 Vote for this issue
              Watchers:
              7 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: