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

前端 未结 4 1613
名媛妹妹
名媛妹妹 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:33

    You are facing in typical Primefaces Problem.

    When your page is displayed and buttonBean.showConfirm = false, this element is not rendered. This means, it will not appear in the DOM-Tree. No matter what you do afterwards, a non existing element cannot be shown or hidden.

    There are actually two ways to solve you problem.

    1. Use a remote command, so that the not rendered HTML-Code will be transmitted from you server.
    2. Use css "display: none" instead of rendered="false".

提交回复
热议问题