JSF datatable 中使用 commandbutton 和 commandlink 的问题.
来源:互联网 发布:淘宝二手市场 编辑:程序博客网 时间:2024/05/21 05:23
我在JSF开发中遇到了一个问题。首先我的环境如下:
jsf 1.2 , myeclipce 8.5 , tomcat 6
代码如下,在datatable 外面的 commandlink 可以使用,而使用datatable 里的 commandlink 则是跳回本页,有没有大虾知道是怎么回事?
jsf coding:
<h:form id="actionForm">
<h:panelGrid styleClass="titleBackground" id="listTitle" columns="1">
<h:outputText styleClass="PrimarySubheader" id="label_GeneralProfile" value="用户搜索"></h:outputText>
</h:panelGrid>
<h:panelGrid columns="5">
<h:outputLabel value="用户名称" styleClass="outputLabel"></h:outputLabel>
<h:inputText value="#{pc_UserView.user.userName}"></h:inputText>
<h:outputText styleClass="outputLabel" value="" style="margin-left: 20px"></h:outputText>
<h:outputLabel value="用户状态" styleClass="outputLabel"></h:outputLabel>
<h:selectOneMenu value="#{pc_UserView.user.state}">
<f:selectItem itemLabel="" itemValue=""/>
<f:selectItem itemLabel="正常" itemValue="1"/>
<f:selectItem itemLabel="非正常" itemValue="2"/>
</h:selectOneMenu>
<h:outputLabel value="用户帐号" styleClass="outputLabel"></h:outputLabel>
<h:inputText value="#{pc_UserView.user.loginId}"></h:inputText>
<h:outputText styleClass="outputLabel" value="" style="margin-left: 20px"></h:outputText>
<h:commandButton id="display" value="Display." type="submit" action="#{pc_UserView.getUserList}"></h:commandButton>
</h:panelGrid>
<h:dataTable id="userTable" value="#{pc_UserView.allUsers}" var="userObj"
styleClass="dataTable" headerClass="headerClass" footerClass="footerClass"
rowClasses="rowClass1, rowClass2" border="1" cellpadding="2" cellspacing="0"
style="text-align: left" width="100%" >
<h:column id="userId">
<f:facet name="header">
<h:outputText styleClass="SecondarySubheader" value="用户标识"></h:outputText>
</f:facet>
<h:outputText value="#{userObj.userId}"></h:outputText>
<f:attribute value="180" name="width" />
</h:column>
<h:column id="userName">
<f:facet name="header">
<h:outputText styleClass="SecondarySubheader" value="用户名称"></h:outputText>
</f:facet>
<h:outputText value="#{userObj.userName}"></h:outputText>
</h:column>
<h:column id="loginId">
<f:facet name="header">
<h:outputText styleClass="SecondarySubheader" value="登录账号"></h:outputText>
</f:facet>
<h:outputText value="#{userObj.loginId}"></h:outputText>
</h:column>
<h:column id="state">
<f:facet name="header">
<h:outputText styleClass="SecondarySubheader" value="用户状态"></h:outputText>
</f:facet>
<h:outputText value="#{userObj.state == 1 ? '正常' : '非正常'}"></h:outputText>
</h:column>
<h:column id="lastUpdateDate">
<f:facet name="header">
<h:outputText styleClass="SecondarySubheader" value="最后更新时间"></h:outputText>
</f:facet>
<h:outputText value="#{userObj.lastUpdateDate}"></h:outputText>
</h:column>
<h:column id="options">
<f:facet name="header">
<h:outputText styleClass="SecondarySubheader" value="操作"></h:outputText>
</f:facet>
<h:commandLink value="Edit" action="#{pc_UserEdit.toEdit}" immediate="true" >
<f:param name="userId" value="#{userObj.userId}"></f:param>
</h:commandLink>
</h:column>
</h:dataTable>
<h:commandLink value="Edit" action="#{pc_UserEdit.toEdit}" immediate="true" >
<f:param name="userId" value="#{userObj.userId}"></f:param>
</h:commandLink>
</h:form>
- JSF datatable 中使用 commandbutton 和 commandlink 的问题.
- JSF 中Datatable 上的commandLink失效问题
- JSF中CommandButton与CommandLink传值
- JSF的commandButton、commandLink、outputLink用法小结
- JSF的commandButton、commandLink、outputLink分析
- commandButton 和 commandLink 的区别
- 【Primefaces】commandButton/commandLink的一些注意问题
- JSF的commandButton、commandLink、outputLink用法小结<转>
- jsf primefaces中commandbutton刷新页面bug,lazymodel的datatable查询及重置问题
- JSF中的commandButton、commandLink、outputLink用法
- jsf dataTable 中"<h:commandLink"有时不生效分析
- DataGrid和DataList中CommandButton的问题
- DataGrid和DataList中CommandButton的问题
- h:commandbutton 和 h:commandlink 比较
- JSF中使用a4j:commandButton和a4j:jsFunction实现校验,操作后刷新
- JSF与ajax使用h:messages 在commandButton上交互的问题以及在JSF前端使用ENUM数据类型
- sf中rich:dataTable中的h:commandlink提交无效问题
- sf中rich:dataTable中的h:commandlink提交无效问题
- tomcat连接池泄露的监控和解决
- Js实现设为首页和加入收藏功能
- BOMRemover v2.0 去除代码中的UTF-8 BOM
- PYTHON多线程同步的几种方法
- 我现在需要一个VB.NET(2008的)+SQL2000(做后台的)管理系统
- JSF datatable 中使用 commandbutton 和 commandlink 的问题.
- 修改XP中IIS连接数的正确方法
- 根据STATUS信息对MySQL进行优化
- PHP牛气冲天:PHP是什么?为什么要学习PHP?
- Hibernate中集合类型和结果集排序
- SQL语句查看SQL Server的版本信息
- Qtopia移植
- 聚合关系
- 利用makefile的语法功能,查看Android中Android.mk里面的变量的值