---
title: "icefaces使用经验_ice:panelPopup"
author: "iamlibo"
date: "2007-09-05T09:50:00Z"
tags: []
slug: "icefaces-ice-panelpopup"
draft: false
lastmod: "2007-09-05T09:50:00Z"
id: 274401
url: "https://iamlibo.iteye.com/blog/274401"
---

ice:panelPopup是icefaces组件中模式(modal)对话框的组件.使用起来也非常简单.

先看代码:

&lt;ice:panelPopup id="affirmDel" rendered="true" visible="#{purchasePlanBean.confirmDel}" modal="true"  
style="z-index:1001; width: 350px; height: 200px; top:25%; left:25%;"&gt;  
&lt;f:facet name="header"&gt;  
&lt;ice:outputText styleClass="popupTitle" value="#{resource.confirm\_title }" /&gt;  
&lt;/f:facet&gt;  
&lt;f:facet name="body"&gt;

这里是body的内容

&lt;/f:facet&gt;  
&lt;/ice:panelPopup&gt;

visible属性:是表示什么时候显示该对话框,一般是bean中的一个boolean变量的值，然后通过其他按钮的动作改变这个变量的值来显示对话框。

modal属性：表示对话框是否模式显示。

&lt;f:facet name="header"&gt;&lt;/f:facet&gt;中的内容是对话框的标题

&lt;f:facet name="body"&gt;&lt;/f:facet&gt;中的内容是对话框的显示内容。可以为JSF允许的任何内容。

如果对话的body的内容需要一个form，这时应该把一个form标签放到body内部。而不是放到&lt;ice:panelPopup&gt;这个标签的外部。如果放到外部在有多少个form 的情况下会出现对话框都被遮盖起来的情况，导致页面不能使用了。

Technorati : [icefaces](http://technorati.com/tag/icefaces), [jsf](http://technorati.com/tag/jsf)