2016-12-16 118 views
0

我在我的Xpage上有一個文檔數據源,我綁定了字段。有些是必需的。當我保存數據源併發生驗證錯誤時,下面的代碼在部分刷新上不再起作用。驗證錯誤document.setValue(「value」)不再有效

document.setValue("key","value"); 

這是我的局部刷新電話:

XSP.partialRefreshGet('#{id:refreshContactInfos}', {params: { 'reference': this.value, 'disableValidation':true}}); 

在使用id =「refreshContactInfos」股利我有一個隱藏字段,應設置字段的值來填充他們。

有什麼建議嗎?

回答

0

更改XSP.partialRefresh 獲取到XSP.partialRefresh 爲我工作。

XSP.partialRefreshPost('#{id:refreshContactInfos}', {params: { 'reference': this.value, 'disableValidation':true}}); 
0

答案在JSF生命週期中。我認爲你的部分刷新不會因爲驗證錯誤(任何地方)而更新數據。

在這裏尋找在XSP調用中禁用驗證(有點哈克的方式)。 How to disable validators using the XSP.partialRefreshPost method?

另一種解決方案是通過禁用驗證(不可見按鈕)來調用普通事件,而不是調用XSP對象。