Author: yradtsevich
Date: 2008-10-20 10:47:54 -0400 (Mon, 20 Oct 2008)
New Revision: 11001
Added:
trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/resources/richFacesTest/WebContent/pages/components/subTable.xhtml
trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/resources/richFacesTest/WebContent/pages/components/subTable.xhtml.xml
Modified:
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesDataTableTemplate.java
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesSubTableTemplate.java
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsf2test/WebContent/index.html
trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/src/org/jboss/tools/jsf/vpe/richfaces/test/RichFacesComponentTest.java
Log:
- Bug fix
https://jira.jboss.org/jira/browse/JBIDE-2879 .
- A little refactoring made.
Modified:
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesDataTableTemplate.java
===================================================================
---
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesDataTableTemplate.java 2008-10-20
14:46:20 UTC (rev 11000)
+++
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesDataTableTemplate.java 2008-10-20
14:47:54 UTC (rev 11001)
@@ -342,7 +342,28 @@
return Math.max(currentLength,count);
}
+
+
+ /**
+ * @see
org.jboss.tools.vpe.editor.template.VpeAbstractTemplate#validate(org.jboss.tools.vpe.editor.context.VpePageContext,
org.w3c.dom.Node, org.mozilla.interfaces.nsIDOMDocument,
org.jboss.tools.vpe.editor.template.VpeCreationData)
+ */
@Override
+ public void validate(VpePageContext pageContext, Node sourceNode,
+ nsIDOMDocument visualDocument, VpeCreationData data) {
+ Element sourceElement = (Element) sourceNode;
+ List<Node> children = ComponentUtil.getChildren(sourceElement);
+ if (children != null) {
+ for (Node child : children) {
+ if (child.getNodeName().endsWith(RichFaces.TAG_SUB_TABLE)) {
+ RichFacesSubTableTemplate.DEFAULT_INSTANCE.validate(pageContext, child,
visualDocument, data);
+ }
+ }
+ }
+
+ super.validate(pageContext, sourceNode, visualDocument, data);
+ }
+
+ @Override
public void removeAttribute(VpePageContext pageContext, Element sourceElement,
nsIDOMDocument visualDocument, nsIDOMNode visualNode, Object data, String name) {
nsIDOMElement visualElement =
(nsIDOMElement)visualNode.queryInterface(nsIDOMElement.NS_IDOMELEMENT_IID);
visualElement.removeAttribute(name);
@@ -353,5 +374,4 @@
nsIDOMElement visualElement =
(nsIDOMElement)visualNode.queryInterface(nsIDOMElement.NS_IDOMELEMENT_IID);
visualElement.setAttribute(name, value);
}
-
}
\ No newline at end of file
Modified:
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesSubTableTemplate.java
===================================================================
---
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesSubTableTemplate.java 2008-10-20
14:46:20 UTC (rev 11000)
+++
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesSubTableTemplate.java 2008-10-20
14:47:54 UTC (rev 11001)
@@ -7,27 +7,55 @@
*
* Contributors:
* Exadel, Inc. and Red Hat, Inc. - initial API and implementation
- ******************************************************************************/
+ ******************************************************************************/
package org.jboss.tools.jsf.vpe.richfaces.template;
import java.util.ArrayList;
import java.util.List;
import org.jboss.tools.jsf.vpe.richfaces.ComponentUtil;
+import org.jboss.tools.jsf.vpe.richfaces.template.util.RichFaces;
import org.jboss.tools.vpe.editor.context.VpePageContext;
import org.jboss.tools.vpe.editor.template.VpeAbstractTemplate;
import org.jboss.tools.vpe.editor.template.VpeChildrenInfo;
import org.jboss.tools.vpe.editor.template.VpeCreationData;
+import org.jboss.tools.vpe.editor.template.expression.VpeExpression;
+import org.jboss.tools.vpe.editor.template.expression.VpeExpressionBuilder;
+import org.jboss.tools.vpe.editor.template.expression.VpeExpressionBuilderException;
+import org.jboss.tools.vpe.editor.template.expression.VpeExpressionException;
+import org.jboss.tools.vpe.editor.util.HTML;
+import org.jboss.tools.vpe.editor.util.VpeClassUtil;
import org.mozilla.interfaces.nsIDOMDocument;
import org.mozilla.interfaces.nsIDOMElement;
import org.mozilla.interfaces.nsIDOMNode;
+import org.mozilla.interfaces.nsIDOMNodeList;
import org.w3c.dom.Element;
import org.w3c.dom.Node;
public class RichFacesSubTableTemplate extends VpeAbstractTemplate {
+ /**
+ *
+ */
+ private static final String VAL_TRUE = "true";
+ /**
+ *
+ */
+ private static final String ATTR_BREAK_BEFORE = "breakBefore"; //$NON-NLS-1$
+ /**
+ *
+ */
+ private static final String COLUMN_CLASSES_EXPRESSION = "{@columnClasses}";
//$NON-NLS-1$
+ /**
+ *
+ */
+ private static final String ROW_CLASSES_EXPRESSION = "{@rowClasses}";
//$NON-NLS-1$
+ private static final String DEAFAULT_CELL_CLASS = "dr-subtable-cell
rich-subtable-cell"; //$NON-NLS-1$
+ private static List<String> rowClasses;
+ private static List<String> columnClasses;
public static RichFacesSubTableTemplate DEFAULT_INSTANCE = new
RichFacesSubTableTemplate();
+
public RichFacesSubTableTemplate() {
super();
}
@@ -41,67 +69,79 @@
* @param parentVisualNode
* @return
*/
- public VpeCreationData encode(VpeCreationData creationData, Element sourceElement,
nsIDOMDocument visualDocument, nsIDOMElement parentVisualNode) {
+ public VpeCreationData encode(VpeCreationData creationData, final Element sourceElement,
final nsIDOMDocument visualDocument, final nsIDOMElement parentVisualNode) {
if(creationData!=null) {
// Encode header
encodeHeader(creationData, sourceElement, visualDocument, parentVisualNode);
}
- nsIDOMElement tr = visualDocument.createElement("tr");
- ComponentUtil.copyAttributes(sourceElement, tr);
+ initClasses(sourceElement, null);
+ nsIDOMElement curTr = visualDocument.createElement(HTML.TAG_TR);
+ ComponentUtil.copyAttributes(sourceElement, curTr);
+
boolean header = false;
boolean footer = false;
+ int curRow = 0;
+ int curColumn = 0;
+
if(isHeader(sourceElement)) {
- tr.setAttribute("class", getHeaderClass());
- String style = getHeaderBackgoundImgStyle();
+ curTr.setAttribute(HTML.ATTR_CLASS, getHeaderClass());
+ final String style = getHeaderBackgoundImgStyle();
if(style!=null) {
- tr.setAttribute("style", style);
+ curTr.setAttribute(HTML.ATTR_STYLE, style);
}
header = true;
} else if(isFooter(sourceElement)) {
- tr.setAttribute("class", getFooterClass());
+ curTr.setAttribute(HTML.ATTR_CLASS, getFooterClass());
footer = true;
} else {
- tr.setAttribute("class", getCellClass());
+ curTr.setAttribute(HTML.ATTR_CLASS, getRowClass(curRow));
}
if(creationData==null) {
// Method was called from create()
- creationData = new VpeCreationData(tr);
+ creationData = new VpeCreationData(curTr);
} else {
// Method was called from dataTable
- parentVisualNode.appendChild(tr);
+ parentVisualNode.appendChild(curTr);
}
// Create mapping to Encode body
- VpeChildrenInfo trInfo = new VpeChildrenInfo(tr);
- creationData.addChildrenInfo(trInfo);
- List<Node> children = ComponentUtil.getChildren(sourceElement);
- for (Node child : children) {
- if(child.getNodeName().endsWith(":column")) {
- String breakBefore = ((Element)child).getAttribute("breakBefore");
- if(breakBefore!=null && breakBefore.equalsIgnoreCase("true")) {
- // Start new TR
- tr = visualDocument.createElement("tr");
+ VpeChildrenInfo trChildrenInfo = new VpeChildrenInfo(curTr);
+ final List<Node> children = ComponentUtil.getChildren(sourceElement);
+ for (final Node child : children) {
+ if (child.getNodeName().endsWith(':' + RichFaces.TAG_COLUMN)) {
+ final boolean breakBefore = VAL_TRUE.equals(
((Element)child).getAttribute(ATTR_BREAK_BEFORE) );
+ if (breakBefore) {
+ curRow++;
+ curColumn = 0;
+ curTr = visualDocument.createElement(HTML.TAG_TR);
+ ComponentUtil.copyAttributes(sourceElement, curTr);
+
if(header) {
- tr.setAttribute("class", getHeaderContinueClass());
+ curTr.setAttribute(HTML.ATTR_CLASS, getHeaderContinueClass());
} else if(footer) {
- tr.setAttribute("class", getFooterContinueClass());
+ curTr.setAttribute(HTML.ATTR_CLASS, getFooterContinueClass());
} else {
- tr.setAttribute("class", getCellClass());
+ curTr.setAttribute(HTML.ATTR_CLASS, getRowClass(curRow));
}
- ComponentUtil.copyAttributes(sourceElement, tr);
- if(parentVisualNode!=null) {
- parentVisualNode.appendChild(tr);
- }
- trInfo = new VpeChildrenInfo(tr);
- creationData.addChildrenInfo(trInfo);
+
+ parentVisualNode.appendChild(curTr);
+ trChildrenInfo = new VpeChildrenInfo(curTr);
+ creationData.addChildrenInfo(trChildrenInfo);
}
+
+ final VpeChildrenInfo innerTdChildrenInfo = new VpeChildrenInfo(curTr);
+ creationData.addChildrenInfo(innerTdChildrenInfo);
+ innerTdChildrenInfo.addSourceChild(child);
+ curColumn++;
+ } else {
+ trChildrenInfo.addSourceChild(child);
}
- trInfo.addSourceChild(child);
}
+
if(parentVisualNode!=null) {
// Encode footer
encodeFooter(creationData, sourceElement, visualDocument, parentVisualNode);
@@ -110,48 +150,84 @@
return creationData;
}
- public VpeCreationData create(VpePageContext pageContext, Node sourceNode,
nsIDOMDocument visualDocument) {
- Element sourceElement = (Element)sourceNode;
+ /** Adds necessary attributes to its children.*/
+ @Override
+ public void validate(final VpePageContext pageContext, final Node sourceNode,
+ final nsIDOMDocument visualDocument, final VpeCreationData creationData) {
+ initClasses(sourceNode, pageContext);
+ final List<VpeChildrenInfo> childrenInfoList =
creationData.getChildrenInfoList();
+ if (childrenInfoList != null) {
+ for (final VpeChildrenInfo childrenInfo : childrenInfoList) {
+ final List<Node> sourceChildren = childrenInfo.getSourceChildren();
+ if (sourceChildren != null
+ && sourceChildren.size() > 0
+ && sourceChildren.get(0).getParentNode() == sourceNode) {
+ final nsIDOMNodeList visualChildren =
childrenInfo.getVisualParent().getChildNodes();
+ addStylesToCells(visualDocument, visualChildren);
+ }
+ }
+ }
+ }
+
+ /** Adds HTML style classes names to all TDs from the list
<code>visualChildren</code>
+ * according to <code>columnClasses</code> attribute of the tag. */
+ private void addStylesToCells(nsIDOMDocument visualDocument, nsIDOMNodeList
visualChildren) {
+ int column = 0;
+ for (int i = 0; i < visualChildren.getLength(); i++) {
+ final nsIDOMNode visualChild = visualChildren.item(i);
+ if ( visualChild.getNodeType() == nsIDOMNode.ELEMENT_NODE &&
HTML.TAG_TD.equalsIgnoreCase(visualChild.getNodeName()) ) {
+ final nsIDOMNode tableCell = visualChild;
+ nsIDOMNode columnStyle = tableCell.getAttributes().getNamedItem(HTML.ATTR_CLASS);
+ if (columnStyle == null) {
+ columnStyle = visualDocument.createAttribute(HTML.ATTR_CLASS);
+ }
+ columnStyle.setNodeValue(columnStyle.getNodeValue() + ' ' +
getColumnClass(column));
+ column++;
+ }
+ }
+ }
- VpeCreationData creationData = encode(null, sourceElement, visualDocument, null);
+ public VpeCreationData create(final VpePageContext pageContext, final Node sourceNode,
final nsIDOMDocument visualDocument) {
+ final Element sourceElement = (Element)sourceNode;
+ final VpeCreationData creationData = encode(null, sourceElement, visualDocument,
null);
return creationData;
}
- protected void encodeHeader(VpeCreationData creationData, Element sourceElement,
nsIDOMDocument visualDocument, nsIDOMElement parentVisualNode) {
+ protected void encodeHeader(final VpeCreationData creationData, final Element
sourceElement, final nsIDOMDocument visualDocument, final nsIDOMElement parentVisualNode)
{
encodeHeaderOrFooter(creationData, sourceElement, visualDocument, parentVisualNode,
"header", "dr-subtable-header rich-subtable-header",
"dr-subtable-headercell rich-subtable-headercell");
}
- protected void encodeFooter(VpeCreationData creationData, Element sourceElement,
nsIDOMDocument visualDocument, nsIDOMElement parentVisualNode) {
+ protected void encodeFooter(final VpeCreationData creationData, final Element
sourceElement, final nsIDOMDocument visualDocument, final nsIDOMElement parentVisualNode)
{
encodeHeaderOrFooter(creationData, sourceElement, visualDocument, parentVisualNode,
"footer", "dr-subtable-footer rich-subtable-footer",
"dr-subtable-footercell rich-subtable-footercell");
}
- protected void encodeHeaderOrFooter(VpeCreationData creationData, Element sourceElement,
nsIDOMDocument visualDocument, nsIDOMElement parentVisualNode, String facetName, String
trClass, String tdClass) {
- ArrayList<Element> columns =
RichFacesDataTableTemplate.getColumns(sourceElement);
- ArrayList<Element> columnsHeaders =
RichFacesDataTableTemplate.getColumnsWithFacet(columns, facetName);
+ protected void encodeHeaderOrFooter(final VpeCreationData creationData, final Element
sourceElement, final nsIDOMDocument visualDocument, final nsIDOMElement parentVisualNode,
final String facetName, final String trClass, final String tdClass) {
+ final ArrayList<Element> columns =
RichFacesDataTableTemplate.getColumns(sourceElement);
+ final ArrayList<Element> columnsHeaders =
RichFacesDataTableTemplate.getColumnsWithFacet(columns, facetName);
if(!columnsHeaders.isEmpty()) {
- nsIDOMElement tr = visualDocument.createElement("tr");
+ final nsIDOMElement tr = visualDocument.createElement(HTML.TAG_TR);
parentVisualNode.appendChild(tr);
- String styleClass = trClass;
+ final String styleClass = trClass;
if(styleClass!=null) {
- tr.setAttribute("class", styleClass);
+ tr.setAttribute(HTML.ATTR_CLASS, styleClass);
}
RichFacesDataTableTemplate.encodeHeaderOrFooterFacets(creationData, tr,
visualDocument, columnsHeaders,
tdClass,
- null, facetName, "td");
+ null, facetName, HTML.TAG_TD);
}
}
- private boolean isHeader(Element sourceElement) {
+ private boolean isHeader(final Element sourceElement) {
return icludedInFacet(sourceElement, "header");
}
- private boolean isFooter(Element sourceElement) {
+ private boolean isFooter(final Element sourceElement) {
return icludedInFacet(sourceElement, "footer");
}
- private boolean icludedInFacet(Element sourceElement, String facetName) {
- Node parent = sourceElement.getParentNode();
+ private boolean icludedInFacet(final Element sourceElement, final String facetName) {
+ final Node parent = sourceElement.getParentNode();
return parent!=null && ComponentUtil.isFacet(parent, facetName);
}
@@ -171,23 +247,64 @@
return "dr-subtable-footer-continue rich-subtable-footer-continue";
}
- protected String getCellClass() {
- return "dr-subtable-cell rich-subtable-cell";
+ private String getRowClass(final int row) {
+ StringBuffer rowClass = new StringBuffer(DEAFAULT_CELL_CLASS);
+
+ if (rowClasses != null) {
+ final int rowClassesSize = rowClasses.size();
+ if(rowClassesSize > 0) {
+ rowClass = new StringBuffer(rowClasses.get(row % rowClassesSize));
+ }
+ }
+
+ return rowClass.toString();
}
+ private String getColumnClass(final int column) {
+ StringBuffer columnClass = new StringBuffer(DEAFAULT_CELL_CLASS);
+ if (columnClasses != null) {
+ final int columnClassesSize = columnClasses.size();
+ if (columnClassesSize > 0) {
+ columnClass = new StringBuffer(columnClasses.get(column % columnClassesSize));
+ }
+ }
+ return columnClass.toString();
+ }
+
+ private void initClasses(final Node sourceNode, final VpePageContext pageContext) {
+ VpeExpression rowClassesExpr;
+ VpeExpression columnClassesExpr;
+ try {
+ rowClassesExpr = VpeExpressionBuilder
+ .buildCompletedExpression(ROW_CLASSES_EXPRESSION, caseSensitive).getExpression();
+ columnClassesExpr = VpeExpressionBuilder
+ .buildCompletedExpression(COLUMN_CLASSES_EXPRESSION, caseSensitive).getExpression();
+ } catch (final VpeExpressionBuilderException e) {
+ throw new RuntimeException(e);
+ }
+
+ try {
+ rowClasses = VpeClassUtil.getClasses(rowClassesExpr, sourceNode,
+ pageContext);
+ columnClasses = VpeClassUtil.getClasses(columnClassesExpr, sourceNode,
+ pageContext);
+ } catch (final VpeExpressionException e) {
+ throw new RuntimeException(e);
+ }
+ }
+
protected String getHeaderBackgoundImgStyle() {
return null;
}
- @Override
- public void removeAttribute(VpePageContext pageContext, Element sourceElement,
nsIDOMDocument visualDocument, nsIDOMNode visualNode, Object data, String name) {
- nsIDOMElement visualElement =
(nsIDOMElement)visualNode.queryInterface(nsIDOMElement.NS_IDOMELEMENT_IID);
- visualElement.removeAttribute(name);
- }
+ /* (non-Javadoc)
+ * @see
org.jboss.tools.vpe.editor.template.VpeAbstractTemplate#isRecreateAtAttrChange(org.jboss.tools.vpe.editor.context.VpePageContext,
org.w3c.dom.Element, org.mozilla.interfaces.nsIDOMDocument,
org.mozilla.interfaces.nsIDOMElement, java.lang.Object, java.lang.String,
java.lang.String)
+ */
@Override
- public void setAttribute(VpePageContext pageContext, Element sourceElement,
nsIDOMDocument visualDocument, nsIDOMNode visualNode, Object data, String name, String
value) {
- nsIDOMElement visualElement =
(nsIDOMElement)visualNode.queryInterface(nsIDOMElement.NS_IDOMELEMENT_IID);
- visualElement.setAttribute(name, value);
+ public boolean isRecreateAtAttrChange(final VpePageContext pageContext,
+ final Element sourceElement, final nsIDOMDocument visualDocument,
+ final nsIDOMElement visualNode, final Object data, final String name, final String
value) {
+ return true;
}
}
\ No newline at end of file
Modified:
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsf2test/WebContent/index.html
===================================================================
---
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsf2test/WebContent/index.html 2008-10-20
14:46:20 UTC (rev 11000)
+++
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsf2test/WebContent/index.html 2008-10-20
14:47:54 UTC (rev 11001)
@@ -7,7 +7,7 @@
<a href="jsf2test/pages/components/head2.xhtml">h:head
(2nd)</a><br>
<a href="jsf2test/pages/components/body1.xhtml">h:body
(1st)</a><br>
<a href="jsf2test/pages/components/body2.xhtml">h:body
(2st)</a><br>
- <a
href="jsf2test/pages/components/outputScript.xhtml">h:outputScript</a><br>
- <a
href="jsf2test/pages/components/outputStylesheet.xhtml">h:outputStylesheet</a><br>
+ <a
href="jsf2test/pages/components/outputScript.xhtml">h:outputScript</a><br>
+ <a
href="jsf2test/pages/components/outputStylesheet.xhtml">h:outputStylesheet</a><br>
</body>
</html>
Added:
trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/resources/richFacesTest/WebContent/pages/components/subTable.xhtml
===================================================================
---
trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/resources/richFacesTest/WebContent/pages/components/subTable.xhtml
(rev 0)
+++
trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/resources/richFacesTest/WebContent/pages/components/subTable.xhtml 2008-10-20
14:47:54 UTC (rev 11001)
@@ -0,0 +1,96 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html
xmlns="http://www.w3.org/1999/xhtml"
+
xmlns:ui="http://java.sun.com/jsf/facelets"
+
xmlns:h="http://java.sun.com/jsf/html"
+
xmlns:f="http://java.sun.com/jsf/core"
+
xmlns:a4j="http://richfaces.org/a4j"
+
xmlns:rich="http://richfaces.org/rich">
+
+<f:loadBundle basename="jsftraining.messages" var="msg" />
+
+<head>
+<style type="text/css">
+ .redText {
+ color:red;
+ background: yellow
+ }
+ .blueText {
+ color:blue;
+ background: lime;
+ font-weight: bold;
+ }
+</style>
+<title></title>
+<link rel="stylesheet"
+ href="${facesContext.externalContext.requestContextPath}/pages/main.css"
/>
+</head>
+<body>
+ <f:view>
+ <h:form>
+ <rich:dataTable id="dataTableID" value="#{bookList.label}"
var="label">
+ <rich:subTable value="#{bookList.bookList}" var="book"
rowClasses="redText, blueText" columnClasses="redText, blueText">
+ <rich:column rowspan="2">
+ <h:outputText value="#{book.price}" />
+ </rich:column>
+ <rich:column>
+ <h:outputText value="#{book.numOfCopies}" />
+ </rich:column>
+ <rich:column>
+ <h:outputText value="#{book.numOfCopies}" />
+ </rich:column>
+ <rich:column breakBefore="true">
+ <h:outputText value="#{book.numOfCopies}" />
+ </rich:column>
+ <rich:column rowspan="2" >
+ <h:outputText value="#{book.numOfCopies}"/>
+ </rich:column>
+ <rich:column breakBefore="true">
+ <h:outputText value="#{book.numOfCopies}" />
+ </rich:column>
+ <rich:column>
+ <h:outputText value="#{book.numOfCopies}" />
+ </rich:column>
+ <rich:column colspan="2" breakBefore="true">
+ <h:outputText value="#{book.numOfCopies}" />
+ </rich:column>
+ <rich:column>
+ <h:outputText value="#{book.numOfCopies}" />
+ </rich:column>
+ </rich:subTable>
+ <rich:column colspan="3">
+ <h:outputText value="#{book.price}" />
+ </rich:column>
+ <rich:subTable value="#{bookList.bookList}" var="book"
rowClasses="redText, blueText" columnClasses="redText, blueText">
+ <rich:column rowspan="2">
+ <h:outputText value="#{book.price}" />
+ </rich:column>
+ <rich:column>
+ <h:outputText value="#{book.numOfCopies}" />
+ </rich:column>
+ <rich:column>
+ <h:outputText value="#{book.numOfCopies}" />
+ </rich:column>
+ <rich:column breakBefore="true">
+ <h:outputText value="#{book.numOfCopies}" />
+ </rich:column>
+ <rich:column rowspan="2" >
+ <h:outputText value="#{book.numOfCopies}"/>
+ </rich:column>
+ <rich:column breakBefore="true">
+ <h:outputText value="#{book.numOfCopies}" />
+ </rich:column>
+ <rich:column>
+ <h:outputText value="#{book.numOfCopies}" />
+ </rich:column>
+ <rich:column colspan="2" breakBefore="true">
+ <h:outputText value="#{book.numOfCopies}" />
+ </rich:column>
+ <rich:column>
+ <h:outputText value="#{book.numOfCopies}" />
+ </rich:column>
+ </rich:subTable>
+ </rich:dataTable>
+ </h:form>
+ </f:view>
+</body>
+</html>
\ No newline at end of file
Added:
trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/resources/richFacesTest/WebContent/pages/components/subTable.xhtml.xml
===================================================================
---
trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/resources/richFacesTest/WebContent/pages/components/subTable.xhtml.xml
(rev 0)
+++
trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/resources/richFacesTest/WebContent/pages/components/subTable.xhtml.xml 2008-10-20
14:47:54 UTC (rev 11001)
@@ -0,0 +1,100 @@
+<tests>
+ <test id="dataTableID">
+ <colgroup span="3"></colgroup>
+ <tbody>
+ <tr value="#{bookList.bookList}" var="book"
rowclasses="redText, blueText"
+ columnclasses="redText, blueText" class="redText">
+ <td class="dr-table-cell rich-table-cell redText redText redText"
+ rowspan="2">
+ <span>#{book.price}</span>
+ </td>
+ <td class="dr-table-cell rich-table-cell blueText blueText
blueText">
+ <span>#{book.numOfCopies}</span>
+ </td>
+ <td class="dr-table-cell rich-table-cell redText redText redText">
+ <span>#{book.numOfCopies}</span>
+ </td>
+ </tr>
+ <tr value="#{bookList.bookList}" var="book"
rowclasses="redText, blueText"
+ columnclasses="redText, blueText" class="blueText">
+ <td class="dr-table-cell rich-table-cell redText redText"
+ breakbefore="true">
+ <span>#{book.numOfCopies}</span>
+ </td>
+ <td class="dr-table-cell rich-table-cell blueText blueText"
+ rowspan="2">
+ <span>#{book.numOfCopies}</span>
+ </td>
+ </tr>
+ <tr value="#{bookList.bookList}" var="book"
rowclasses="redText, blueText"
+ columnclasses="redText, blueText" class="redText">
+ <td class="dr-table-cell rich-table-cell redText redText"
+ breakbefore="true">
+ <span>#{book.numOfCopies}</span>
+ </td>
+ <td class="dr-table-cell rich-table-cell blueText blueText">
+ <span>#{book.numOfCopies}</span>
+ </td>
+ </tr>
+ <tr value="#{bookList.bookList}" var="book"
rowclasses="redText, blueText"
+ columnclasses="redText, blueText" class="blueText">
+ <td class="dr-table-cell rich-table-cell redText redText"
+ colspan="2" breakbefore="true">
+ <span>#{book.numOfCopies}</span>
+ </td>
+ <td class="dr-table-cell rich-table-cell blueText blueText">
+ <span>#{book.numOfCopies}</span>
+ </td>
+ </tr>
+ <tr class="dr-table-firstrow rich-table-firstrow">
+ <td class="dr-table-cell rich-table-cell" colspan="3">
+ <span>#{book.price}</span>
+ </td>
+ </tr>
+ <tr value="#{bookList.bookList}" var="book"
rowclasses="redText, blueText"
+ columnclasses="redText, blueText" class="redText">
+ <td class="dr-table-cell rich-table-cell redText redText redText"
+ rowspan="2">
+ <span>#{book.price}</span>
+ </td>
+ <td class="dr-table-cell rich-table-cell blueText blueText
blueText">
+ <span>#{book.numOfCopies}</span>
+ </td>
+ <td class="dr-table-cell rich-table-cell redText redText redText">
+ <span>#{book.numOfCopies}</span>
+ </td>
+ </tr>
+ <tr value="#{bookList.bookList}" var="book"
rowclasses="redText, blueText"
+ columnclasses="redText, blueText" class="blueText">
+ <td class="dr-table-cell rich-table-cell redText redText"
+ breakbefore="true">
+ <span>#{book.numOfCopies}</span>
+ </td>
+ <td class="dr-table-cell rich-table-cell blueText blueText"
+ rowspan="2">
+ <span>#{book.numOfCopies}</span>
+ </td>
+ </tr>
+ <tr value="#{bookList.bookList}" var="book"
rowclasses="redText, blueText"
+ columnclasses="redText, blueText" class="redText">
+ <td class="dr-table-cell rich-table-cell redText redText"
+ breakbefore="true">
+ <span>#{book.numOfCopies}</span>
+ </td>
+ <td class="dr-table-cell rich-table-cell blueText blueText">
+ <span>#{book.numOfCopies}</span>
+ </td>
+ </tr>
+ <tr value="#{bookList.bookList}" var="book"
rowclasses="redText, blueText"
+ columnclasses="redText, blueText" class="blueText">
+ <td class="dr-table-cell rich-table-cell redText redText"
+ colspan="2" breakbefore="true">
+ <span>#{book.numOfCopies}</span>
+ </td>
+ <td class="dr-table-cell rich-table-cell blueText blueText">
+ <span>#{book.numOfCopies}</span>
+ </td>
+ </tr>
+ </tbody>
+ </test>
+</tests>
\ No newline at end of file
Modified:
trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/src/org/jboss/tools/jsf/vpe/richfaces/test/RichFacesComponentTest.java
===================================================================
---
trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/src/org/jboss/tools/jsf/vpe/richfaces/test/RichFacesComponentTest.java 2008-10-20
14:46:20 UTC (rev 11000)
+++
trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/src/org/jboss/tools/jsf/vpe/richfaces/test/RichFacesComponentTest.java 2008-10-20
14:47:54 UTC (rev 11001)
@@ -213,4 +213,9 @@
performTestForVpeComponent((IFile) TestUtil.getComponentPath(
"components/listShuttle.xhtml", RichFacesAllTests.IMPORT_PROJECT_NAME));
//$NON-NLS-1$
}
+
+ public void testSubTable() throws Throwable {
+ performTestForVpeComponent((IFile) TestUtil.getComponentPath(
+ "components/subTable.xhtml", RichFacesAllTests.IMPORT_PROJECT_NAME));
//$NON-NLS-1$
+ }
}