XPages: how to have multiple submit buttons for multiple data sources on the same page?
Julian Buss, May 26th, 2009 15:03:55
I came across the following problem, perhaps someone has an idea?
I have a XPage with two document data sources. Field A is bound to the first source, field B to the second.
Beside field A I want to have a button "save", and beside field B, too. When the user hits the first button, ONLY the first data source should be saved. When the user hits the other button, ONLY the other data source should be saved.
When both buttons are submit buttons, then always both sources are saved, resulting in an "empty" document for the other data source. When both buttons are standard buttons and I write a onclick handler with datasource.save(), I can save the sources individually.
BUT: after saving I want NEW documents to be created, so that the next button click saves into a new document.
So what I miss is a "reset" or "create" method for the NotesXSPDocument. The only workaround I found so far is to reload the whole page using context.reload(). That works, but is not nice.
Any other hints?