Author: adubovsky
Date: 2008-06-12 08:26:53 -0400 (Thu, 12 Jun 2008)
New Revision: 9017
Modified:
branches/3.1.x/test-applications/jsp/src/main/java/dataOrderedList/DataOrderedList.java
branches/3.1.x/test-applications/jsp/src/main/webapp/DataOrderedList/DataOrderedList.jsp
branches/3.1.x/test-applications/jsp/src/main/webapp/DataOrderedList/DataOrderedListProperty.jsp
Log:
Add binding and change used data for DataOrderedList
Modified:
branches/3.1.x/test-applications/jsp/src/main/java/dataOrderedList/DataOrderedList.java
===================================================================
---
branches/3.1.x/test-applications/jsp/src/main/java/dataOrderedList/DataOrderedList.java 2008-06-12
11:07:13 UTC (rev 9016)
+++
branches/3.1.x/test-applications/jsp/src/main/java/dataOrderedList/DataOrderedList.java 2008-06-12
12:26:53 UTC (rev 9017)
@@ -1,7 +1,13 @@
package dataOrderedList;
import java.util.ArrayList;
+import java.util.Random;
+import javax.faces.context.FacesContext;
+import javax.faces.event.ActionEvent;
+
+import org.richfaces.component.html.HtmlDataOrderedList;
+
import util.data.Data;
public class DataOrderedList
@@ -14,7 +20,33 @@
private String type;
private String dir;
private int mSize;
+ private HtmlDataOrderedList myDataOrderedList;
+ private String bindLabel;
+ public void bindingCheck(ActionEvent actionEvent){
+ FacesContext faces = FacesContext.getCurrentInstance();
+ bindLabel = myDataOrderedList.getBaseClientId(faces);
+ System.out.println("============LS Binding Check===========");
+ System.out.println(myDataOrderedList.getBaseClientId(faces));
+ System.out.println("============LS Binding Check===========");
+ }
+
+ public String getBindLabel() {
+ return bindLabel;
+ }
+
+ public void setBindLabel(String bindLabel) {
+ this.bindLabel = bindLabel;
+ }
+
+ public HtmlDataOrderedList getMyDataOrderedList() {
+ return myDataOrderedList;
+ }
+
+ public void setMyDataOrderedList(HtmlDataOrderedList myDataOrderedList) {
+ this.myDataOrderedList = myDataOrderedList;
+ }
+
public String getDir() {
return dir;
}
@@ -44,8 +76,10 @@
rendered = true;
title = "title";
type = "1";
- for(int i = 1; i < Data.cityAfrica.length; i++)
- arr.add(new Data(Data.cityAfrica[i]));
+ Random randomGenerator = new Random();
+ for(int i = 0; i < Data.cars.length; i++)
+ arr.add(new Data(Data.cars[i], randomGenerator.nextInt(1000000),
randomGenerator.nextInt(1000000)));
+ this.bindLabel = "Not checked";
}
public int getFirst() {
Modified:
branches/3.1.x/test-applications/jsp/src/main/webapp/DataOrderedList/DataOrderedList.jsp
===================================================================
---
branches/3.1.x/test-applications/jsp/src/main/webapp/DataOrderedList/DataOrderedList.jsp 2008-06-12
11:07:13 UTC (rev 9016)
+++
branches/3.1.x/test-applications/jsp/src/main/webapp/DataOrderedList/DataOrderedList.jsp 2008-06-12
12:26:53 UTC (rev 9017)
@@ -4,15 +4,21 @@
<%@ taglib
uri="http://richfaces.org/rich" prefix="rich"%>
<f:subview id="dataOrderedListSubviewID">
- <rich:dataOrderedList id="doListID"
value="#{dataOrderedList.arr}" var="arr"
first="#{dataOrderedList.first}"
- rendered="#{dataOrderedList.rendered}"
title="#{dataOrderedList.title}" type="#{dataOrderedList.type}"
dir="#{dataOrderedList.dir}"
- rows="#{dataOrderedList.rows}">
- <f:facet name="header">
- <h:outputText value="Africa(header):" />
- </f:facet>
- <h:outputText value="#{arr.str0}" />
- <f:facet name="footer">
- <h:outputText value="Africa(footer);" />
- </f:facet>
+ <rich:dataOrderedList id="dataOrderedListID"
+ value="#{dataOrderedList.arr}" var="arr"
+ first="#{dataOrderedList.first}"
+ rendered="#{dataOrderedList.rendered}"
+ title="#{dataOrderedList.title}"
+ type="#{dataOrderedList.type}"
+ dir="#{dataOrderedList.dir}"
+ rows="#{dataOrderedList.rows}"
+ binding="#{dataOrderedList.myDataOrderedList}">
+
+ <h:outputText value="#{arr.str0} " /><f:verbatim><br
/></f:verbatim>
+ <h:outputText value="Price: $"
styleClass="label"></h:outputText>
+ <h:outputText value="#{arr.int0} " /><f:verbatim><br
/></f:verbatim>
+ <h:outputText value="Mileage: "
styleClass="label"></h:outputText>
+ <h:outputText value="#{arr.int1} " />
+ <h:outputText value=" Miles" />
</rich:dataOrderedList>
</f:subview>
Modified:
branches/3.1.x/test-applications/jsp/src/main/webapp/DataOrderedList/DataOrderedListProperty.jsp
===================================================================
---
branches/3.1.x/test-applications/jsp/src/main/webapp/DataOrderedList/DataOrderedListProperty.jsp 2008-06-12
11:07:13 UTC (rev 9016)
+++
branches/3.1.x/test-applications/jsp/src/main/webapp/DataOrderedList/DataOrderedListProperty.jsp 2008-06-12
12:26:53 UTC (rev 9017)
@@ -5,26 +5,31 @@
<f:subview id="dataOrderedListPropertySubviewID">
<h:panelGrid columns="2">
+ <a4j:commandButton reRender="outBindingCheck"
+ actionListener="#{dataOrderedList.bindingCheck}"
+ value="binding Check" />
+ <h:outputText id="outBindingCheck"
value="#{dataOrderedList.bindLabel}" />
+
<h:outputText value="title" />
<h:inputText value="#{dataOrderedList.title}" >
- <a4j:support event="onchange"
reRender="doListID"></a4j:support>
+ <a4j:support event="onchange"
reRender="dataOrderedListID"></a4j:support>
</h:inputText>
<h:outputText value="first" />
<h:inputText value="#{dataOrderedList.first}" >
- <a4j:support event="onchange"
reRender="doListID"></a4j:support>
+ <a4j:support event="onchange"
reRender="dataOrderedListID"></a4j:support>
</h:inputText>
<h:outputText value="rows" />
<h:inputText value="#{dataOrderedList.rows}" >
- <a4j:support event="onchange"
reRender="doListID"></a4j:support>
+ <a4j:support event="onchange"
reRender="dataOrderedListID"></a4j:support>
</h:inputText>
<h:outputText value="dir" />
<h:selectOneRadio value="#{dataOrderedList.dir}">
<f:selectItem itemValue="LTR" itemLabel="LTR"/>
<f:selectItem itemValue="RTL" itemLabel="RTL"/>
- <a4j:support event="onchange"
reRender="doListID"></a4j:support>
+ <a4j:support event="onchange"
reRender="dataOrderedListID"></a4j:support>
</h:selectOneRadio>
<h:outputText value="type" />
@@ -37,7 +42,7 @@
<f:selectItem itemValue="disc" itemLabel="disc"/>
<f:selectItem itemValue="circle" itemLabel="circle"/>
<f:selectItem itemValue="square" itemLabel="square"/>
- <a4j:support event="onchange"
reRender="doListID"></a4j:support>
+ <a4j:support event="onchange"
reRender="dataOrderedListID"></a4j:support>
</h:selectOneMenu>
<h:outputText value="rendered" />