Author: mvitenkov
Date: 2008-04-22 13:47:08 -0400 (Tue, 22 Apr 2008)
New Revision: 8079
Modified:
branches/3.1.x/test-applications/jsp/src/main/java/orderingList/OrderingList.java
branches/3.1.x/test-applications/jsp/src/main/webapp/OrderingList/OrderingList.jsp
Log:
valueChangeListener & activeItem were added
Modified:
branches/3.1.x/test-applications/jsp/src/main/java/orderingList/OrderingList.java
===================================================================
---
branches/3.1.x/test-applications/jsp/src/main/java/orderingList/OrderingList.java 2008-04-22
17:21:16 UTC (rev 8078)
+++
branches/3.1.x/test-applications/jsp/src/main/java/orderingList/OrderingList.java 2008-04-22
17:47:08 UTC (rev 8079)
@@ -7,11 +7,11 @@
import javax.faces.component.html.HtmlDataTable;
import javax.faces.context.FacesContext;
import javax.faces.event.ActionEvent;
-
+import javax.faces.event.ValueChangeEvent;
import util.data.Data;
public class OrderingList{
- private String bindingCheck;
+ private String bindLabel;
private HtmlOrderingList myOrderingList;
private ArrayList<String> info;
private ArrayList<Data> list;
@@ -27,6 +27,7 @@
private String listHeight;
private String listWidth;
private int lenght;
+ private Object activeItem = new Object();
private boolean orderControlsVisible;
private boolean fastOrderControlsVisible;
private boolean rendered;
@@ -37,10 +38,11 @@
public void bindingCheck(ActionEvent actionEvent){
FacesContext faces = FacesContext.getCurrentInstance();
- bindingCheck = "Passed";
+ bindLabel = "Passed";
System.out.println("============OL Binding Check===========");
System.out.println(myOrderingList.getBaseClientId(faces));
System.out.println("============OL Binding Check===========");
+ System.out.println(activeItem.toString());
}
public boolean isFacet() {
@@ -81,7 +83,7 @@
}
public OrderingList() {
- this.bindingCheck = "Not checked";
+ this.bindLabel = "Not checked";
this.info = new ArrayList<String>();
this.captionLabel = "captionLabel";
this.lenght = 10;
@@ -101,6 +103,7 @@
this.showAllData = true;
this.showSelect = true;
this.list = new ArrayList<Data>();
+ //this.activeItem = 1;
addNewItem();
}
@@ -373,11 +376,22 @@
this.myOrderingList = myOrderingList;
}
- public String getBindingCheck() {
- return bindingCheck;
+ public Object getActiveItem() {
+ return activeItem;
}
- public void setBindingCheck(String bindingCheck) {
- this.bindingCheck = bindingCheck;
+ public void setActiveItem(Object activeItem) {
+ this.activeItem = activeItem;
}
+
+ public String getBindLabel() {
+ return bindLabel;
+ }
+
+ public void setBindLabel(String bindLabel) {
+ this.bindLabel = bindLabel;
+ }
+ public void valueChangeListener(ValueChangeEvent valueChangeEvent){
+ System.out.println("ValueChangeListener work:" +
myOrderingList.getActiveItem());
+ }
}
Modified:
branches/3.1.x/test-applications/jsp/src/main/webapp/OrderingList/OrderingList.jsp
===================================================================
---
branches/3.1.x/test-applications/jsp/src/main/webapp/OrderingList/OrderingList.jsp 2008-04-22
17:21:16 UTC (rev 8078)
+++
branches/3.1.x/test-applications/jsp/src/main/webapp/OrderingList/OrderingList.jsp 2008-04-22
17:47:08 UTC (rev 8079)
@@ -9,7 +9,7 @@
<h:messages />
</a4j:outputPanel>
- <rich:orderingList id="orderingListID" immediate="false"
+ <rich:orderingList id="orderingListID" immediate="true"
binding="#{orderingList.myOrderingList}"
value="#{orderingList.list}"
var="item" listHeight="#{orderingList.listHeight}"
listWidth="#{orderingList.listWidth}"
@@ -36,8 +36,10 @@
ontopclick="showEvent('ontopclickInputID', 'ontopclick
work!')"
onupclick="showEvent('onupclickInputID', 'onupclick work!')"
ondownclick="showEvent('ondownclickInputID', 'ondownclick
work!')"
- onbottomclick="showEvent('onbottomclickInputID', 'onbottomclick
work!')"
- onheaderclick="showEvent('onheaderclickInputID', 'onheaderclick
work!')">
+ onbottomclick="alert('onbottomclick')"
+ onheaderclick="alert('onheaderclick')"
+ activeItem="#{orderingList.activeItem}"
+ rowClasses="rowA, rowB"
valueChangeListener="#{orderingList.valueChangeListener}">
<f:facet name="header">
<h:outputText value="header" />
</f:facet>
@@ -114,7 +116,7 @@
<h:panelGrid columns="2">
<a4j:commandButton reRender="outBindingCheck"
actionListener="#{orderingList.bindingCheck}"
value="binding Check" />
- <h:outputText id="outBindingCheck"
value="#{orderingList.bindingCheck}" />
+ <h:outputText id="outBindingCheck"
value="#{orderingList.bindLabel}" />
</h:panelGrid>
<h:panelGrid columns="3">