In the <upload> element, if the dataype of the node the element is bound to changes, then the file data should be reset. That is, if the <upload> element is bound to datatype of "anyURI", selecting a file sets the path URL in the node. If the dataype changes to "base64Binary", then the file contents should be encoded and set in the instance node, without having the user select the file again. Or, if the dataype is set to an invalid datatype (not one of "anyURI", "base64Binary", or "hexBinary"), then the instance data should be cleared.
Created attachment 200758 [details] Testcase Allan's testcase from bug 275453, but added a "none" selection.
should we generalize this bug even further and say that if the MDG detects that the type of an instance node changes then the control(s) bound to that instance node should be refreshed? It isn't quite the same thing as this bug was originally on, because most controls bound to a data type won't actually change the instance data based on that type so if they miss out on knowing the datatype changed, then it isn't quite that big of deal. It is just how the data is represented to the user. Whereas with this instance of upload, the actual submitted data could be affected by such a type change. But this bug got me thinking that maybe if we DID refresh controls when the type changes, then upload would just need to handle this during refresh.
Created attachment 209648 [details] testcase for input control bound to a changeable type In case we persue my thought on changing control types, then here is a testcase for it.
(In reply to comment #2) > should we generalize this bug even further and say that if the MDG detects that > the type of an instance node changes then the control(s) bound to that instance > node should be refreshed? Yes, I think we should. But it should not be an xforms-refresh. Either we should call a function directly, or have an mozilla-xforms-datatype-change-whatever-blah event.
I took a decision for this in bug 313315. Now, we just do a normal rebind (and refresh). Marking this bug WONTFIX. If there is a need for something more / different, this can be reopened.