开发者

Is there any FacesConfirm class like FacesMessage

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>.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜