根本没有调用richFaces fileUploadListener

时间:2014-03-11 12:15:31

标签: file-upload richfaces

我使用richfaces fileUpload上传xls文件。下面是用于上传内容的代码丰富的模式面板

<rich:modalPanel id="cashflowImportPanel" width="360" height="150"
                zindex="500" autosized="true">

                <f:facet name="header">
                    <h:outputText value="Confirm" />
                </f:facet>

                <f:facet name="controls">
                     <h:graphicImage value="../../static/images/close.jpg" style="cursor:pointer" onclick="Richfaces.hideModalPanel('cashflowImportPanel')"  />     
                </f:facet>

            <h:panelGroup id="cashflowimportpanelGrp">

                    <h:outputText value="#{bundle['cashflowImportSupportedFiles.label']}" />                    

                        <rich:fileUpload 
                        maxFilesQuantity="1" 
                        immediateUpload="true" 
                        acceptedTypes="xls"
                        id="fileUploadComp" 
                        listHeight="63px" 
                        listWidth="350px"
                        fileUploadListener="#{fileImportBean.importFile}"
                        uploadData="#{fileImportBean.uploadedData}" 
                        allowFlash="false">
                        <a4j:support 
                        event="onclear" 
                        action="#{fileImportBean.importFile}" 
                        />
                       </rich:fileUpload>
            <rich:spacer height="30"/>

                <s:selectOneMenuAjax
                 prop="selectedForecastMonth"
                 key="forecastMonthForImport" 
                 bean="#{cflowForecastBean.cashflowForecast}"
                 id="forecastMonthIdForImport" 
                 selectItems="#{cflowForecastBean.forecastMonth}" 
                 req="true"
                 actionBean="#{cflowForecastBean}" 
                 method="getForecastCycleMonth" 
                 />                         
                <a4j:commandButton 
                    id="importBtn"
                    oncomplete="#{rich:component('cashflowImportPanel')}.hide();"
                    action="#{fileImportBean.saveFileExportImport}"
                    value="#{bundle['import.label']}"
                    styleClass="button"
                    status="waitStatus" 
                    reRender="importBtn,msgPanelGrp">
                            <f:setPropertyActionListener value="xls"
                                target="#{fileImportBean.importFileType}" />
                        </a4j:commandButton>
                <a4j:commandButton
                            onclick="#{rich:component('cashflowImportPanel')}.hide();"
                            value="#{bundle['no.label']}" 
                            styleClass="button"
                            immediate="true" />

            </h:panelGroup>

    </rich:modalPanel>

和bean

public void importFile(UploadEvent event) {
    --------
}

但是我根本没有调用fileUploadListener。我使用richFaces 3.3.1和tomcat 6.X服务器。同样的功能在我的项目的其他部分工作正常但在这种情况下不能正常工作。任何人都可以帮忙吗?

0 个答案:

没有答案