Transitioning to XPage development with Java only. I've successfully put together a XPage with a form and bound all UI components to a managed bean. I created a save method in the bean. I am able to Submit the XPage, a document is created and the browser displays the XPage after the full refresh with the current values in the Bean. If I click Save repeatedly, a new document is always created, the first document that was created was never updated.
My question, what is the proper way to map the XPage to the current document so the bean always updates the document rather than always creating a new one?
Should I create a Bean member Document so the first time the document is saved, I keep a handle to it? does that mean I do not recycle the doc object after creation?
Should I lookup the doc every time when saving the unid? Performance issue?
Any one have a good programming pattern? Using Notes 9, no data source defined on the XPage.