This content has been marked as final.
Show 1 reply
-
1. Re: How to model non-scalar columns in dataTable/subTable?
dkarr Jan 9, 2008 7:24 PM (in response to dkarr)If anyone is thinking about this, I'm sort of getting close, but it still isn't quite right. I've kludged this with one header with the text "Host Name / CPU Count / Platform", but that's obviously not optimal. I can't figure out how to have proper headers for the nested table, but with all headers in the table in the headers for the main table.
The following is my current page:<%@ taglib uri="http://richfaces.org/a4j" prefix="a4j"%> <%@ taglib uri="http://richfaces.org/rich" prefix="rich"%> <%@ taglib uri="http://java.sun.com/jsf/html" prefix="h"%> <%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%> <% System.out.println("Got here."); %> <html> <head> <title>WebLogic License Manager</title> </head> <body> <f:view> <a4j:form> <a4j:commandLink id="save" reRender="projectsTable" value="Save"/> <a4j:commandLink id="add" action="#{projectManager.addProject}" reRender="projectsTable" value="Add"/> <rich:dataTable id="projectsTable" value="#{projectManager.projects}" title="Projects" var="project" frame="border" rules="all" rowKeyVar="rowNum" onRowMouseOver="this.style.backgroundColor='#F1F1F1'" onRowMouseOut="this.style.backgroundColor='#{a4jSkin.tableBackgroundColor}'"> <f:facet name="caption"> <h:outputText value="Projectse"/> </f:facet> <rich:column> <f:facet name="header"> <h:outputText value="Name"/> </f:facet> <h:inputText value="#{project.name}" size="#{projectManager.maxNameLength}"/> </rich:column> <rich:column> <f:facet name="header"> <h:outputText value="Department"/> </f:facet> <h:inputText value="#{project.department}" size="#{projectManager.maxDepartmentLength}"/> </rich:column> <rich:column colspan="3"> <f:facet name="header"> <h:outputText value="Host Name / CPU Count / Platform"/> </f:facet> <rich:dataTable value="#{project.servers}" title="Servers" var="server"> <rich:column> <h:inputText value="#{server.hostName}"/> </rich:column> <rich:column> <h:inputText value="#{server.cpuCount}"/> </rich:column> <rich:column> <h:inputText value="#{server.platform}"/> </rich:column> </rich:dataTable> </rich:column> <rich:column> <f:facet name="header"> <h:outputText value="Ops"/> </f:facet> <a4j:commandLink action="#{projectManager.addAboveProject}" reRender="projectsTable" value="[Add Above]"> <f:param name="rowNum" value="#{rowNum}"/> </a4j:commandLink> <a4j:commandLink action="#{projectManager.addBelowProject}" reRender="projectsTable" value="[Add Below]"> <f:param name="rowNum" value="#{rowNum}"/> </a4j:commandLink> <a4j:commandLink action="#{projectManager.deleteProject}" reRender="projectsTable" value="[Delete]"> <f:param name="rowNum" value="#{rowNum}"/> </a4j:commandLink> </rich:column> </rich:dataTable> </a4j:form> </f:view> </body> </html>