2011-05-11 23 views
1

有沒有FacesConfirmFacesMessage?我需要傳遞確認對話框而不是消息。是否有任何FacesConfirm類像FacesMessage

FacesMessage msg = new FacesMessage("The version " + version + " is already exists.", " The import data will replace the existing data."); 
FacesContext.getCurrentInstance().addMessage(null, msg); 

回答

0

不,您可以有條件地呈現<script>

<h:panelGroup rendered="#{not empty bean.confirmMessage}"> 
    <script>confirm('#{bean.confirmMessage}');</script> 
</h:panelGroup> 

或者你可以使用它使用類似的機制第三方JSF組件庫,如PrimeFaces'<p:confirmDialog>

+0

嗨BalusC,我很抱歉沒有正確描述問題。其實,我需要從服務器端發送確認對話框。我編輯了我的帖子。 – neni 2011-05-12 09:18:23

+0

我已經嘗試了上述解決方案進行確認。但是,沒有「呈現」的屬性。 – neni 2011-05-12 09:30:20

+0

所以你使用Netbeans?改爲使用''。 – BalusC 2011-05-12 11:20:20

相關問題