Tapestry
  1. Tapestry
  2. TAPESTRY-2343

The FormInjector should copy its class attribute to the new element (on the client side)

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 5.0.11
    • Fix Version/s: 5.0.12
    • Component/s: tapestry-core
    • Labels:
      None

      Description

      When the FormInjector duplicates its element, it should duplicate attributes as well. Particularly important is the CSS class attribute.

      Originally, this was supposed to copy all attributes except "id", but so far, haven't found a way to do that. Just copying the CSS class attribute is sufficient for my purposes.

        Activity

        Hide
        Howard M. Lewis Ship added a comment -

        So far, I haven't seen a way to enumerate the attributes of an element in JavaScript. For the moment, we'll just copy over the CSS class (selfishly, that's the use case I personally need).

        Show
        Howard M. Lewis Ship added a comment - So far, I haven't seen a way to enumerate the attributes of an element in JavaScript. For the moment, we'll just copy over the CSS class (selfishly, that's the use case I personally need).
        Hide
        Davor Hrg added a comment -

        this could help,
        I haven tested it on multiple browsers... or any browsers...

        quote:

        cloneNode(deepBoolean)

        Duplicates and returns a copy of the current node as a standalone node (not part of document tree). Cloning a node copies both the original's attributes and values, including the ID attribute, so be sure to alter the cloned ID attribute's value so it's unique before introducing it to the document tree. This method supports a single Boolean parameter, "deepBoolean" that when set to true, clones all the sub nodes of the current node as well, such as any text contained within.

        Show
        Davor Hrg added a comment - this could help, I haven tested it on multiple browsers... or any browsers... quote: cloneNode(deepBoolean) Duplicates and returns a copy of the current node as a standalone node (not part of document tree). Cloning a node copies both the original's attributes and values, including the ID attribute, so be sure to alter the cloned ID attribute's value so it's unique before introducing it to the document tree. This method supports a single Boolean parameter, "deepBoolean" that when set to true, clones all the sub nodes of the current node as well, such as any text contained within.

          People

          • Assignee:
            Howard M. Lewis Ship
            Reporter:
            Howard M. Lewis Ship
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development