Steps to reproduce:
- Have a server running (Nuxeo OOTB is fine)
- Connect to it; navigate to a container where you can create a File (Workspace or Folder, typically)
- Open nxserver/nuxeo.war/ui/document/nuxeo-file-create-layout.html
- In the script, add this validate function, after the properties object:
. . . properties: { document: Object }, validate: function() { console.log("Validate"); return true; } . . .
- Shift-Reload the page
- Display the creation dialog
- Show the WebInspector, in the Console tab
- Create a new File document, setup the title, click the "Create" button
- See "validate" is displayed twice.
Environment is Nuxeo 10.10 with HF04
Workaround involves a flag, it's not elegant , and more importantly, maybe it reveals some performance/logic issues:
properties: { document: Object, validateDoneOnce: { type: Boolean, value: false } }, validate: function() { if(!this.validateDoneOnce) { console.log("Validate"); this.validateDoneOnce = true; } return true; }