簡體   English   中英

rich:fileUpload外部的IE8清除按鈕問題

[英]rich:fileUpload extrenal Clear button issue on IE8

我們正在從jsf 1.2升級到jsf 2。

我們正在使用Apache Myfaces 2.1和Rich Faces 4.3.5

我們正面臨Rich:fileUplaod的以下問題。 下面是代碼:

<h:form id="loadUsersForm">


 <h:panelGrid columns="1">

    <rich:fileUpload id="upload" 
                     acceptedTypes="csv"
                     immediateUpload="true" 
                     maxFilesQuantity="1" 
                     listHeight="0px" 
                     fileUploadListener="#{bean.uploadFile}"
                     addLabel="Ad File" 
                     uploadLabel="Upload">

            <a4j:ajax event="uploadcomplete" 
                      execute="@this" 
                      render="fText,clearButton" />
            <f:facet name="progress">
                <rich:progressBar style="display:none;"/>
            </f:facet>

    </rich:fileUpload>

    <h:commandButton id="clearButton" 
                     action="#{bean.clear}"  
                     onclick="#{rich:component('upload')}.clear();" 
                     value="Clear" />
 <h:panelGrid/>

</h:form>

如上面的代碼所示,我們使用另一個按鈕清除上傳的文件。 僅在IE8上(啟用了兼容視圖模式)觀察到以下問題:

1)單擊清除按鈕時,對於onlick腳本, #{rich:component('upload')}.clear(); IE控制台顯示錯誤消息: Object doesn't support this property or method並且未調用action方法。 再次單擊同一按鈕時,將成功調用操作方法。

2)刪除此腳本后,不會觀察到此錯誤。 但是觀察到動作方法的行為相同。僅在兩次單擊清除按鈕時才調用該動作方法。

有人遇到過這樣的問題嗎? 誰能幫助解決這個問題?

錯誤提示您,4.3.x中的fileUpload沒有clear()方法。 使用removeAllItems()代替。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM