save() method on datasource does not fire querySave/postSave events

前端 未结 2 705
时光取名叫无心
时光取名叫无心 2021-01-01 06:10

My save button uses SSJS with some logic. I want to save datasource, so I use

document1.save();

Script works, but querySave/postSave code is not

相关标签:
2条回答
  • 2021-01-01 06:54

    Sven what is the difference between your code and currentDocument.save() is something else happening than querysave and postsave?

    0 讨论(0)
  • 2021-01-01 07:05

    please try this SSJS code:

    var dsName = "document1.DATASOURCE";
    var app = facesContext.getApplication();
    var ds = app.getVariableResolver().resolveVariable(facesContext, dsName);
    ds.save( facesContext, true );
    

    The variable dsName contains the name of your datasource followed by ".DATASOURCE". To use it f.e. with current document, you have to change to "currentDocument.DATASOURCE".

    Hope this helps

    Sven

    0 讨论(0)
提交回复
热议问题