the upload control doesn't make the model recalculate, revalidate or refresh after it updates the bound node. So controls also bound to the instance data don't refresh with the new value and xforms-value-changed event isn't fired.
Created attachment 188817 [details] testcase changing the value of the upload filename field and then tabbing should change the value of the output field and generate a xforms-value-changed message
Created attachment 188818 [details] [diff] [review] proposed fix just added the appropriate checks to make sure that the node value actually got changed and then dispatched the events for recalc, etc. Once upload is xbl-ized, this will need to be done in ::SetValue instead of ::Blur. Just like in nsXFormsInputElement.cpp. But this will work just dandy for now.
(In reply to comment #2) > Created an attachment (id=188818)  > proposed fix > In Linux I get the xforms-value-changed message and the <output> shows that the value is file:// when I first time click the |browse...| button. Then I get the event second time when actually selecting some file. On the second time I don't see the extra xforms-value-changed event when clicking |browse...|, apparently because the upload already has a value - i.e. xforms-value-changed does work properly this time.
(In reply to comment #3) > (In reply to comment #2) > > Created an attachment (id=188818)   > > proposed fix > > > > In Linux I get the xforms-value-changed message and the <output> shows that the > value is file:// when I first time click the |browse...| button. > Then I get the event second time when actually selecting some file. > > On the second time I don't see the extra xforms-value-changed event > when clicking |browse...|, apparently because the upload already has a value - > i.e. xforms-value-changed does work properly this time. > > Thanks for catching this smaug! I don't think that I see the problem as you describe it, but I recreated it another way. If I click on browse and then cancel it without changing anything (so that the input field is still blank) and then tab, then I see the output update with "file:///" and get the xforms-value-changed event. The problem is that in nsXFormsUpdateElement::Blur(), we get the value from the input field and then call NS_GetURLSpecFromFile and then I set the boundNode to have this value and the MDG comes back and says whether this is a change or not. If it is a change, then I'll send out the proper recalculate, revalidate and refresh events. Well, the problem with this logic is that if the input field is initially blank and we call NS_GetURLSpecFromFile, it will still return us "file:///". So if we go ahead and set the bound node to have this value, then of course the MDG will tell me that the value has changed. Doh! I'll update my patch.
Created attachment 189985 [details] [diff] [review] second try fixed bug noticed by smaug. Also noticed a couple of console errors that were happening in ::Refresh when mBoundNode hadn't been set, yet, so fixed them up.
Attachment #189985 - Flags: review?(smaug) → review+
Attachment #189985 - Flags: review?(doronr)
doron, could you please check it in for me?
Status: ASSIGNED → RESOLVED
Last Resolved: 13 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.