How to display a confirmation dialog(Primefaces) from backing bean

前端 未结 4 1641
名媛妹妹
名媛妹妹 2021-01-12 12:04

I have an import function which will parse the XML file which contains the version information of the document and save it in database. If user try to upload the already exi

4条回答
  •  温柔的废话
    2021-01-12 12:51

    It's not possible to get confirmation from the client during processing on server.

    You have two options:

    1. Get overwrite permission before calling your action method e.g. with a checkbox "Overwrite file if exists?" or

    2. You have to stop processing, set a flag and return null to reload current page in browser. Then you could display the p:dialog depending on flag status.

提交回复
热议问题