Tapestry
  1. Tapestry
  2. TAPESTRY-813

Provide a global clientId for all components, not only forms related ones

    Details

    • Type: Improvement Improvement
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 4.0
    • Fix Version/s: 4.1
    • Component/s: Framework
    • Labels:
      None

      Description

      Currently only form components support a "clientId" property that allow client-side scripting to attach to a single HTML ID, like this:

      <input id="ognl:components.someComponent.clientId" jwcid="someComponent@TextField" ... />

      This support could be refactored to support non-form components, like @Any, to allow them to be used in client-side Javascript:

      <span id="ognl:components.someComponent.clientId" jwcid="someComponent@Any" />
      </span>

        Activity

        Leonardo Quijano Vincenzi created issue -
        Jesse Kuhnert made changes -
        Field Original Value New Value
        Fix Version/s 4.1 [ 12310632 ]
        Hide
        Leonardo Quijano Vincenzi added a comment -

        Actually the "idPath" property in IComponent can be used to achieve a similar effect. So if we have "compY" nested inside "compX" we can actually do:

        <span id="ognl:components.compY.idPath" jwcid="compY@Any" />

        And that would render as:

        <span id="compX.compY">
        </span>

        The question is, the "." is an accepted XML name character (http://www.w3.org/TR/REC-xml/#NT-Name), but is it reserved for some special purposes?

        Show
        Leonardo Quijano Vincenzi added a comment - Actually the "idPath" property in IComponent can be used to achieve a similar effect. So if we have "compY" nested inside "compX" we can actually do: <span id="ognl:components.compY.idPath" jwcid="compY@Any" /> And that would render as: <span id="compX.compY"> </span> The question is, the "." is an accepted XML name character ( http://www.w3.org/TR/REC-xml/#NT-Name ), but is it reserved for some special purposes?
        Hide
        Jesse Kuhnert added a comment -

        Didn't notice this was also fixed. Sorry! getClientId() should always return the most correct ID for the component you are working on, regardless of whether or not it is a form component.

        Show
        Jesse Kuhnert added a comment - Didn't notice this was also fixed. Sorry! getClientId() should always return the most correct ID for the component you are working on, regardless of whether or not it is a form component.
        Jesse Kuhnert made changes -
        Status Open [ 1 ] Resolved [ 5 ]
        Resolution Fixed [ 1 ]
        Mark Thomas made changes -
        Workflow jira [ 12344990 ] Default workflow, editable Closed status [ 12567602 ]
        Mark Thomas made changes -
        Workflow Default workflow, editable Closed status [ 12567602 ] jira [ 12590742 ]

          People

          • Assignee:
            Unassigned
            Reporter:
            Leonardo Quijano Vincenzi
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development