Is there any FacesConfirm
like FacesMessage
? I need to pass a confirmation dialog inste开发者_运维知识库ad of message.
FacesMessage msg = new FacesMessage("The version " + version + " is already exists.", " The import data will replace the existing data.");
FacesContext.getCurrentInstance().addMessage(null, msg);
No. You could however render a <script>
conditionally.
<h:panelGroup rendered="#{not empty bean.confirmMessage}">
<script>confirm('#{bean.confirmMessage}');</script>
</h:panelGroup>
Or you could use a 3rd party JSF component library which uses similar mechanism, such as PrimeFaces' <p:confirmDialog>
.
精彩评论