Author: gmaksimenko
Date: 2008-05-19 13:52:56 -0400 (Mon, 19 May 2008)
New Revision: 8640
Modified:
trunk/test-applications/jsp/src/main/java/custom/Custom.java
trunk/test-applications/jsp/src/main/java/custom/CustomList.java
trunk/test-applications/jsp/src/main/webapp/InplaceInput/InplaceInput.jsp
Log:
Add test for using InplaceInput in dataTable.
Modified: trunk/test-applications/jsp/src/main/java/custom/Custom.java
===================================================================
--- trunk/test-applications/jsp/src/main/java/custom/Custom.java 2008-05-19 17:31:51 UTC
(rev 8639)
+++ trunk/test-applications/jsp/src/main/java/custom/Custom.java 2008-05-19 17:52:56 UTC
(rev 8640)
@@ -39,6 +39,19 @@
this.i2 = 2;
}
+ public Custom(String s0, int i0) {
+ this.s0 = s0;
+ this.i0 = i0;
+ this.index = index;
+ this.b0 = true;
+ this.b1 = true;
+ this.b2 = true;
+ this.s1 = "s1";
+ this.s2 = "s2";
+ this.i1 = 1;
+ this.i2 = 2;
+ }
+
public Custom(int index, boolean b0, boolean b1, boolean b2, String s0, String s1,
String s2, int i0, int i1, int i2) {
this.index = index;
Modified: trunk/test-applications/jsp/src/main/java/custom/CustomList.java
===================================================================
--- trunk/test-applications/jsp/src/main/java/custom/CustomList.java 2008-05-19 17:31:51
UTC (rev 8639)
+++ trunk/test-applications/jsp/src/main/java/custom/CustomList.java 2008-05-19 17:52:56
UTC (rev 8640)
@@ -2,9 +2,13 @@
import java.util.ArrayList;
+import javax.faces.event.ActionEvent;
+
public class CustomList {
private ArrayList<Custom> customList;
+ private ArrayList<Custom> carsList;
private int listSize;
+ private int carsSize;
public CustomList() {
listSize = 12;
@@ -15,6 +19,18 @@
}
}
+ public void cars(ActionEvent e) {
+ carsList = new ArrayList<Custom>();
+ carsSize = 5;
+
+ carsList.add(new Custom("Ford Fiesta",0));
+ carsList.add(new Custom("Ford Mustang",0));
+ carsList.add(new Custom("Ford Ka",0));
+ carsList.add(new Custom("Ford Mondeo",0));
+ carsList.add(new Custom("Ford Focus",0));
+
+ }
+
public void resizeList(int elements){
customList.clear();
for(int i = 0; i < elements; i++){
@@ -37,5 +53,21 @@
public void setCustomList(ArrayList<Custom> testList) {
this.customList = testList;
}
+
+ public ArrayList<Custom> getCarsList() {
+ return carsList;
+ }
+
+ public void setCarsList(ArrayList<Custom> carsList) {
+ this.carsList = carsList;
+ }
+
+ public int getCarsSize() {
+ return carsSize;
+ }
+
+ public void setCarsSize(int carsSize) {
+ this.carsSize = carsSize;
+ }
}
Modified: trunk/test-applications/jsp/src/main/webapp/InplaceInput/InplaceInput.jsp
===================================================================
--- trunk/test-applications/jsp/src/main/webapp/InplaceInput/InplaceInput.jsp 2008-05-19
17:31:51 UTC (rev 8639)
+++ trunk/test-applications/jsp/src/main/webapp/InplaceInput/InplaceInput.jsp 2008-05-19
17:52:56 UTC (rev 8640)
@@ -3,6 +3,41 @@
<%@ taglib
uri="http://richfaces.org/a4j" prefix="a4j"%>
<%@ taglib
uri="http://richfaces.org/rich" prefix="rich"%>
+<f:subview id="inplaceInputSubviewTableID">
+
+ <a4j:commandButton actionListener="#{customList.cars}" value =
"Click" reRender="dataTableID"></a4j:commandButton>
+
+ <rich:dataTable id = "dataTableID" cellpadding="0"
cellspacing="0" value="#{customList.carsList}"
+ width="300" border="0" var="record">
+
+ <f:facet name="header">
+ <rich:columnGroup>
+ <rich:column>
+ <h:outputText value="Cars" />
+ </rich:column>
+ <rich:column>
+ <h:outputText value="Price" />
+ </rich:column>
+ </rich:columnGroup>
+ </f:facet>
+
+ <rich:subTable
+ var="expense" value="">
+ <rich:column>
+ <h:outputText
value="#{record.s0}"></h:outputText>
+ <f:facet name="footer">
+ <rich:spacer />
+ </f:facet>
+ </rich:column>
+ <rich:column>
+ <rich:inplaceInput
defaultLabel="#{record.i0}">$
+ </rich:inplaceInput>
+ </rich:column>
+ </rich:subTable>
+
+ </rich:dataTable>
+</f:subview>
+<br />
<f:subview id="inplaceInputSubviewID">
<h:inputText value="For verify tabbing tabindex=3" size="25"
tabindex="3"></h:inputText> <br/>