Menu

#37 cannot change attribute values

open
None
7
2010-08-11
2010-08-10
No

Possibly related to 3039052.

In dataisland branch r445, setvalue (and as a result for controls) cannot set attribute values.

Discussion

  • Leigh L. Klotz, Jr.

    example shows elements work but attrs fail

     
  • Leigh L. Klotz, Jr.

    • priority: 5 --> 7
     
  • Leigh L. Klotz, Jr.

    It seems that XFModel.prototype.addChange is only handling changes to elements.

    Here's a workaround built with little understanding of why this was the case:

    XFModel.prototype.addChange = function(node) {
    var list = xforms.building? this.newNodesChanged : this.nodesChanged;

    if \(\!inArray\(node, list\)\) \{
        xforms.addChange\(this\);
    \}
    while \(\(\(node.nodeType == NodeType.ELEMENT\) || \(node.nodeType == NodeType.ATTRIBUTE\)\) && \!inArray\(node, list\)\) \{
        list.push\(node\);
    

    if (node.nodeType == NodeType.ATTRIBUTE)
    node = node.ownerElement;
    node = node.parentNode;
    }
    };

     
  • Leigh L. Klotz, Jr.

    It seems that XFModel.prototype.addChange only records changes to Elements.

    Here's a workaround, written without understanding of why addChange was behaving that way in the first place:

    XFModel.prototype.addChange = function(node) {
    var list = xforms.building? this.newNodesChanged : this.nodesChanged;

    if \(\!inArray\(node, list\)\) \{
        xforms.addChange\(this\);
    \}
    while \(\(\(node.nodeType == NodeType.ELEMENT\) || \(node.nodeType == NodeType.ATTRIBUTE\)\) && \!inArray\(node, list\)\) \{
        list.push\(node\);
    

    if (node.nodeType == NodeType.ATTRIBUTE)
    node = node.ownerElement;
    node = node.parentNode;
    }
    };

     
  • Leigh L. Klotz, Jr.

    diff showing proposed workaround described in notes

     
  • Leigh L. Klotz, Jr.

    Please review.

     
  • Leigh L. Klotz, Jr.

    • assigned_to: nobody --> alain-couthures
     
Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.