Я сделал dataTable, он работает .. и я использую Richfaces 4.0.пожалуйста, сообщите мне, если вы используете любую другую версию ...
Ниже приведен код, который работал
<rich:dataTable id="userlisttable" value="#{adminBean.userList}"
var="user" style="width:100%">
<rich:column id="banDate" headerClass="dataTableHeader"
label="Ban date" sortable="true" sortBy="#{user.userId}"
sortIconAscending="dataTableAscIcon"
sortIconDescending="dataTableDescIcon">
<f:facet name="header">
<h:outputText value="Ban Date" />
</f:facet>
<h:outputText value="#{user.userId}" />
</rich:column>
<rich:column id="actions" headerClass="dataTableHeader"
label="Actions" sortable="false">
<f:facet name="header">
<h:outputText value="Actions" />
</f:facet>
<h:panelGrid columns="4">
<h:outputText value="Ban user for" />
<a4j:commandLink action="#{adminBean.banUser}" value="One week"
style="font-size:16px" render="banDate" >
<f:setPropertyActionListener target="#{adminBean.user}"
value="#{user}" immediate="true" />
</a4j:commandLink>
</h:panelGrid>
</rich:column>
</rich:dataTable>
</h:form>
</rich:panel>
AdminBean:
import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
import javax.faces.bean.ManagedBean;
import javax.faces.bean.ViewScoped;
@ManagedBean(name="adminBean")
@ViewScoped
public class AdminBean implements Serializable {
/**
*
*/
private static final long serialVersionUID = -5338764155023244249L;
private List<UserBean> userList;
private UserBean user;
/**
* @return the user
*/
public UserBean getUser() {
return user;
}
/**
* @param user the user to set
*/
public void setUser(UserBean user) {
this.user = user;
}
/**
* @return the userList
*/
public List<UserBean> getUserList() {
return userList;
}
/**
* @param userList the userList to set
*/
public void setUserList(List<UserBean> userList) {
this.userList = userList;
}
public AdminBean() {
UserBean user1= new UserBean();
user1.setUserId("1");
user1.setUserName("userName1");
UserBean user2= new UserBean();
user2.setUserId("2");
user2.setUserName("userName2");
userList = new ArrayList<UserBean>();
userList.add(user1);
userList.add(user2);
}
public void banUser(){
if(user !=null){
user.setUserId("Rendered id R1");
}
}
}
UserBean:
import java.io.Serializable;
public class UserBean implements Serializable {
/**
*
*/
private static final long serialVersionUID = 3820279264217591645L;
private String userName;
private String userId;
/**
* @return the userName
*/
public String getUserName() {
return userName;
}
/**
* @param userName the userName to set
*/
public void setUserName(String userName) {
this.userName = userName;
}
/**
* @return the userId
*/
public String getUserId() {
return userId;
}
/**
* @param userId the userId to set
*/
public void setUserId(String userId) {
this.userId = userId;
}
}