JBoss Rich Faces SVN: r10855 - trunk/samples/richfaces-demo/src/main/webapp/richfaces/tree/examples.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2008-10-21 11:43:06 -0400 (Tue, 21 Oct 2008)
New Revision: 10855
Modified:
trunk/samples/richfaces-demo/src/main/webapp/richfaces/tree/examples/simple-tree-data-dnd.properties
Log:
https://jira.jboss.org/jira/browse/RF-4452
Modified: trunk/samples/richfaces-demo/src/main/webapp/richfaces/tree/examples/simple-tree-data-dnd.properties
===================================================================
--- trunk/samples/richfaces-demo/src/main/webapp/richfaces/tree/examples/simple-tree-data-dnd.properties 2008-10-21 15:22:10 UTC (rev 10854)
+++ trunk/samples/richfaces-demo/src/main/webapp/richfaces/tree/examples/simple-tree-data-dnd.properties 2008-10-21 15:43:06 UTC (rev 10855)
@@ -8,9 +8,6 @@
1.6=pic6.jpg - leaf
1.7=pic7.jpg - leaf
1.8=pic8.jpg - leaf
-<<<<<<< .mine
1.9=pic9.jpg - leaf
-2 = Favorites - node
-3 = Trash - node=======
2=Favorites - node - favorites.gif
-3=Trash - node - trash_full.gif - trash.gif >>>>>>> .r10385
+3=Trash - node - trash_full.gif - trash.gif
\ No newline at end of file
17 years, 2 months
JBoss Rich Faces SVN: r10854 - in trunk/test-applications/jsp/src/main: java/util/data and 1 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: adubovsky
Date: 2008-10-21 11:22:10 -0400 (Tue, 21 Oct 2008)
New Revision: 10854
Modified:
trunk/test-applications/jsp/src/main/java/listShuttle/ListShuttle.java
trunk/test-applications/jsp/src/main/java/util/data/Data.java
trunk/test-applications/jsp/src/main/webapp/ListShuttle/ListShuttle.jsp
trunk/test-applications/jsp/src/main/webapp/ListShuttle/ListShuttleProperty.jsp
trunk/test-applications/jsp/src/main/webapp/ListShuttle/ListShuttleStraightforward.jsp
Log:
Corrections in ListShuttle
Modified: trunk/test-applications/jsp/src/main/java/listShuttle/ListShuttle.java
===================================================================
--- trunk/test-applications/jsp/src/main/java/listShuttle/ListShuttle.java 2008-10-21 14:58:50 UTC (rev 10853)
+++ trunk/test-applications/jsp/src/main/java/listShuttle/ListShuttle.java 2008-10-21 15:22:10 UTC (rev 10854)
@@ -76,9 +76,9 @@
this.upControlLabel = "up";
this.info = new ArrayList<String>();
this.switchByClick = false;
- this.targetListWidth = "300";
- this.sourceListWidth = "300";
- this.listsHeight = "400";
+ this.targetListWidth = "450";
+ this.sourceListWidth = "450";
+ this.listsHeight = "300";
this.sourceCaptionLabel = "sourceCaptionLabel";
this.targetCaptionLabel = "targetCaptionLabel";
this.targetValue = new ArrayList<Data>();
@@ -217,7 +217,7 @@
sourceValue.remove(i);
else
for(int i = sourceValue.size() + 1; i <= lenght; i++)
- sourceValue.add(new Data(i, "Button " + i, "Link " + i, "select" +(i % 5), statusIcon[i % 5]));
+ sourceValue.add(new Data(i, "Button " + i, "Link " + i, "Select" +(i % 5), statusIcon[i % 5], "Input " + i));
}
public int getLenght() {
Modified: trunk/test-applications/jsp/src/main/java/util/data/Data.java
===================================================================
--- trunk/test-applications/jsp/src/main/java/util/data/Data.java 2008-10-21 14:58:50 UTC (rev 10853)
+++ trunk/test-applications/jsp/src/main/java/util/data/Data.java 2008-10-21 15:22:10 UTC (rev 10854)
@@ -22,6 +22,7 @@
private String str1;
private String str2;
private String str3;
+ private String str4;
private int int0;
private int int1;
private int int2;
@@ -140,6 +141,16 @@
this.str2 = str2;
this.str3 = str3;
}
+
+ public Data(int int0, String str0, String str1, String str2, String str3, String str4){
+ this.int0 = int0;
+ this.str0 = str0;
+ this.str1 = str1;
+ this.str2 = str2;
+ this.str3 = str3;
+ this.str4 = str4;
+ }
+
//for scrollableDataTable component
public Data(int int0, String str0, String str1, String str2, String str3, Date date0){
this.int0 = int0;
@@ -297,4 +308,12 @@
return str0 + ":" + str1 + ":" + str2 + ":" + str3 + ":" + int0 + ":" + int1 + ":" + int2 + ":" + int3 + ":" + bool0 + ":" + bool1 + ":" + bool2 + ":" + bool3;
}
+
+ public String getStr4() {
+ return str4;
+ }
+
+ public void setStr4(String str4) {
+ this.str4 = str4;
+ }
}
Modified: trunk/test-applications/jsp/src/main/webapp/ListShuttle/ListShuttle.jsp
===================================================================
--- trunk/test-applications/jsp/src/main/webapp/ListShuttle/ListShuttle.jsp 2008-10-21 14:58:50 UTC (rev 10853)
+++ trunk/test-applications/jsp/src/main/webapp/ListShuttle/ListShuttle.jsp 2008-10-21 15:22:10 UTC (rev 10854)
@@ -4,90 +4,149 @@
<%@ taglib uri="http://richfaces.org/rich" prefix="rich"%>
<f:subview id="listShuttleSubviewID">
- <rich:listShuttle id="listShuttleID" var="item" binding="#{listShuttle.htmlListShuttle}"
- sourceValue="#{listShuttle.sourceValue}" targetValue="#{listShuttle.targetValue}"
- bottomControlLabel="#{listShuttle.bottomControlLabel}" copyAllControlLabel="#{listShuttle.copyAllControlLabel}"
- copyControlLabel="#{listShuttle.copyControlLabel}" downControlLabel="#{listShuttle.downControlLabel}"
- fastMoveControlsVisible="#{listShuttle.fastMoveControlsVisible}" converter="dataConverter"
- fastOrderControlsVisible="#{listShuttle.fastOrderControlsVisible}" first="#{listShuttle.first}"
- moveControlsVisible="#{listShuttle.moveControlsVisible}" orderControlsVisible="#{listShuttle.orderControlsVisible}"
- removeAllControlLabel="#{listShuttle.removeAllControlLabel}" removeControlLabel="#{listShuttle.removeControlLabel}"
- sourceSelection="#{listShuttle.sourceSelection}" targetSelection="#{listShuttle.targetSelection}"
- showButtonLabels="#{listShuttle.showButtonLabels}" switchByClick="#{listShuttle.switchByClick}"
- targetListWidth="#{listShuttle.targetListWidth}" sourceListWidth="#{listShuttle.sourceListWidth}"
- listsHeight="#{listShuttle.listsHeight}" sourceCaptionLabel="#{listShuttle.sourceCaptionLabel}"
- targetCaptionLabel="#{listShuttle.targetCaptionLabel}"
- topControlLabel="#{listShuttle.topControlLabel}" upControlLabel="#{listShuttle.upControlLabel}"
- onmousemove="#{event.onmousemove}" onclick="#{event.onclick}" ondblclick="#{event.ondblclick}" onmouseout="#{event.onmouseout}" onmouseover="#{event.onmouseover}" onorderchanged="#{event.onorderchanged}" ontopclick="#{event.ontopclick}" onupclick="#{event.onupclick}" ondownclick="#{event.ondownclick}" onbottomclick="#{event.onbottomclick}">
+ <rich:listShuttle id="listShuttleID" var="item"
+ binding="#{listShuttle.htmlListShuttle}"
+ sourceValue="#{listShuttle.sourceValue}"
+ targetValue="#{listShuttle.targetValue}"
+ bottomControlLabel="#{listShuttle.bottomControlLabel}"
+ copyAllControlLabel="#{listShuttle.copyAllControlLabel}"
+ copyControlLabel="#{listShuttle.copyControlLabel}"
+ downControlLabel="#{listShuttle.downControlLabel}"
+ fastMoveControlsVisible="#{listShuttle.fastMoveControlsVisible}"
+ converter="dataConverter"
+ fastOrderControlsVisible="#{listShuttle.fastOrderControlsVisible}"
+ first="#{listShuttle.first}"
+ moveControlsVisible="#{listShuttle.moveControlsVisible}"
+ orderControlsVisible="#{listShuttle.orderControlsVisible}"
+ removeAllControlLabel="#{listShuttle.removeAllControlLabel}"
+ removeControlLabel="#{listShuttle.removeControlLabel}"
+ sourceSelection="#{listShuttle.sourceSelection}"
+ targetSelection="#{listShuttle.targetSelection}"
+ showButtonLabels="#{listShuttle.showButtonLabels}"
+ switchByClick="#{listShuttle.switchByClick}"
+ targetListWidth="#{listShuttle.targetListWidth}"
+ sourceListWidth="#{listShuttle.sourceListWidth}"
+ listsHeight="#{listShuttle.listsHeight}"
+ sourceCaptionLabel="#{listShuttle.sourceCaptionLabel}"
+ targetCaptionLabel="#{listShuttle.targetCaptionLabel}"
+ topControlLabel="#{listShuttle.topControlLabel}"
+ upControlLabel="#{listShuttle.upControlLabel}"
+ onmousemove="#{event.onmousemove}" onclick="#{event.onclick}"
+ ondblclick="#{event.ondblclick}" onmouseout="#{event.onmouseout}"
+ onmouseover="#{event.onmouseover}"
+ onorderchanged="#{event.onorderchanged}"
+ ontopclick="#{event.ontopclick}" onupclick="#{event.onupclick}"
+ ondownclick="#{event.ondownclick}"
+ onbottomclick="#{event.onbottomclick}">
+ <%--
+ <f:facet name="topControl">
+ <h:outputText value="top" />
+ </f:facet>
+ <f:facet name="bottomControl">
+ <h:outputText value="bottom" />
+ </f:facet>
+ <f:facet name="upControl">
+ <h:outputText value="up" />
+ </f:facet>
+ <f:facet name="downControl">
+ <h:outputText value="down" />
+ </f:facet>
+ <f:facet name="topControlDisabled">
+ <h:outputText value="top disabled" />
+ </f:facet>
+ <f:facet name="bottomControlDisabled">
+ <h:outputText value="bottom disabled" />
+ </f:facet>
+ <f:facet name="upControlDisabled">
+ <h:outputText value="up disabled" />
+ </f:facet>
+ <f:facet name="downControlDisabled">
+ <h:outputText value="down disabled" />
+ </f:facet>
+
+
+ <f:facet name="copyControl">
+ <h:outputText value="copy" />
+ </f:facet>
+ <f:facet name="removeControl">
+ <h:outputText value="remove" />
+ </f:facet>
+ <f:facet name="copyAllControl">
+ <h:outputText value="copy all" />
+ </f:facet>
+ <f:facet name="removeAllControl">
+ <h:outputText value="remove all" />
+ </f:facet>
+ <f:facet name="copyControlDisabled">
+ <h:outputText value="copy disabled" />
+ </f:facet>
+ <f:facet name="removeControlDisabled">
+ <h:outputText value="remove disabled" />
+ </f:facet>
+ <f:facet name="copyAllControlDisabled">
+ <h:outputText value="copy all disabled" />
+ </f:facet>
+ <f:facet name="removeAllControlDisabled">
+ <h:outputText value="remove all disabled" />
+ </f:facet>
+ --%>
+ <h:column>
+ <f:facet name="header">
+ <h:outputText value="Output" />
+ </f:facet>
+ <h:outputText value="#{item.int0}" />
+ </h:column>
- <h:column>
- <f:facet name="header">
- <h:outputText value="Number" />
- </f:facet>
- <h:outputText value="#{item.int0}" />
- </h:column>
+ <h:column>
+ <f:facet name="header">
+ <h:outputText value="Input" />
+ </f:facet>
+ <h:inputText value="#{item.str4}" />
+ </h:column>
- <h:column>
- <f:facet name="header">
- <h:outputText value="Input" />
- </f:facet>
- <h:inputText value="#{item.str0}" />
- </h:column>
+ <h:column>
+ <f:facet name="header">
+ <h:outputText value="Button" />
+ </f:facet>
+ <h:commandButton value="#{item.str0} sbmt();" />
+ </h:column>
- <h:column>
- <f:facet name="header">
- <h:outputText value="Button" />
- </f:facet>
- <h:commandButton onclick="submit();" action="#{listShuttle.cbAction}" value="#{item.str0} submit();"/>
- </h:column>
+ <h:column>
+ <f:facet name="header">
+ <h:outputText value="a4jLink" />
+ </f:facet>
+ <a4j:commandLink action="#{listShuttle.clAction}"
+ value="#{item.str1} a4j" reRender="listShuttleID"></a4j:commandLink>
+ </h:column>
- <h:column>
- <f:facet name="header">
- <h:outputText value="Input" />
- </f:facet>
- <h:inputText value="#{item.str1}" />
- </h:column>
+ <h:column>
+ <f:facet name="header">
+ <h:outputText value="Select" />
+ </f:facet>
+ <h:selectOneMenu value="#{item.str2}">
+ <f:selectItem itemLabel="select0" itemValue="select0" />
+ <f:selectItem itemLabel="select1" itemValue="select1" />
+ <f:selectItem itemLabel="select2" itemValue="select2" />
+ <f:selectItem itemLabel="select3" itemValue="select3" />
+ <f:selectItem itemLabel="select4" itemValue="select4" />
+ <a4j:support event="onclick" reRender="listShuttleID"></a4j:support>
+ </h:selectOneMenu>
+ </h:column>
- <h:column>
- <f:facet name="header">
- <h:outputText value="Link" />
- </f:facet>
- <a4j:commandLink action="#{listShuttle.clAction}" value="#{item.str1} submit()" reRender="listShuttleID"></a4j:commandLink>
- </h:column>
+ <h:column>
+ <f:facet name="header">
+ <h:outputText value="GraphicImage" />
+ </f:facet>
+ <h:graphicImage value="#{item.str3}" />
+ </h:column>
- <h:column>
- <f:facet name="header">
- <h:outputText value="select" />
- </f:facet>
- <h:selectOneMenu value="#{item.str2}">
- <f:selectItem itemLabel="select0" itemValue="select0" />
- <f:selectItem itemLabel="select1" itemValue="select1" />
- <f:selectItem itemLabel="select2" itemValue="select2" />
- <f:selectItem itemLabel="select3" itemValue="select3" />
- <f:selectItem itemLabel="select4" itemValue="select4" />
- <a4j:support event="onclick" reRender="listShuttleID"></a4j:support>
- </h:selectOneMenu>
- </h:column>
-
- <h:column>
- <f:facet name="header">
- <h:outputText value="Text" />
- </f:facet>
- <h:outputText value="#{item.str3}" />
- </h:column>
-
- <h:column>
- <f:facet name="header">
- <h:outputText value="graphicImage" />
- </f:facet>
- <h:graphicImage value="#{item.str3}" />
- </h:column>
-
- <rich:column>
- <f:facet name="header">
- <h:outputText value="Link"></h:outputText>
- </f:facet>
- <h:outputLink value="http://www.jboss.com/"><f:verbatim>Link</f:verbatim></h:outputLink>
- </rich:column>
- </rich:listShuttle>
+ <rich:column>
+ <f:facet name="header">
+ <h:outputText value="OutputLink"></h:outputText>
+ </f:facet>
+ <h:outputLink value="http://www.jboss.com/">
+ <f:verbatim>outputLink</f:verbatim>
+ </h:outputLink>
+ </rich:column>
+ </rich:listShuttle>
</f:subview>
\ No newline at end of file
Modified: trunk/test-applications/jsp/src/main/webapp/ListShuttle/ListShuttleProperty.jsp
===================================================================
--- trunk/test-applications/jsp/src/main/webapp/ListShuttle/ListShuttleProperty.jsp 2008-10-21 14:58:50 UTC (rev 10853)
+++ trunk/test-applications/jsp/src/main/webapp/ListShuttle/ListShuttleProperty.jsp 2008-10-21 15:22:10 UTC (rev 10854)
@@ -4,68 +4,79 @@
<%@ taglib uri="http://richfaces.org/rich" prefix="rich"%>
<f:subview id="listShuttlePropertySubviewID">
- <h:commandButton value="add test" action="#{listShuttle.addHtmlListShuttle}"></h:commandButton>
-
- <h:panelGrid columns="3">
- <h:column></h:column>
- <h:outputText value="JavaScript API"></h:outputText>
- <h:column></h:column>
- <a4j:commandLink
- onclick="$('formID:listShuttleSubviewID:listShuttleID').component.hide()"
- value="hide"></a4j:commandLink>
- <a4j:commandLink
- onclick="$('formID:listShuttleSubviewID:listShuttleID').component.show()"
- value="show"></a4j:commandLink>
- <a4j:commandLink
- onclick="alert($('formID:listShuttleSubviewID:listShuttleID').component.isShown())"
- value="isShown"></a4j:commandLink>
- <a4j:commandLink
- onclick="$('formID:listShuttleSubviewID:listShuttleID').component.enable()"
- value="enable"></a4j:commandLink>
- <a4j:commandLink
- onclick="$('formID:listShuttleSubviewID:listShuttleID').component.disable()"
- value="disable"></a4j:commandLink>
- <a4j:commandLink
- onclick="alert($('formID:listShuttleSubviewID:listShuttleID').component.isEnabled())"
- value="isEnabled"></a4j:commandLink>
- <a4j:commandLink
- onclick="$('formID:listShuttleSubviewID:listShuttleID').component.up()"
- value="up"></a4j:commandLink>
- <a4j:commandLink
- onclick="$('formID:listShuttleSubviewID:listShuttleID').component.down()"
- value="down"></a4j:commandLink>
- <a4j:commandLink
- onclick="$('formID:listShuttleSubviewID:listShuttleID').component.top()"
- value="top"></a4j:commandLink>
- <a4j:commandLink
- onclick="$('formID:listShuttleSubviewID:listShuttleID').component.bottom()"
- value="bottom"></a4j:commandLink>
- <a4j:commandLink
- onclick="$('formID:listShuttleSubviewID:listShuttleID').component.copy()"
- value="copy"></a4j:commandLink>
- <a4j:commandLink
- onclick="$('formID:listShuttleSubviewID:listShuttleID').component.remove()"
- value="remove"></a4j:commandLink>
- <a4j:commandLink
- onclick="$('formID:listShuttleSubviewID:listShuttleID').component.copyAll()"
- value="copyAll"></a4j:commandLink>
- <a4j:commandLink
- onclick="$('formID:listShuttleSubviewID:listShuttleID').component.removeAll()"
- value="removeAll"></a4j:commandLink>
- <a4j:commandLink
- onclick="alert($('formID:listShuttleSubviewID:listShuttleID').component.targetList.getSelection())"
- value="targetList.getSelection"></a4j:commandLink>
+ <h:commandButton value="add test"
+ action="#{listShuttle.addHtmlListShuttle}"></h:commandButton>
+
+ <br />
+ <br />
+ <h:outputText value="JavaScript API" style="font-weight: bold;" />
+ <h:panelGrid columns="4" border="1">
+ <h:panelGroup>
<a4j:commandLink
- onclick="alert($('formID:listShuttleSubviewID:listShuttleID').component.sourceList.getSelection())"
- value="sourceList.getSelection"></a4j:commandLink>
- <a4j:commandLink
- onclick="alert($('formID:listShuttleSubviewID:listShuttleID').component.targetList.getItems())"
- value="targetList.getItems"></a4j:commandLink>
+ onclick="$('formID:listShuttleSubviewID:listShuttleID').component.enable()"
+ value="enable"></a4j:commandLink>
+ <br />
<a4j:commandLink
- onclick="alert($('formID:listShuttleSubviewID:listShuttleID').component.sourceList.getItems())"
- value="sourceList.getItems"></a4j:commandLink>
+ onclick="$('formID:listShuttleSubviewID:listShuttleID').component.disable()"
+ value="disable"></a4j:commandLink>
+ <br />
+ <a4j:commandLink
+ onclick="alert($('formID:listShuttleSubviewID:listShuttleID').component.isEnabled())"
+ value="isEnabled"></a4j:commandLink>
+ </h:panelGroup>
+ <h:panelGroup>
+ <a4j:commandLink
+ onclick="$('formID:listShuttleSubviewID:listShuttleID').component.up()"
+ value="up"></a4j:commandLink>
+ <br />
+ <a4j:commandLink
+ onclick="$('formID:listShuttleSubviewID:listShuttleID').component.down()"
+ value="down"></a4j:commandLink>
+ <br />
+ <a4j:commandLink
+ onclick="$('formID:listShuttleSubviewID:listShuttleID').component.top()"
+ value="top"></a4j:commandLink>
+ <br />
+ <a4j:commandLink
+ onclick="$('formID:listShuttleSubviewID:listShuttleID').component.bottom()"
+ value="bottom"></a4j:commandLink>
+ </h:panelGroup>
+ <h:panelGroup>
+ <a4j:commandLink
+ onclick="$('formID:listShuttleSubviewID:listShuttleID').component.copy()"
+ value="copy"></a4j:commandLink>
+ <br />
+ <a4j:commandLink
+ onclick="$('formID:listShuttleSubviewID:listShuttleID').component.remove()"
+ value="remove"></a4j:commandLink>
+ <br />
+ <a4j:commandLink
+ onclick="$('formID:listShuttleSubviewID:listShuttleID').component.copyAll()"
+ value="copyAll"></a4j:commandLink>
+ <br />
+ <a4j:commandLink
+ onclick="$('formID:listShuttleSubviewID:listShuttleID').component.removeAll()"
+ value="removeAll"></a4j:commandLink>
+ </h:panelGroup>
+ <h:panelGroup>
+ <a4j:commandLink
+ onclick="alert($('formID:listShuttleSubviewID:listShuttleID').component.targetList.getSelection())"
+ value="targetList.getSelection"></a4j:commandLink>
+ <br />
+ <a4j:commandLink
+ onclick="alert($('formID:listShuttleSubviewID:listShuttleID').component.sourceList.getSelection())"
+ value="sourceList.getSelection"></a4j:commandLink>
+ <br />
+ <a4j:commandLink
+ onclick="alert($('formID:listShuttleSubviewID:listShuttleID').component.targetList.getItems())"
+ value="targetList.getItems"></a4j:commandLink>
+ <br />
+ <a4j:commandLink
+ onclick="alert($('formID:listShuttleSubviewID:listShuttleID').component.sourceList.getItems())"
+ value="sourceList.getItems"></a4j:commandLink>
+ </h:panelGroup>
</h:panelGrid>
-
+
<h:panelGrid columns="2">
<h:column></h:column>
<h:panelGroup>
@@ -84,9 +95,7 @@
</h:panelGroup>
<h:outputText value="first" />
- <h:inputText value="#{listShuttle.first}">
- <a4j:support event="onclick" reRender="listShuttleID"></a4j:support>
- </h:inputText>
+ <h:inputText value="#{listShuttle.first}" onchange="submit()" />
<h:outputText value="showButtonLabels" />
<h:selectBooleanCheckbox value="#{listShuttle.showButtonLabels}"
@@ -113,73 +122,59 @@
onchange="submit();" />
<h:outputText value="sourceCaptionLabel" />
- <h:inputText value="#{listShuttle.sourceCaptionLabel}">
- <a4j:support event="onclick" reRender="listShuttleID"></a4j:support>
- </h:inputText>
+ <h:inputText value="#{listShuttle.sourceCaptionLabel}"
+ onchange="submit()" />
<h:outputText value="targetCaptionLabel" />
- <h:inputText value="#{listShuttle.targetCaptionLabel}">
- <a4j:support event="onclick" reRender="listShuttleID"></a4j:support>
- </h:inputText>
+ <h:inputText value="#{listShuttle.targetCaptionLabel}"
+ onchange="submit()" />
<h:outputText value="sourceListWidth" />
- <h:inputText value="#{listShuttle.sourceListWidth}">
- <a4j:support event="onclick" reRender="listShuttleID"></a4j:support>
- </h:inputText>
+ <h:inputText value="#{listShuttle.sourceListWidth}"
+ onchange="submit()" />
<h:outputText value="targetListWidth" />
- <h:inputText value="#{listShuttle.targetListWidth}">
- <a4j:support event="onclick" reRender="listShuttleID"></a4j:support>
- </h:inputText>
+ <h:inputText value="#{listShuttle.targetListWidth}"
+ onchange="submit()" />
<h:outputText value="listsHeight" />
- <h:inputText value="#{listShuttle.listsHeight}">
- <a4j:support event="onclick" reRender="listShuttleID"></a4j:support>
- </h:inputText>
+ <h:inputText value="#{listShuttle.listsHeight}" onchange="submit()" />
<h:outputText value="copyControlLabel" />
- <h:inputText value="#{listShuttle.copyControlLabel}">
- <a4j:support event="onclick" reRender="listShuttleID"></a4j:support>
- </h:inputText>
+ <h:inputText value="#{listShuttle.copyControlLabel}"
+ onchange="submit()" />
<h:outputText value="removeControlLabel" />
- <h:inputText value="#{listShuttle.removeControlLabel}">
- <a4j:support event="onclick" reRender="listShuttleID"></a4j:support>
- </h:inputText>
+ <h:inputText value="#{listShuttle.removeControlLabel}"
+ onchange="submit()" />
<h:outputText value="copyAllControlLabel" />
- <h:inputText value="#{listShuttle.copyAllControlLabel}">
- <a4j:support event="onclick" reRender="listShuttleID"></a4j:support>
- </h:inputText>
+ <h:inputText value="#{listShuttle.copyAllControlLabel}"
+ onchange="submit()" />
<h:outputText value="removeAllControlLabel" />
- <h:inputText value="#{listShuttle.removeAllControlLabel}">
- <a4j:support event="onclick" reRender="listShuttleID"></a4j:support>
- </h:inputText>
+ <h:inputText value="#{listShuttle.removeAllControlLabel}"
+ onchange="submit()" />
<h:outputText value="bottomControlLabel" />
- <h:inputText value="#{listShuttle.bottomControlLabel}">
- <a4j:support event="onclick" reRender="listShuttleID"></a4j:support>
- </h:inputText>
+ <h:inputText value="#{listShuttle.bottomControlLabel}"
+ onchange="submit()" />
<h:outputText value="downControlLabel" />
- <h:inputText value="#{listShuttle.downControlLabel}">
- <a4j:support event="onclick" reRender="listShuttleID"></a4j:support>
- </h:inputText>
+ <h:inputText value="#{listShuttle.downControlLabel}"
+ onchange="submit()" />
<h:outputText value="topControlLabel" />
- <h:inputText value="#{listShuttle.topControlLabel}">
- <a4j:support event="onclick" reRender="listShuttleID"></a4j:support>
- </h:inputText>
+ <h:inputText value="#{listShuttle.topControlLabel}"
+ onchange="submit()" />
<h:outputText value="upControlLabel" />
- <h:inputText value="#{listShuttle.upControlLabel}">
- <a4j:support event="onclick" reRender="listShuttleID"></a4j:support>
- </h:inputText>
+ <h:inputText value="#{listShuttle.upControlLabel}" onchange="submit()" />
</h:panelGrid>
-
+
<br />
<br />
+ <%--
<div style="FONT-WEIGHT: bold;">rich:findComponent</div>
<h:panelGrid columns="2">
<rich:column>
@@ -190,4 +185,5 @@
value="#{rich:findComponent('listShuttleID').activeItem}" />
</rich:column>
</h:panelGrid>
+ --%>
</f:subview>
\ No newline at end of file
Modified: trunk/test-applications/jsp/src/main/webapp/ListShuttle/ListShuttleStraightforward.jsp
===================================================================
--- trunk/test-applications/jsp/src/main/webapp/ListShuttle/ListShuttleStraightforward.jsp 2008-10-21 14:58:50 UTC (rev 10853)
+++ trunk/test-applications/jsp/src/main/webapp/ListShuttle/ListShuttleStraightforward.jsp 2008-10-21 15:22:10 UTC (rev 10854)
@@ -5,27 +5,34 @@
<f:subview id="listShuttleStraightforwardSubviewID">
<h:panelGrid columns="3">
- <a4j:commandButton value="Show selection (reRender)" reRender="infoLSID"></a4j:commandButton>
+ <a4j:commandButton value="Show selection (reRender)"
+ reRender="infoLSID"></a4j:commandButton>
<h:column>
- <h:selectBooleanCheckbox value="#{listShuttle.showSelect}" onclick="submit();" />
+ <h:selectBooleanCheckbox value="#{listShuttle.showSelect}"
+ onclick="submit();" />
</h:column>
<h:column>
- <h:dataTable id="infoLSID" value="#{listShuttle.info}" var="info" rendered="#{listShuttle.showSelect}" border="1">
+ <h:dataTable id="infoLSID" value="#{listShuttle.info}" var="info"
+ rendered="#{listShuttle.showSelect}" border="1">
<h:column>
<h:outputText value="#{info}" />
</h:column>
</h:dataTable>
</h:column>
- <a4j:commandButton value="Show all source (reRender)" reRender="allInfoLSSourceID"></a4j:commandButton>
+ <a4j:commandButton value="Show all source (reRender)"
+ reRender="allInfoLSSourceID"></a4j:commandButton>
<h:column>
- <h:selectBooleanCheckbox value="#{listShuttle.showAllSourceData}" onclick="submit();" />
+ <h:selectBooleanCheckbox value="#{listShuttle.showAllSourceData}"
+ onclick="submit();" />
</h:column>
<h:column>
- <h:dataTable id="allInfoLSSourceID" value="#{listShuttle.sourceValue}" var="allInfo" rendered="#{listShuttle.showAllSourceData}" border="1">
+ <h:dataTable id="allInfoLSSourceID"
+ value="#{listShuttle.sourceValue}" var="allInfo"
+ rendered="#{listShuttle.showAllSourceData}" border="1">
<h:column>
<f:facet name="header">
- <h:outputText value="Number" />
+ <h:outputText value="Output" />
</f:facet>
<h:outputText value="#{allInfo.int0}" />
</h:column>
@@ -34,7 +41,7 @@
<f:facet name="header">
<h:outputText value="Input" />
</f:facet>
- <h:outputText value="#{allInfo.str0}" />
+ <h:outputText value="#{allInfo.str4}" />
</h:column>
<h:column>
@@ -46,50 +53,40 @@
<h:column>
<f:facet name="header">
- <h:outputText value="Input" />
+ <h:outputText value="a4jLink" />
</f:facet>
- <h:outputText value="#{allInfo.str1}" />
+ <h:outputText value="#{allInfo.str1} a4j" />
</h:column>
<h:column>
<f:facet name="header">
- <h:outputText value="Link" />
+ <h:outputText value="Select" />
</f:facet>
- <h:outputText value="#{allInfo.str1} submit()" />
- </h:column>
-
- <h:column>
- <f:facet name="header">
- <h:outputText value="select" />
- </f:facet>
<h:outputText value="#{allInfo.str2}" />
</h:column>
<h:column>
<f:facet name="header">
- <h:outputText value="Text" />
+ <h:outputText value="GraphicImage" />
</f:facet>
<h:outputText value="#{allInfo.str3}" />
</h:column>
-
- <h:column>
- <f:facet name="header">
- <h:outputText value="graphicImage" />
- </f:facet>
- <h:outputText value="#{allInfo.str3}" />
- </h:column>
</h:dataTable>
</h:column>
- <a4j:commandButton value="Show all target (reRender)" reRender="allInfoLSTargetID"></a4j:commandButton>
+ <a4j:commandButton value="Show all target (reRender)"
+ reRender="allInfoLSTargetID"></a4j:commandButton>
<h:column>
- <h:selectBooleanCheckbox value="#{listShuttle.showAllTargetData}" onclick="submit();" />
+ <h:selectBooleanCheckbox value="#{listShuttle.showAllTargetData}"
+ onclick="submit();" />
</h:column>
<h:column>
- <h:dataTable id="allInfoLSTargetID" value="#{listShuttle.targetValue}" var="allInfo" rendered="#{listShuttle.showAllTargetData}" border="1">
+ <h:dataTable id="allInfoLSTargetID"
+ value="#{listShuttle.targetValue}" var="allInfo"
+ rendered="#{listShuttle.showAllTargetData}" border="1">
<h:column>
<f:facet name="header">
- <h:outputText value="Number" />
+ <h:outputText value="Output" />
</f:facet>
<h:outputText value="#{allInfo.int0}" />
</h:column>
@@ -98,7 +95,7 @@
<f:facet name="header">
<h:outputText value="Input" />
</f:facet>
- <h:outputText value="#{allInfo.str0}" />
+ <h:outputText value="#{allInfo.str4}" />
</h:column>
<h:column>
@@ -110,38 +107,31 @@
<h:column>
<f:facet name="header">
- <h:outputText value="Input" />
+ <h:outputText value="a4jLink" />
</f:facet>
- <h:outputText value="#{allInfo.str1}" />
+ <h:outputText value="#{allInfo.str1} a4j" />
</h:column>
<h:column>
<f:facet name="header">
- <h:outputText value="Link" />
+ <h:outputText value="Select" />
</f:facet>
- <h:outputText value="#{allInfo.str1} submit()" />
- </h:column>
-
- <h:column>
- <f:facet name="header">
- <h:outputText value="select" />
- </f:facet>
<h:outputText value="#{allInfo.str2}" />
</h:column>
<h:column>
<f:facet name="header">
- <h:outputText value="Text" />
+ <h:outputText value="GraphicImage" />
</f:facet>
<h:outputText value="#{allInfo.str3}" />
</h:column>
- <h:column>
+ <rich:column>
<f:facet name="header">
- <h:outputText value="graphicImage" />
+ <h:outputText value="OutputLink"></h:outputText>
</f:facet>
- <h:outputText value="#{allInfo.str3}" />
- </h:column>
+ <h:outputText value="http://www.jboss.com/" />
+ </rich:column>
</h:dataTable>
</h:column>
</h:panelGrid>
17 years, 2 months
JBoss Rich Faces SVN: r10853 - in trunk/sandbox/ui/editor/src/main: templates and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: alevkovsky
Date: 2008-10-21 10:58:50 -0400 (Tue, 21 Oct 2008)
New Revision: 10853
Modified:
trunk/sandbox/ui/editor/src/main/java/org/richfaces/renderkit/EditorRendererBase.java
trunk/sandbox/ui/editor/src/main/templates/editor.jspx
Log:
Adjust template
Modified: trunk/sandbox/ui/editor/src/main/java/org/richfaces/renderkit/EditorRendererBase.java
===================================================================
--- trunk/sandbox/ui/editor/src/main/java/org/richfaces/renderkit/EditorRendererBase.java 2008-10-21 14:11:16 UTC (rev 10852)
+++ trunk/sandbox/ui/editor/src/main/java/org/richfaces/renderkit/EditorRendererBase.java 2008-10-21 14:58:50 UTC (rev 10853)
@@ -94,4 +94,14 @@
}
+ protected String getFormattedComponentStringValue(FacesContext context,
+ UIEditor component) {
+ String fieldValue = (String) component.getSubmittedValue();
+ if (fieldValue == null) {
+ fieldValue = getConvertedStringValue(context, component, component
+ .getValue());
+ }
+ return fieldValue;
+ }
+
}
Modified: trunk/sandbox/ui/editor/src/main/templates/editor.jspx
===================================================================
--- trunk/sandbox/ui/editor/src/main/templates/editor.jspx 2008-10-21 14:11:16 UTC (rev 10852)
+++ trunk/sandbox/ui/editor/src/main/templates/editor.jspx 2008-10-21 14:58:50 UTC (rev 10853)
@@ -17,17 +17,8 @@
class="rich-editor">
<textarea id="#{clientId}TextArea" name='#{clientId}TextArea'
- style="width: #{component.attributes['width']}px; height: #{component.attributes['height']}px;">
- <jsp:scriptlet>
- <![CDATA[
- String fieldValue = (String)component.getSubmittedValue();
- if (fieldValue == null) {
- fieldValue = getConvertedStringValue(context, component, component.getValue());
- }
- variables.setVariable("fieldValue", fieldValue);
- writer.write(fieldValue);
- ]]>
- </jsp:scriptlet>
+ style="width: #{component.attributes['width']}px; height: #{component.attributes['height']}px; visibility: hidden">
+ #{this:getFormattedComponentStringValue(context, component)}
</textarea>
<script type="text/javascript">
17 years, 2 months
JBoss Rich Faces SVN: r10852 - trunk/ui/datascroller/src/main/java/org/richfaces/component.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2008-10-21 10:11:16 -0400 (Tue, 21 Oct 2008)
New Revision: 10852
Modified:
trunk/ui/datascroller/src/main/java/org/richfaces/component/UIDatascroller.java
Log:
StackOverflow fixed for getPageIndex()
Modified: trunk/ui/datascroller/src/main/java/org/richfaces/component/UIDatascroller.java
===================================================================
--- trunk/ui/datascroller/src/main/java/org/richfaces/component/UIDatascroller.java 2008-10-21 13:15:33 UTC (rev 10851)
+++ trunk/ui/datascroller/src/main/java/org/richfaces/component/UIDatascroller.java 2008-10-21 14:11:16 UTC (rev 10852)
@@ -261,7 +261,7 @@
* @deprecated
*/
public int getPageIndex() {
- return getPageIndex();
+ return getPage();
}
public int getPageForFacet(String facetName) {
17 years, 2 months
JBoss Rich Faces SVN: r10851 - trunk/docs/userguide/en/src/main/resources/images.
by richfaces-svn-commits@lists.jboss.org
Author: atsebro
Date: 2008-10-21 09:15:33 -0400 (Tue, 21 Oct 2008)
New Revision: 10851
Added:
trunk/docs/userguide/en/src/main/resources/images/RichFaces Greeter.png
Log:
RF-4056: Getting Started with RichFaces chapter should be updated
Added: trunk/docs/userguide/en/src/main/resources/images/RichFaces Greeter.png
===================================================================
(Binary files differ)
Property changes on: trunk/docs/userguide/en/src/main/resources/images/RichFaces Greeter.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
17 years, 2 months
JBoss Rich Faces SVN: r10850 - trunk/docs/userguide/en/src/main/resources/images.
by richfaces-svn-commits@lists.jboss.org
Author: atsebro
Date: 2008-10-21 09:14:41 -0400 (Tue, 21 Oct 2008)
New Revision: 10850
Removed:
trunk/docs/userguide/en/src/main/resources/images/RichFaces Greeter.png
Log:
RF-4056: Getting Started with RichFaces chapter should be updated
Deleted: trunk/docs/userguide/en/src/main/resources/images/RichFaces Greeter.png
===================================================================
(Binary files differ)
17 years, 2 months
JBoss Rich Faces SVN: r10849 - trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/dataTable.
by richfaces-svn-commits@lists.jboss.org
Author: andrei_exadel
Date: 2008-10-21 08:46:56 -0400 (Tue, 21 Oct 2008)
New Revision: 10849
Added:
trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/dataTable/dataTableTest.xhtml
Log:
DataTable Test
Added: trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/dataTable/dataTableTest.xhtml
===================================================================
--- trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/dataTable/dataTableTest.xhtml (rev 0)
+++ trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/dataTable/dataTableTest.xhtml 2008-10-21 12:46:56 UTC (rev 10849)
@@ -0,0 +1,79 @@
+<!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:a4j="http://richfaces.org/a4j"
+ xmlns:rich="http://richfaces.org/rich"
+ xmlns:h="http://java.sun.com/jsf/html"
+ xmlns:f="http://java.sun.com/jsf/core"
+ xmlns:ui="http://java.sun.com/jsf/facelets">
+
+<ui:composition template="#{templateBean.template}">
+ <ui:define name="component">
+
+ <h:form id="_controls">
+ <h:commandButton id="testACS" value="Test ASC" action="#{dataTableBean.testASCSorting}"></h:commandButton>
+ <h:commandButton id="testDESC" value="Test DESC" action="#{dataTableBean.testDESCSorting}"></h:commandButton>
+ <h:commandButton id="testFilterMethod" value="Test FilterMethod" action="#{dataTableBean.testFilterMethod}"></h:commandButton>
+ <h:commandButton id="testComponentState" value="Test ComponentState" action="#{dataTableBean.testComponentState}"></h:commandButton>
+ </h:form>
+
+ <h:form id="_form">
+ <h:outputText id="date" value="#{dataTableBean.date}"></h:outputText>
+
+ <rich:dataTable value="#{dataTableBean.model}"
+ id="table"
+ var="var"
+ sortPriority="#{dataTableBean.prioritList}"
+ ajaxKeys="#{dataTableBean.ajaxKeys}"
+ rowKeyVar="row"
+ stateVar="state"
+ componentState="#{dataTableBean.componentState}">
+ <f:facet name="header">
+ <h:outputText value="Data Table header"></h:outputText>
+ </f:facet>
+ <f:facet name="footer">
+ <h:outputText value="Data Table footer"></h:outputText>
+ </f:facet>
+ <rich:column id="col1" sortBy="#{var.v1}" sortOrder="#{dataTableBean.ordering}" selfSorted="false">
+ <f:facet name="header">
+ <h:outputText value="Column1"></h:outputText>
+ </f:facet>
+ <h:outputText id="v1" value="#{var.v1}" /><br/>
+ <h:outputText id="rowN" value="#{row}" />
+ <h:outputText style="display: none;" id="state" value="#{state}" />
+ </rich:column>
+ <rich:column id="col2" sortBy="#{var.v2}">
+ <f:facet name="header">
+ <h:outputText value="Column2"></h:outputText>
+ </f:facet>
+ <h:outputText id="v2" value="#{var.v2}" />
+ </rich:column>
+ <rich:column id="col3" comparator="#{dataTableBean.comparator}">
+ <f:facet name="header">
+ <h:outputText value="Column3"></h:outputText>
+ </f:facet>
+ <h:outputText id="v3" value="#{var.v3}" />
+ </rich:column>
+ <rich:column id="col4" filterBy="#{var.v4}" filterEvent="onclick">
+ <f:facet name="header">
+ <h:outputText value="Column4"></h:outputText>
+ </f:facet>
+ <h:outputText id="v4" value="#{var.v4}" /><br/>
+ <h:outputText id="date" value="#{dataTableBean.date}"></h:outputText>
+ <a4j:commandLink id="link" value="Link" reRender="date"></a4j:commandLink>
+ </rich:column>
+ <rich:column id="col5" filterMethod="#{dataTableBean.filterMethod}">
+ <f:facet name="header">
+ <h:outputText value="Column5"></h:outputText>
+ </f:facet>
+ <h:outputText id="v5" value="#{var.v5}" />
+ <h:inputText id="input" value="#{var.input}"></h:inputText>
+ </rich:column>
+ #{state}
+ </rich:dataTable>
+ <br/>
+ <h:commandButton id="submit" value="Submit"></h:commandButton>
+ </h:form>
+
+ </ui:define>
+</ui:composition>
+</html>
\ No newline at end of file
17 years, 2 months
JBoss Rich Faces SVN: r10848 - in trunk/test-applications/seleniumTest/richfaces/src: main/webapp/pages/dataTable and 1 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: andrei_exadel
Date: 2008-10-21 08:46:22 -0400 (Tue, 21 Oct 2008)
New Revision: 10848
Added:
trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/dataTable/dataTableAutoTest.xhtml
Removed:
trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/dataTable/dataTableTest.xhtml
Modified:
trunk/test-applications/seleniumTest/richfaces/src/main/java/org/ajax4jsf/bean/DataTableBean.java
trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/DataTableTest.java
Log:
DataTable Test
Modified: trunk/test-applications/seleniumTest/richfaces/src/main/java/org/ajax4jsf/bean/DataTableBean.java
===================================================================
--- trunk/test-applications/seleniumTest/richfaces/src/main/java/org/ajax4jsf/bean/DataTableBean.java 2008-10-21 11:42:23 UTC (rev 10847)
+++ trunk/test-applications/seleniumTest/richfaces/src/main/java/org/ajax4jsf/bean/DataTableBean.java 2008-10-21 12:46:22 UTC (rev 10848)
@@ -1,31 +1,157 @@
package org.ajax4jsf.bean;
import java.util.ArrayList;
+import java.util.Comparator;
import java.util.Date;
+import java.util.HashSet;
import java.util.List;
+import java.util.Set;
+import javax.faces.component.UIComponent;
import javax.faces.event.ActionEvent;
-import org.ajax4jsf.model.Column;
+import org.ajax4jsf.model.DataComponentState;
+import org.richfaces.component.html.HtmlDataTable;
import org.richfaces.model.Ordering;
@SuppressWarnings("unchecked")
public class DataTableBean {
- private int rows = 20;
+ private int rows = 6;
+
+ private Ordering ordering = Ordering.UNSORTED;
- private int column = 3;
+ private List model;
- private int begin = 1;
+ private ArrayList<String> prioritList = new ArrayList<String>();
- private int end = 10;
+ private boolean filterMethodTurnOn = false;
+
+ private Set<Integer> ajaxKeys = new HashSet<Integer>();
+
+ private Object componentState;
+
- private List model;
+ private final Comparator<Data> comparator = new Comparator<Data>(){
- private List columns;
+ public int compare(Data o1, Data o2) {
+ return o1.v3.compareTo(o2.v3);
+ };
+ };
- private Ordering ordering;
+ public boolean filterMethod(Object o) {
+ if (!filterMethodTurnOn) {
+ return true;
+ }
+ Data data = (Data)o;
+ return data.v5 <= 5;
+ }
+ public class Data {
+ Integer v1;
+ Integer v2;
+ Integer v3;
+ Integer v4;
+ Integer v5;
+
+ String input;
+
+ public Data(Integer v1, Integer v2,Integer v3,Integer v4, Integer v5) {
+ this.v1 = v1;
+ this.v2 = v2;
+ this.v3 = v3;
+ this.v4 = v4;
+ this.v5 = v5;
+ }
+
+ /**
+ * @return the v1
+ */
+ public Integer getV1() {
+ return v1;
+ }
+
+ /**
+ * @param v1 the v1 to set
+ */
+ public void setV1(Integer v1) {
+ this.v1 = v1;
+ }
+
+ /**
+ * @return the v2
+ */
+ public Integer getV2() {
+ return v2;
+ }
+
+ /**
+ * @param v2 the v2 to set
+ */
+ public void setV2(Integer v2) {
+ this.v2 = v2;
+ }
+
+ /**
+ * @return the v3
+ */
+ public Integer getV3() {
+ return v3;
+ }
+
+ /**
+ * @param v3 the v3 to set
+ */
+ public void setV3(Integer v3) {
+ this.v3 = v3;
+ }
+
+ /**
+ * @return the v4
+ */
+ public Integer getV4() {
+ return v4;
+ }
+
+ /**
+ * @param v4 the v4 to set
+ */
+ public void setV4(Integer v4) {
+ this.v4 = v4;
+ }
+
+ /**
+ * @return the v5
+ */
+ public Integer getV5() {
+ return v5;
+ }
+
+ /**
+ * @param v5 the v5 to set
+ */
+ public void setV5(Integer v5) {
+ this.v5 = v5;
+ }
+
+ /**
+ * @return the input
+ */
+ public String getInput() {
+ return input;
+ }
+
+ /**
+ * @param input the input to set
+ */
+ public void setInput(String input) {
+ this.input = input;
+ }
+
+
+
+ }
+
public DataTableBean() {
init();
}
@@ -34,14 +160,42 @@
init();
}
- public void reset(ActionEvent event) {
- rows = 20;
- column = 3;
- begin = 1;
- end = 10;
+ public void reset() {
+ rows = 6;
+ filterMethodTurnOn = false;
+ prioritList = new ArrayList<String>();
+ ordering = Ordering.UNSORTED;
init();
}
+ public String testASCSorting() {
+ prioritList.clear();
+ prioritList.add("Column1");
+ ordering = Ordering.ASCENDING;
+ return null;
+ }
+
+ public String testDESCSorting() {
+ prioritList.clear();
+ prioritList.add("Column1");
+
+ ordering = Ordering.DESCENDING;
+ return null;
+ }
+
+ public String testFilterMethod() {
+ filterMethodTurnOn = true;
+ return null;
+ }
+
+ public String testComponentState() throws Exception {
+ if (!(componentState instanceof DataComponentState)) {
+ throw new Exception("");
+ }
+ return null;
+ }
+
+
public String getDate() {
return new Date().toLocaleString();
}
@@ -49,35 +203,16 @@
private void init() {
model = new ArrayList();
for (int i = 0; i < rows; i++) {
- String [] m = new String[column];
- for (int j = 0; j < column; j++) {
- m[j] = String.valueOf(i + j);
- }
- model.add(m);
+ Data data = new Data(i, i + 1, i + 2, i + 3, i + 4);
+ model.add(data);
}
-
- columns = new ArrayList();
- for (int i = 0; i < column; i++) {
- columns.add(new Column("header","footer", i));
- }
+ ajaxKeys.add(0);
+ ajaxKeys.add(2);
+ ajaxKeys.add(4);
}
- /**
- * @return the columns
- */
- public int getColumn() {
- return column;
- }
/**
- * @param columns
- * the columns to set
- */
- public void setColumn(int column) {
- this.column = column;
- }
-
- /**
* @return the rows
*/
public int getRows() {
@@ -108,21 +243,13 @@
}
/**
- * @return the columns
+ * @return the comparator
*/
- public List getColumns() {
- return columns;
+ public Comparator<Data> getComparator() {
+ return comparator;
}
/**
- * @param columns
- * the columns to set
- */
- public void setColumns(List columns) {
- this.columns = columns;
- }
-
- /**
* @return the ordering
*/
public Ordering getOrdering() {
@@ -137,31 +264,46 @@
}
/**
- * @return the begin
+ * @return the prioritList
*/
- public int getBegin() {
- return begin;
+ public ArrayList<String> getPrioritList() {
+ return prioritList;
}
/**
- * @param begin the begin to set
+ * @param prioritList the prioritList to set
*/
- public void setBegin(int begin) {
- this.begin = begin;
+ public void setPrioritList(ArrayList<String> prioritList) {
+ this.prioritList = prioritList;
}
+
/**
- * @return the end
+ * @return the ajaxKeys
*/
- public int getEnd() {
- return end;
+ public Set<Integer> getAjaxKeys() {
+ return ajaxKeys;
}
/**
- * @param end the end to set
+ * @param ajaxKeys the ajaxKeys to set
*/
- public void setEnd(int end) {
- this.end = end;
+ public void setAjaxKeys(Set<Integer> ajaxKeys) {
+ this.ajaxKeys = ajaxKeys;
}
+ /**
+ * @return the componentState
+ */
+ public Object getComponentState() {
+ return componentState;
+ }
+
+ /**
+ * @param componentState the componentState to set
+ */
+ public void setComponentState(Object componentState) {
+ this.componentState = componentState;
+ }
+
}
Added: trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/dataTable/dataTableAutoTest.xhtml
===================================================================
--- trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/dataTable/dataTableAutoTest.xhtml (rev 0)
+++ trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/dataTable/dataTableAutoTest.xhtml 2008-10-21 12:46:22 UTC (rev 10848)
@@ -0,0 +1,27 @@
+<!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:a4j="http://richfaces.org/a4j"
+ xmlns:rich="http://richfaces.org/rich"
+ xmlns:h="http://java.sun.com/jsf/html"
+ xmlns:f="http://java.sun.com/jsf/core"
+ xmlns:ui="http://java.sun.com/jsf/facelets">
+
+<ui:composition template="#{templateBean.autoTestTemplate}">
+ <ui:define name="component">
+ <rich:dataTable id="componentId"
+ value="#{dataTableBean.model}"
+ rendered="#{autoTestBean.rendered}"
+ var="var"
+ style="width: 100%; color: yellow"
+ >
+
+ <rich:column id="col1">
+ <f:facet name="header">
+ <h:outputText value="Column1"></h:outputText>
+ </f:facet>
+ <h:outputText id="v1" value="#{var.v1}" /><br/>
+ </rich:column>
+ </rich:dataTable>
+ </ui:define>
+</ui:composition>
+</html>
\ No newline at end of file
Deleted: trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/dataTable/dataTableTest.xhtml
===================================================================
(Binary files differ)
Modified: trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/DataTableTest.java
===================================================================
--- trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/DataTableTest.java 2008-10-21 11:42:23 UTC (rev 10847)
+++ trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/DataTableTest.java 2008-10-21 12:46:22 UTC (rev 10848)
@@ -1,189 +1,345 @@
package org.richfaces.testng;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
import org.ajax4jsf.template.Template;
+import org.richfaces.AutoTester;
import org.richfaces.SeleniumTestBase;
+import org.richfaces.model.Ordering;
import org.testng.Assert;
import org.testng.annotations.Test;
public class DataTableTest extends SeleniumTestBase {
+
+ private String dataTableId;
+
+ private String dataTableBodyId;
+
+ private String commandId;
+
+ private static final String FORM_ID = "_form:";
+
+ private static final String CONTROLS_FORM = "_controls:";
+
+ private static final String RESET_METHOD = "#{dataTableBean.reset}";
+
+ private static final String [] dataTableClassNames = new String [] {
+ "dr-table",
+ "rich-table"
+ };
+
+ private static final Map<String, String> styleAttributes = new HashMap<String, String>();
+ static {
+ styleAttributes.put("width", "100%");
+ styleAttributes.put("color", "yellow");
+ }
+
+ private void init(String parentId) {
+ dataTableId = parentId + FORM_ID + "table";
+ dataTableBodyId = dataTableId + ":tb";
+ commandId = parentId + FORM_ID + "submit";
+ }
+
public String getTestUrl() {
return "pages/dataTable/dataTableTest.xhtml";
}
+
+ @Override
+ public String getAutoTestUrl() {
+ return "pages/dataTable/dataTableAutoTest.xhtml";
+ }
@Test
- public void testDataTable(Template template) {
- renderPage(template);
-
- String parentId = getParentId() + "_form:";
- String dataTableId = parentId + "table";
+ public void testSortByAttribute(Template template) {
+ renderPage(template, RESET_METHOD);
+ init(getParentId());
- reset(parentId + "reset");
- reRenderForm();
-
- writeStatus("Check columns count equals to 3 ");
- assertColumnsCount(3, dataTableId);
- writeStatus("Check rows count equals to 20 ");
- assertRowsCount(20, dataTableId);
-
- String columnsId = getColumnId(dataTableId, 0);
-
- writeStatus("Check inputs' values ");
- assertInputValue(dataTableId, 0, columnsId, "0");
- assertInputValue(dataTableId, 5, columnsId, "5");
- assertInputValue(dataTableId, 19, columnsId, "19");
-
- columnsId = getColumnId(dataTableId, 1);
-
- assertInputValue(dataTableId, 0, columnsId, "1");
- assertInputValue(dataTableId, 7, columnsId, "8");
- assertInputValue(dataTableId, 19, columnsId, "20");
-
- columnsId = getColumnId(dataTableId, 2);
-
- assertInputValue(dataTableId, 0, columnsId, "2");
- assertInputValue(dataTableId, 11, columnsId, "13");
- assertInputValue(dataTableId, 19, columnsId, "21");
-
- writeStatus("Insert some values ");
- insertInputValue(dataTableId, 0, getColumnId(dataTableId, 0), "000");
- insertInputValue(dataTableId, 19, getColumnId(dataTableId, 2), "777");
-
- writeStatus("Rerender table");
- clickById(getParentId() + "_form:submit");
- waitForAjaxCompletion();
-
- writeStatus("Check values entered ");
- assertInputValue(dataTableId, 0, getColumnId(dataTableId, 0), "000");
- assertInputValue(dataTableId, 19, getColumnId(dataTableId, 2), "777");
-
- columnsId = getColumnId(dataTableId, 0);
-
- writeStatus("Sort ASC by 1'st column ");
- sortColumn(dataTableId, columnsId);
- writeStatus("Check ordering");
- assertInputValue(dataTableId, 0, columnsId, "000");
- assertInputValue(dataTableId, 1, columnsId, "1");
- assertInputValue(dataTableId, 18, columnsId, "8");
- assertInputValue(dataTableId, 19, columnsId, "9");
-
- writeStatus("Sort DESC by 1'st column ");
- sortColumn(dataTableId, columnsId);
- writeStatus("Check ordering");
- assertInputValue(dataTableId, 0, columnsId, "9");
- assertInputValue(dataTableId, 1, columnsId, "8");
- assertInputValue(dataTableId, 18, columnsId, "1");
- assertInputValue(dataTableId, 19, columnsId, "000");
-
- columnsId = getColumnId(dataTableId, 2);
-
- writeStatus("Sort ASC by 3'st column ");
- sortColumn(dataTableId, columnsId);
- writeStatus("Check ordering");
- assertInputValue(dataTableId, 0, columnsId, "10");
- assertInputValue(dataTableId, 1, columnsId, "11");
- assertInputValue(dataTableId, 18, columnsId, "8");
- assertInputValue(dataTableId, 19, columnsId, "9");
-
- writeStatus("Set columns count == 5, rows count == 10");
- changeColumnCount(getParentId(), 10, 5, 0, 100);
-
- writeStatus("Check columns count equals to 5 ");
- assertColumnsCount(5, dataTableId);
- writeStatus("Check rows count equals to 10 ");
- assertRowsCount(10, dataTableId);
-
- columnsId = getColumnId(dataTableId, 0);
-
- writeStatus("Check inputs' values ");
- assertInputValue(dataTableId, 0, columnsId, "0");
- assertInputValue(dataTableId, 5, columnsId, "5");
- assertInputValue(dataTableId, 9, columnsId, "9");
-
- columnsId = getColumnId(dataTableId, 1);
-
- assertInputValue(dataTableId, 0, columnsId, "1");
- assertInputValue(dataTableId, 7, columnsId, "8");
- assertInputValue(dataTableId, 9, columnsId, "10");
-
- columnsId = getColumnId(dataTableId, 4);
-
- assertInputValue(dataTableId, 0, columnsId, "4");
- assertInputValue(dataTableId, 2, columnsId, "6");
- assertInputValue(dataTableId, 9, columnsId, "13");
-
- writeStatus("Sort ASC by the last column ");
- sortColumn(dataTableId, columnsId);
- writeStatus("Check ordering");
- assertInputValue(dataTableId, 0, columnsId, "10");
- assertInputValue(dataTableId, 2, columnsId, "12");
- assertInputValue(dataTableId, 9, columnsId, "9");
-
- writeStatus("Sort DESC by the last column ");
- sortColumn(dataTableId, columnsId);
- writeStatus("Check ordering");
- assertInputValue(dataTableId, 0, columnsId, "9");
- assertInputValue(dataTableId, 2, columnsId, "7");
- assertInputValue(dataTableId, 9, columnsId, "10");
-
- columnsId = getColumnId(dataTableId, 2);
- writeStatus("Sort ASC by the 3d column ");
- sortColumn(dataTableId, columnsId);
-
- writeStatus("Check ordering");
- assertInputValue(dataTableId, 0, columnsId, "10");
- assertInputValue(dataTableId, 2, columnsId, "2");
- assertInputValue(dataTableId, 9, columnsId, "9");
-
- changeColumnCount(getParentId(),2, 5, 2, 2);
- assertColumnsCount(1, dataTableId);
- assertRowsCount(2, dataTableId);
-
- changeColumnCount(getParentId(), 10, 5, 10, 0);
- assertRowsCount(0, dataTableId);
-
+ testSorting(2, new String [] {"1", "2", "3", "4", "5", "6"});
+ testSorting(3, new String [] {"2", "3", "4", "5", "6", "7"});
+ testSortIcon(2, Ordering.UNSORTED);
+
+ clickSort(2);
+
+ testSorting(2, new String [] {"1", "2", "3", "4", "5", "6"});
+ testSorting(3, new String [] {"2", "3", "4", "5", "6", "7"});
+ testSortIcon(2, Ordering.ASCENDING);
+
+ clickSort(2);
+
+ testSorting(2, new String [] {"6", "5", "4", "3", "2", "1"});
+ testSorting(3, new String [] {"7", "6", "5", "4", "3", "2"});
+ testSortIcon(2, Ordering.DESCENDING);
+
}
- public void reset(String id) {
- clickAjaxCommandAndWait(id);
+ @Test
+ public void testSortComparator(Template template) {
+ renderPage(template, RESET_METHOD);
+ init(getParentId());
+
+ testSorting(2, new String [] {"1", "2", "3", "4", "5", "6"});
+ testSorting(3, new String [] {"2", "3", "4", "5", "6", "7"});
+ testSortIcon(3, Ordering.UNSORTED);
+
+ clickSort(3);
+
+ testSorting(2, new String [] {"1", "2", "3", "4", "5", "6"});
+ testSorting(3, new String [] {"2", "3", "4", "5", "6", "7"});
+ testSortIcon(3, Ordering.ASCENDING);
+
+ clickSort(3);
+
+ testSorting(2, new String [] {"6", "5", "4", "3", "2", "1"});
+ testSorting(3, new String [] {"7", "6", "5", "4", "3", "2"});
+ testSortIcon(3, Ordering.DESCENDING);
}
-
- private String getColumnId(String tableId, int i) {
- String script = "$('" + tableId + "').rows[0].cells[" + String.valueOf(i) + "].id";
- String id = runScript(script);
- id = id.replace(tableId + ":", "");
- id = id.replace("header", "");
- return id;
+
+ @Test
+ public void testExternalSorting(Template template) {
+ renderPage(template, RESET_METHOD);
+ init(getParentId());
+
+ String commandId = getParentId() + CONTROLS_FORM + "testACS";
+ clickCommandAndWait(commandId);
+
+ testSorting(1, new String [] {"0", "1", "2", "3", "4", "5"});
+ testSortIcon(1, Ordering.ASCENDING);
+
+ commandId = getParentId() + CONTROLS_FORM + "testDESC";
+ clickCommandAndWait(commandId);
+
+ testSorting(1, new String [] {"5", "4", "3", "2", "1", "0"});
+ testSortIcon(1, Ordering.DESCENDING);
+
+
}
-
- private void changeColumnCount(String parentId, int rows, int columns, int begin, int end) {
- String script = "$('"+parentId+"_controls:rows').value='" + String.valueOf(rows) + "';";
- runScript(script);
- script = "$('"+parentId+"_controls:column').value='" + String.valueOf(columns) + "';";
- runScript(script);
- script = "$('"+parentId+"_controls:begin').value='" + String.valueOf(begin) + "';";
- runScript(script);
- script = "$('"+parentId+"_controls:end').value='" + String.valueOf(end) + "';";
- runScript(script);
- clickById(parentId +"_controls:apply");
- waitForAjaxCompletion();
+
+ @Test
+ public void testFilterBy(Template template) {
+ renderPage(template, RESET_METHOD);
+ init(getParentId());
+
+ String filterId = dataTableId + ":col4fsp";
+ setValueById(filterId, "5");
+ clickAjaxCommandAndWait(filterId);
+
+ testRowsCount(1);
+ testSorting(4, new String [] { "5" });
+
+ setValueById(filterId, "3");
+ clickAjaxCommandAndWait(filterId);
+
+ testRowsCount(1);
+ testSorting(4, new String [] { "3" });
}
-
- private void sortColumn(String tableId, String columnId) {
- clickById(tableId + ":" + columnId + "header");
- waitForAjaxCompletion();
+
+ @Test
+ public void testFilterMethod(Template template) {
+ renderPage(template, RESET_METHOD);
+ init(getParentId());
+
+ String commandId = getParentId() + CONTROLS_FORM + "testFilterMethod";
+ clickCommandAndWait(commandId);
+
+ testRowsCount(2);
+ testSorting(5, new String [] { "4", "5" });
+ testSorting(3, new String [] { "2", "3" });
+
}
-
- private void insertInputValue(String tableId, int row, String inputId, String value) {
- String id = tableId + ":" + row + ":" + inputId;
- String script = ("$('" + id + "').firstChild.value='" + value + "';");
- runScript(script);
+
+ @Test
+ public void testNestedInput(Template template) {
+ renderPage(template, RESET_METHOD);
+ init(getParentId());
+
+ String inputId = dataTableId + ":0:input";
+ setValueById(inputId, "One");
+
+ inputId = dataTableId + ":1:input";
+ setValueById(inputId, "Two");
+
+ inputId = dataTableId + ":2:input";
+ setValueById(inputId, "Three");
+
+ clickCommandAndWait(commandId);
+
+ AssertValueEquals(dataTableId + ":0:input", "One", "Nested input does not work.");
+ AssertValueEquals(dataTableId + ":1:input", "Two", "Nested input does not work.");
+ AssertValueEquals(dataTableId + ":2:input", "Three", "Nested input does not work.");
+
}
-
- private void assertInputValue(String tableId, int row, String inputId, String value) {
- String id = tableId + ":" + row + ":" + inputId;
- String script = "$('" + id + "').firstChild.value";
- Assert.assertEquals(runScript(script), value);
+
+ @Test
+ public void testFacetsAndColumnsHeaders(Template template) {
+ renderPage(template, RESET_METHOD);
+ init(getParentId());
+
+ String title = getFacetTitle(true);
+ Assert.assertEquals(title, "Data Table header", "DataTable header missed");
+
+ title = getFacetTitle(false);
+ Assert.assertEquals(title, "Data Table footer", "Data Table footer missed");
+
+ for (int i = 1; i < 6; i++) {
+ String headerId = dataTableId + ":col" + i + "header:sortDiv";
+ AssertTextEquals(headerId, "Column" + i, "Column ["+i+"] header incorrect");
+ }
}
+
+ @Test
+ public void testAjaxKeysAttribute(Template template) {
+ renderPage(template, RESET_METHOD);
+ init(getParentId());
+
+ String [] oldValues = new String[6];
+ for (int i = 0; i < 6; i++) {
+ String id = dataTableId + ":" +i + ":date";
+ oldValues[i] = getTextById(id);
+ }
+
+ pause(1500, dataTableId);
+ String linkId = dataTableId + ":0:link";
+ clickAjaxCommandAndWait(linkId);
+
+ String [] newValues = new String[6];
+ for (int i = 0; i < 6; i++) {
+ String id = dataTableId + ":" +i + ":date";
+ newValues[i] = getTextById(id);
+ }
+
+
+ //equal
+
+ List<Integer> notEquals = new ArrayList<Integer>();
+
+ for (int i = 0; i < 6; i++) {
+ if (!oldValues[i].equals(newValues[i])) {
+ notEquals.add(i);
+ }
+ }
+
+ if (notEquals.size() != 3 || !notEquals.get(0).equals(0)
+ || !notEquals.get(1).equals(2)
+ || !notEquals.get(2).equals(4)) {
+ Assert.fail("Ajax keys attribute does not work. [0,2,4] rows should be reRendered only. But was: " + toString(notEquals));
+ }
+
+ }
+
+
+
+ @Test
+ public void testVars(Template template) {
+ renderPage(template, RESET_METHOD);
+ init(getParentId());
+
+ for (int i = 0; i < 6; i++) {
+ String rowNId = dataTableId + ":" + i + ":rowN";
+ String stateId = dataTableId + ":" + i + ":state";
+ AssertTextEquals(rowNId, String.valueOf(i), "Row var attribute does not work");
+ Assert.assertNotNull(getTextById(stateId), "State request var does not present");
+ }
+
+ String commandId = getParentId() + CONTROLS_FORM + "testComponentState";
+ try {
+ clickCommandAndWait(commandId);
+ }catch (Exception e) {
+ Assert.fail("Component state does not work. State object does not references to HTMLDataTable");
+ }
+
+ }
+
+
+ @Test
+ public void testHTMLAndRendered (Template template){
+ AutoTester autoTester = getAutoTester(this);
+ autoTester.renderPage(template, RESET_METHOD);
+
+ autoTester.testStyleAndClasses(dataTableClassNames, styleAttributes);
+ autoTester.testRendered();
+ }
+
+
+ private void testRowsCount(int rows) {
+ assertRowsCount(rows, dataTableId);
+ }
+
+ private void testSorting(int columns, String [] values) {
+ columns--;
+ int rowCount = values.length;
+ assertRowsCount(rowCount, dataTableId);
+
+ int i = 0;
+ String [] actualValues = new String[values.length];
+ for (@SuppressWarnings("unused")
+ String v : values) {
+ actualValues[i] = getCellText(i, columns);
+ i++;
+ }
+ i = 0;
+ for (String v : values) {
+ if (!v.equals(actualValues[i])) {
+ Assert.fail("Columns was sorted incorectly. Expected: " + toString(values) + " But was: " + toString(actualValues));
+ }
+ i++;
+ }
+
+ }
+
+ private void clickSort(int column) {
+ String commandId = dataTableId + ":col" + column + "header";
+ clickAjaxCommandAndWait(commandId);
+ }
+
+ private String getCellText(int row, int cell) {
+ StringBuffer b = new StringBuffer(getElementById(dataTableBodyId));
+ b.append(".rows[").append(row).append("].cells[").append(cell).append("].firstChild.innerHTML");
+ return runScript(b.toString());
+ }
+
+ private void testSortIcon(int column, Ordering ordering) {
+ String id = dataTableId + ":col" + column + "header:sortDiv";
+ StringBuffer b = new StringBuffer(getElementById(id));
+ b.append(".firstChild.childNodes[1].src");
+ String src = runScript(b.toString());
+ if (ordering == Ordering.UNSORTED) {
+ Assert.assertTrue(src.indexOf("DataTableIconSortNone") != -1,
+ "Column [" + column + "] sort image is invalid");
+ } else if (ordering == Ordering.ASCENDING) {
+ Assert.assertTrue(src.indexOf("DataTableIconSortAsc") != -1,
+ "Column [" + column + "] sort image is invalid");
+ } else if (ordering == Ordering.DESCENDING) {
+ Assert.assertTrue(src.indexOf("DataTableIconSortDesc") != -1,
+ "Column [" + column + "] sort image is invalid");
+ }
+ }
+
+ private String toString(String[] ss) {
+ StringBuffer b = new StringBuffer();
+ for (String s : ss) {
+ b.append(s).append(",");
+ }
+ return b.toString();
+ }
+
+ private String toString(List<?> ss) {
+ StringBuffer b = new StringBuffer();
+ for (Object s : ss) {
+ b.append(s).append(",");
+ }
+ return b.toString();
+ }
+ private String getFacetTitle(boolean header) {
+ StringBuffer b = new StringBuffer(getElementById(dataTableId));
+ b.append(".").append(header ? "tHead" : "tFoot").append(
+ ".firstChild.firstChild.innerHTML");
+ return runScript(b.toString());
+ }
+
+
}
17 years, 2 months
JBoss Rich Faces SVN: r10847 - in trunk/test-applications/seleniumTest/richfaces/src: test/java/org/richfaces/testng and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: konstantin.mishin
Date: 2008-10-21 07:42:23 -0400 (Tue, 21 Oct 2008)
New Revision: 10847
Modified:
trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/listShuttle/listShuttleTest.xhtml
trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/ListShuttleTest.java
Log:
style and classes, standard HTML attributes are output to client
Modified: trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/listShuttle/listShuttleTest.xhtml
===================================================================
(Binary files differ)
Modified: trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/ListShuttleTest.java
===================================================================
--- trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/ListShuttleTest.java 2008-10-20 16:54:14 UTC (rev 10846)
+++ trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/ListShuttleTest.java 2008-10-21 11:42:23 UTC (rev 10847)
@@ -3,7 +3,14 @@
*/
package org.richfaces.testng;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
import org.ajax4jsf.template.Template;
+import org.richfaces.AutoTester;
+import org.richfaces.SeleniumEvent;
import org.richfaces.SeleniumTestBase;
import org.testng.Assert;
import org.testng.annotations.Test;
@@ -98,8 +105,29 @@
immediateId = attrFormId + ":immediateId";
}
+ /**
+ * style and classes, standard HTML attributes are output to client
+ */
+ @Test
+ public void testHTMLAttributes(Template template) {
+ init(template);
+
+ Map<String, String> styleAttributes = new HashMap<String, String>();
+ styleAttributes.put("color", "blue");
+ styleAttributes.put("text-decoration", "underline");
+
+ List<SeleniumEvent> events = new ArrayList<SeleniumEvent>();
+ events.add(SeleniumEvent.ONMOUSEMOVE);
+ events.add(SeleniumEvent.ONMOUSEOUT);
+ events.add(SeleniumEvent.ONMOUSEOVER);
+
+ assertClassNames(lsId,new String [] {"noname"}, "Component's rendering invalid", true);
+ assertStyleAttributes(lsId, styleAttributes);
+
+ assertEvents(lsId, events);
+ }
- /**
+ /**
* sourceValue/targetValue updated, listener fire
*/
@Test
@@ -504,12 +532,11 @@
/*
* (non-Javadoc)
- *
+ *
* @see org.richfaces.SeleniumTestBase#getTestUrl()
*/
@Override
public String getTestUrl() {
return "pages/listShuttle/listShuttleTest.xhtml";
}
-
}
17 years, 2 months
JBoss Rich Faces SVN: r10846 - in trunk/test-applications/facelets/src/main: webapp/ExtendedDataTable and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: adubovsky
Date: 2008-10-20 12:54:14 -0400 (Mon, 20 Oct 2008)
New Revision: 10846
Modified:
trunk/test-applications/facelets/src/main/java/extendedDataTable/ExtendedDataTableBB.java
trunk/test-applications/facelets/src/main/webapp/ExtendedDataTable/ExtendedDataTable.xhtml
trunk/test-applications/facelets/src/main/webapp/ExtendedDataTable/ExtendedDataTableProperty.xhtml
Log:
Changes in "Show selection" functionality in extendedDataTable
Modified: trunk/test-applications/facelets/src/main/java/extendedDataTable/ExtendedDataTableBB.java
===================================================================
--- trunk/test-applications/facelets/src/main/java/extendedDataTable/ExtendedDataTableBB.java 2008-10-20 16:42:32 UTC (rev 10845)
+++ trunk/test-applications/facelets/src/main/java/extendedDataTable/ExtendedDataTableBB.java 2008-10-20 16:54:14 UTC (rev 10846)
@@ -25,8 +25,17 @@
private String tableState = null;
private ExtendedTableDataModel<DemoPatient> dataModel;
private Integer patientsNumber = 100;
+ private boolean a4jRendered = true;
- public ExtendedDataTableBB() {
+ public boolean isA4jRendered() {
+ return a4jRendered;
+ }
+
+ public void setA4jRendered(boolean rendered) {
+ a4jRendered = rendered;
+ }
+
+ public ExtendedDataTableBB() {
}
public ExtendedTableDataModel<DemoPatient> getDataModel(){
Modified: trunk/test-applications/facelets/src/main/webapp/ExtendedDataTable/ExtendedDataTable.xhtml
===================================================================
--- trunk/test-applications/facelets/src/main/webapp/ExtendedDataTable/ExtendedDataTable.xhtml 2008-10-20 16:42:32 UTC (rev 10845)
+++ trunk/test-applications/facelets/src/main/webapp/ExtendedDataTable/ExtendedDataTable.xhtml 2008-10-20 16:54:14 UTC (rev 10846)
@@ -70,6 +70,15 @@
groupingColumn="#{extendedDataTableControlBean.groupingColumn}"
rendered="#{extendedDataTableControlBean.rendered}"
sortPriority="#{extendedDataTableControlBean.sortPriority}">
+
+ <rich:column id="id" headerClass="dataTableHeader" width="25%"
+ label="First name" sortable="true" sortBy="#{patient.firstName}"
+ filterBy="#{patient.id}" filterEvent="onkeyup">
+ <f:facet name="header">
+ <h:outputText value="id" />
+ </f:facet>
+ <h:outputText value="#{patient.id}" />
+ </rich:column>
<rich:column id="firstName" headerClass="dataTableHeader" width="25%"
label="First name" sortable="true" sortBy="#{patient.firstName}"
filterBy="#{patient.firstName}" filterEvent="onkeyup">
@@ -77,7 +86,7 @@
<h:outputText value="First name" />
</f:facet>
<h:outputText id="text" value="#{patient.firstName}">
- <rich:toolTip value="sasasasasasa" />
+ <rich:toolTip value="#{patient.firstName}" />
</h:outputText>
</rich:column>
<rich:column id="lastName" headerClass="dataTableHeader" width="25%"
@@ -97,6 +106,7 @@
<h:outputText value="#{patient.admissionDate}" />
</rich:column>
<a4j:support event="onselectionchange"
+ rendered="#{extendedDataTableBean.a4jRendered}"
action="#{extendedDataTableBean.takeSelection}"
reRender="selectedPatients">
</a4j:support>
Modified: trunk/test-applications/facelets/src/main/webapp/ExtendedDataTable/ExtendedDataTableProperty.xhtml
===================================================================
--- trunk/test-applications/facelets/src/main/webapp/ExtendedDataTable/ExtendedDataTableProperty.xhtml 2008-10-20 16:42:32 UTC (rev 10845)
+++ trunk/test-applications/facelets/src/main/webapp/ExtendedDataTable/ExtendedDataTableProperty.xhtml 2008-10-20 16:54:14 UTC (rev 10846)
@@ -116,11 +116,22 @@
<rich:spacer height="5px" width="100%">
</rich:spacer>
- <rich:dataTable id="selectedPatients"
+ <h:outputText value="Show selection: " />
+ <h:selectBooleanCheckbox value="#{extendedDataTableBean.a4jRendered}"
+ onclick="submit()" />
+ <rich:dataTable id="selectedPatients" rendered="#{extendedDataTableBean.a4jRendered}"
value="#{extendedDataTableBean.selectedItems}" var="selectedPatient">
<f:facet name="header">
<h:outputText value="Selected patient" />
</f:facet>
+ <rich:column id="selectedID" headerClass="dataTableHeader"
+ label="id">
+ <f:facet name="header">
+ <h:outputText value="id" />
+ </f:facet>
+ <h:outputText value="#{selectedPatient.id}" />
+ </rich:column>
+ <!--
<rich:column id="selectedFirstName" headerClass="dataTableHeader"
label="First name">
<f:facet name="header">
@@ -135,6 +146,7 @@
</f:facet>
<h:outputText value="#{selectedPatient.lastName}" />
</rich:column>
+ -->
</rich:dataTable>
<rich:messages>
</rich:messages>
17 years, 2 months