As you dig deeper into XPages, sometimes you find strange behaviour. My approach (once I can reproduce it) is the same as with any complex problem I encounter in support. First I strip it down to the bare minimum and see if it still happens. Then I add, one by one, anything that’s extra or more complex until I can isolate whatever is causing the problem. Or in the words of Sir Arthur Conan Doyle (from the mouth of Mycroft Holmes) “When you have eliminated the impossible, whatever remains, however improbable, must be the truth.”
In this case, I am implementing the file upload along the lines of the one in the XPages wiki template. All works as expected in that implementation. But when I tried to implement it in my application it failed. By a process of deductive reasoning, I’ve identified that it’s a conflict between functionality of editable areas and either file upload or full refreshes. If the file upload is in a custom control that is placed in an editable area, I get my problem: the first time I upload a file, nothing happens; the second time and all subsequent times, the files upload successfully.
If the custom control is not placed in an editable area, files upload from the first attempt. Here are links to a sample of the file upload in an editable area and the file upload not in an editable area.
Does anyone know why this is happening, or if it’s possible to get the files uploading at the first attempt?
In the meantime I have the workaround of rewriting the source code in an XPage is such a way that I don’t need to use an editable area. But that’s diluting to some extent the power of custom controls, and not particularly scalable.
I thought that these problems of embedding a custom control were corrected with fix pack 1 for the 8.5.1 server and client. Are you running with the fix pack installed?
Thanks Tony, great call. I thought the server was FP1, but after checking, it’s not. I’ve found a server that is FP1 and, as you say, it is corrected.