Search code examples
xpagesxpages-ssjs

Values from Edit Box controls not saved on Notes Document via SSJS


On an custom control I have data-source bounded to a panel control:

<xp:panel>
<xp:this.data>
    <xp:dominoDocument var="attachDoc" formName="fAttachment"></xp:dominoDocument>
</xp:this.data>
...
</xp:panel>

Within the panel I have some Edit Box controls e.g.

<xp:inputText id="inpOfficial" value="#{attachDoc.migration}">

When I try to save the doc via SSJS the edit boxes are not saved:

function saveAttachment(){
    try {   
        var doc:NotesDocument = attachDoc.getDocument();
        doc.save();
    }
}

What am I missing?

The custom control is repeated over the xpage. The custom control has it's own save button calling the saveAttachment() function


Solution

  • Your saveAttachment() function appears to be trying to save a back end notes document on the database. To pass through the changes in the UI you need to run attachDoc.save() which passes the NotesXSPDocument (UI doc) through to the back end NotesDocument saved to the database.

    (Assuming your try statement has a catch but you've left that out)

    https://www.ibm.com/support/knowledgecenter/en/SSVRGU_9.0.1/reference/r_wpdr_xsp_xspdocument_r.html