ICEfaces
  1. ICEfaces
  2. ICE-9236

FileEntry Component causes always updates in partial response

    Details

    • Type: Bug Bug
    • Status: Open
    • Priority: Major Major
    • Resolution: Unresolved
    • Affects Version/s: 3.3
    • Fix Version/s: None
    • Component/s: Framework
    • Labels:
      None
    • Environment:
      Windows 7, Tomcat 7

      Description

      If there is a FileEntry component in the component tree it is always returned as to be updated by the DOM Differ.

      The FileEntry is rendered in the DOM as <input type="file" ...

      Reason:
      org.icefaces.impl.context.DOMPartialViewContext.applyBrowserChanges(Map, Document)
      line 400ff.
      This method adds the value attribute for all input elements, if it is missing.
      But there is generally no "value" attribute allowed for type "file" input tags (for security reasons).

      This leads to the differences in the old and new DOM tree in the render phase:

      org.icefaces.impl.util.DOMUtils.compareAttributes(Node, Node)
      line 937ff.
      oldMap: [id="frmCreateProgramSet:objectFileEntryComp::vjj34sb", name="frmCreateProgramSet:objectFileEntryComp::vjj34sb", tabindex="0", type="file", value=""]
      newMap: [id="frmCreateProgramSet:objectFileEntryComp::vjj34sb", name="frmCreateProgramSet:objectFileEntryComp::vjj34sb", tabindex="0", type="file"]

      Fix suggestion:
      Do not set value attribute for input elements of type "file" in DOMPartialViewContext l. 407

      if (!inputElement.getAttribute("type").equals("file")) {
       inputElement.setAttribute("value", "");
      }

        Activity

        There are no comments yet on this issue.

          People

          • Assignee:
            Unassigned
            Reporter:
            Sebastian Fischer
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated: