2015-04-01 16 views
0

我使用在SmartPanel上定義的WebDialogResult,通過調用用於提示輸入密碼的AskExt()。如何重置由AskExt()調用的Acumatica WebDialogResult中的字段?

不幸的是,它會緩存輸入的密碼,所以它會保持預填充對話框,並且每次調用對話框時我都希望它是空白的。

我試過各種不同的東西,比如調用.AskExt(true),它應該刷新對話框並在調用.AskExt()之前調用.ClearDialog()以及許多其他的東西。 Cache.Clear(),.Cache.ClearQueryCache(),.Reset(),.Update(new PwdFields()),.Delete(.Current)以及更直接的.Current.Pwd = null和.Current.Pwd =「」,但沒有任何工作。

回答

0

最終以下組合進行持續清除密碼的對話框時,它才重新顯示。

if (this.PasswordLookup1Status.AskExt(true) == WebDialogResult.OK) 
{ 
    string currentPassword = this.PasswordLookup1Filter.Current.Pwd; 
    this.PasswordLookup1Filter.Current.Pwd = ""; 
    this.PasswordLookup1Filter.Update(this.PasswordLookup1Filter.Current); 
    if (currentPassword == "1234") 
    { 
     Base.Transactions.Ask("Information", "Password [" + currentPassword + "] is correct.", MessageButtons.OK); 
     Base.Transactions.ClearDialog(); 
    } 
    else 
    { 
     throw new PXException("Password [" + currentPassword + "] is incorrect."); 
    } 
    this.PasswordLookup1Filter.ClearDialog(); 
} 
0

這是瀏覽器問題。爲了解決這個問題,我建議你在firefox或者chrome開發工具欄的幫助下找到控件的id,然後使用javascript來清除值。

然後你就可以像這樣添加的jQuery:

$(document).ready(function() { 
    $("#ctl00_phG_PXSPanelVerify2_PXFormViewVerify2_CustEdPwd2").focus() 
    { 
     $("#ctl00_phG_PXSPanelVerify2_PXFormViewVerify2_CustEdPwd2").text("");  
    } 
}); 
+0

使用IE和檢查元素來定位元件,ID =「ctl00_phG_PXSPanelVerify2_PXFormViewVerify2_CustEdPwd2」 並在內容中加入jQuery代碼,但它並沒有區別。 的 <腳本類型= 「文本/ JavaScript的」> $( 「#ctl00_phG_PXSPanelVerify2_PXFormViewVerify2_CustEdPwd2」)聚焦() { $(。 「#ctl00_phG_PXSPanelVerify2_PXFormViewVerify2_CustEdPwd2」)文本( 「」)。 } ... – BillJay 2015-04-01 13:22:39

+0

你有沒有引用jquery? – 2015-04-01 14:18:05

+0

是的,我不得不添加一個對jQuery的引用到FormDetail.master頁面的部分,因爲這是我的頁面的主人。我使用Google。 BillJay 2015-04-01 14:50:26

相關問題