expanderGridPlug是dataGird组件的一个插件,主要作用是可以点击某一行展开,展示更多的内容
表 30.59. 构件信息
| Component Type | org.operamasks.faces.component.plugin.grid.impl.UIExpanderGridPlug |
| Component Family | org.operamasks.faces.component.plugin.grid.impl.UIExpanderGridPlug |
| Component Class | org.operamasks.faces.component.plugin.grid.impl.UIExpanderGridPlug |
| Tag Class | org.operamasks.faces.webapp.plugin.UIExpanderGridPlugTag |
| Renderer Type | org.operamasks.faces.component.plugin.grid.impl.UIExpanderGridPlug |
| Renderer Class(AJAX) | org.operamasks.faces.render.plugin.grid.ExpanderGridPlugRenderer |
+java.lang.Object
++javax.faces.component.UIComponent
+++javax.faces.component.UIComponentBase
++++org.operamasks.faces.component.plugin.grid.base.UIExpanderGridPlugBase
+++++org.operamasks.faces.component.plugin.grid.impl.UIExpanderGridPlug
表 30.60. 属性
| binding | 定义类 | javax.faces.component.UIComponentBase | ||
| 类型 | javax.el.ValueExpression(javax.faces.component.UIComponent) | |||
| 是否必须 | 否 | 延时求值 | 是 | |
| 一个值表达式,用于把该组件链接到一个ManagedBean的某个属性。 | ||||
| id | 定义类 | javax.faces.component.UIComponentBase | ||
| 类型 | java.lang.String | |||
| 是否必须 | 否 | 延时求值 | 否 | |
| 这个组件的组件标识符。这个值在最近的命名容器类型的父组件范围内,必须是唯一的。 | ||||
| rendered | 定义类 | javax.faces.component.UIComponentBase | ||
| 类型 | boolean(boolean) | |||
| 是否必须 | 否 | 延时求值 | 是 | |
| 一个标志,指出该组件是否要在任何随后的form提交过程中被渲染或处理。 这个属性的缺省值是true。 | ||||
下面是可扩展表格的示例代码
//----------------------xhtml页面代码---------------------
<w:dataGrid id="grid" height="500" showRowNumber="false" >
<w:outputColumn id="name" header="名称"/>
<w:outputColumn id="address" header="地址"/>
<w:outputColumn id="sex" header="性别" />
<w:outputColumn id="age" header="年龄"/>
<w:outputColumn id="incoming" header="收入"/>
<w:outputColumn id="outcoming" header="支出"/>
<w:outputColumn id="detail" hidden="true"></w:outputColumn>
<w:expanderGridPlug >
<w:expanderColumn expid="address" title="地址" render="clientRender"/>
<w:expanderColumn expid="incoming" title="收入" />
<w:expanderColumn expid="detail" title="详情"></w:expanderColumn>
</w:expanderGridPlug>
</w:dataGrid>
//------------------------liteBean代码-------------------------
@Bind(id="grid")
public List<UserEntity> getList()
{
return companys;
}
private List<UserEntity> companys = new ArrayList<UserEntity>(Arrays.asList(new UserEntity[]{
new UserEntity("luoyg","湖南","男",30,3000,4000,"自1991年World Wide Web诞生以来,这种全新的沟通方式已经彻底改变了世界,无论是政治、经济、娱乐、还是人们的日常生活。"),
new UserEntity("chenjie","湖北","男",20,8000,4000,"自1991年World Wide Web诞生以来,这种全新的沟通方式已经彻底改变了世界,无论是政治、经济、娱乐、还是人们的日常生活。"),
new UserEntity("zhoufazhi","湖北","男",28,12000,7000,"自1991年World Wide Web诞生以来,这种全新的沟通方式已经彻底改变了世界,无论是政治、经济、娱乐、还是人们的日常生活。"),
new UserEntity("zhangsan","贵州","女",28,12000,7000,"自1991年World Wide Web诞生以来,这种全新的沟通方式已经彻底改变了世界,无论是政治、经济、娱乐、还是人们的日常生活。"),
new UserEntity("lili","北京","女",28,12000,7000,"自1991年World Wide Web诞生以来,这种全新的沟通方式已经彻底改变了世界,无论是政治、经济、娱乐、还是人们的日常生活。"),
new UserEntity("liyingying","江苏","女",28,12000,7000,"自1991年World Wide Web诞生以来,这种全新的沟通方式已经彻底改变了世界,无论是政治、经济、娱乐、还是人们的日常生。")
}));
//------------------------UserEntity类-----------------------
此处只列出所包含字段
private String name;
private String address;
private String sex;
private Integer age;
private Integer incoming;
private Integer outcoming;
private String detail;