首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Primefaces FileUpload使用p:remoteCommand调用指定方法

Primefaces FileUpload使用p:remoteCommand调用指定方法
EN

Stack Overflow用户
提问于 2017-11-23 16:03:17
回答 0查看 684关注 0票数 0

在Primefaces 6.0中,我需要在上传文件之前对其进行处理,当我完成按下浏览按钮时,我会尝试调用另一个方法。我尝试使用remoteCommand,但它不起作用。

代码语言:javascript
复制
<p:fileUpload allowTypes="/(\.|\/)(csv|zip)$/"
        value="#{geoDataBean.file}" mode="simple" oncomplete="loadCountries();"
        update="countriesDropdownPanel">
</p:fileUpload>

<p:remoteCommand name="loadCountries" process="@this"
        action="#{geoDataBean.loadCountries()}"/>       

<h:panelGroup id="countriesDropdownPanel">
    <p:selectCheckboxMenu 
            widgetVar="countryCode" 
            id="countryCodeId"
            value="#{geoDataBean.selectedCountryCodes}"
            label="#{geoDataBean.label}" 
            multiple="true"
            panelStyle="width:198px">
        <p:ajax 
                event="toggleSelect" 
                update="countryCodeId"
                listener="#{geoDataBean.update}" />
        <f:selectItems value="#{geoDataBean.countryCodeList}" />
    </p:selectCheckboxMenu>
</h:panelGroup>

<h:commandButton value="Import" action="#{geoDataBean.importGeoData}" />

我需要在导入之前处理文件,因为我需要查看文件中存在哪些国家/地区来导入它们。

我使用UploadedFile。

EN

回答

页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/47450343

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档