<%@ taglib uri="http://richfaces.org/a4j" prefix="a4j"%>
<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %>
<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
<%@ taglib uri="http://labs.jboss.com/jbossrichfaces/ui/dataTable" prefix="dt"%>
<%@ taglib prefix="columns" uri="http://labs.jboss.com/jbossrichfaces/ui/columns" %>



<html>
	<head>
		<title></title>
	</head>
	<body>
	<f:view>
	<h:form>
	
	Columns: <h:inputText value="#{bean.columnsCountStr}"></h:inputText> <br/>
	Rows: <h:inputText value="#{bean.rowCountStr}"></h:inputText> <br/>
		 	
	
	<a4j:commandButton value="Submit" action="#{bean.jsp}" reRender="tb"></a4j:commandButton>
	
	<br/>
	
	
	<dt:dataTable value="#{bean.model}" var="var" id="tb">
		<columns:columns value="#{bean.columns}" var="col" index="counter"
		 style="color: Green;">
			<f:facet name="header">
				<h:outputText value="#{col.header}"></h:outputText>
			</f:facet>
			<f:facet name="footer">
				<h:outputText value="#{col.footer}"></h:outputText>
			</f:facet>
			<h:outputText value="#{var[counter]}"></h:outputText>
			<h:inputText value="#{var[counter]}"></h:inputText>
		</columns:columns>
	</dt:dataTable>
	
	<dt:dataTable value="#{bean.model}" var="var" id="tb2">
		<columns:columns end="#{bean.columnsCountStr}" var="col" index="counter"
		 style="color: Red;" width="100px;">
			<h:outputText value="#{var[counter]}"></h:outputText>
		</columns:columns>
	</dt:dataTable>
		 	
			
	</h:form>	
		</f:view>
	</body>	
</html>  
