2014-10-08 58 views
0
清除按钮问题

我们从JSF 1.2升级到JSF 2.丰富:文件上传extrenal在IE8

我们使用Apache MyFaces的2.1和丰富的面孔4.3.5

我们正面临跌破发行丰富: 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)当点击清除按钮,用于点击数脚本,#{rich:component('upload')}.clear(); IE的控制台给出误差为:Object doesn't support this property or method和动作方法不调用。当再次单击相同的按钮时,操作方法被调用。

2)当这个脚本被删除时,没有观察到这个错误。但是,对于操作方法,可以观察到相同的行为。只有在清除按钮单击两次时才会调用操作方法。

有没有人遇到过这样的问题? 任何人都可以请帮忙解决这个问题?

回答

1

4.3.x中的fileUpload没有clear()方法,因为错误告诉你。改为使用removeAllItems()

+0

感谢您的回答。我会尽量修复并更新帖子。同时,有没有文件解释Rich Faces 4.3更改的Java脚本方法的链接? – Atul 2014-10-08 13:10:11

+0

我们有[迁移指南](https://developer.jboss.org/wiki/RichFacesMigrationGuide33x-4xMigration),但我无法保证所有内容都被覆盖。 – Makhiel 2014-10-08 13:15:31