Tapestry 5
  1. Tapestry 5
  2. TAP5-680

Tapestry should provide a mixin for ensuring that the client id of a ClientElement is rendered

    Details

    • Type: New Feature New Feature
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 5.1.0.4
    • Fix Version/s: 5.2.0
    • Component/s: None
    • Labels:
      None

      Description

      Any component not rendering id attribute if clientId defined,

      <input t:type="Any" t:clientId="someid" type="hidden"/>

        Activity

        Hide
        Robert Zeigler added a comment -

        By design, components only render a clientId if "getClientId" is called on the component sometime during the server-side dom render.

        You can do this easily with a simple mixin:

        public class ForceClientId {

        @InjectContainer
        private ClientElement element;

        @BeginRender
        void ensureId()

        { element.getClientId(); }

        }

        And then in your component:
        <t:any .... t:mixins="ForceClientId"/>

        If that doesn't solve your issue, then there's a genuine issue, and you can re-open this.

        Show
        Robert Zeigler added a comment - By design, components only render a clientId if "getClientId" is called on the component sometime during the server-side dom render. You can do this easily with a simple mixin: public class ForceClientId { @InjectContainer private ClientElement element; @BeginRender void ensureId() { element.getClientId(); } } And then in your component: <t:any .... t:mixins="ForceClientId"/> If that doesn't solve your issue, then there's a genuine issue, and you can re-open this.
        Hide
        Nikita Koksharov added a comment -

        Ok, if this behaviour by design... then, i think mixin ForceClientId should be in framework.

        Show
        Nikita Koksharov added a comment - Ok, if this behaviour by design... then, i think mixin ForceClientId should be in framework.

          People

          • Assignee:
            Robert Zeigler
            Reporter:
            Nikita Koksharov
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development