Author: adubovsky
Date: 2008-06-11 04:20:07 -0400 (Wed, 11 Jun 2008)
New Revision: 8991
Modified:
branches/3.1.x/test-applications/facelets/src/main/java/listShuttle/ListShuttle.java
branches/3.1.x/test-applications/facelets/src/main/webapp/ListShuttle/ListShuttle.xhtml
Log:
Add binding
Modified:
branches/3.1.x/test-applications/facelets/src/main/java/listShuttle/ListShuttle.java
===================================================================
---
branches/3.1.x/test-applications/facelets/src/main/java/listShuttle/ListShuttle.java 2008-06-11
00:31:51 UTC (rev 8990)
+++
branches/3.1.x/test-applications/facelets/src/main/java/listShuttle/ListShuttle.java 2008-06-11
08:20:07 UTC (rev 8991)
@@ -4,11 +4,17 @@
import java.util.Collection;
import java.util.Iterator;
+import javax.faces.context.FacesContext;
+import javax.faces.event.ActionEvent;
import javax.faces.event.ValueChangeEvent;
+import org.richfaces.component.html.HtmlListShuttle;
+
import util.data.Data;
public class ListShuttle {
+ private HtmlListShuttle myListShuttle;
+ private String bindLabel;
private int first;
private int lenght;
private String [] statusIcon = {"/pics/error.gif",
"/pics/fatal.gif", "/pics/info.gif", "/pics/passed.gif",
"/pics/warn.gif"};
@@ -47,6 +53,7 @@
public ListShuttle() {
this.first = 1;
this.lenght = 10;
+ this.bindLabel = "Not checked";
this.showSelect = true;
this.showAllSourceData = true;
this.showAllTargetData = true;
@@ -79,6 +86,30 @@
addNewItem();
}
+ public void bindingCheck(ActionEvent actionEvent){
+ FacesContext faces = FacesContext.getCurrentInstance();
+ bindLabel = myListShuttle.getBaseClientId(faces);
+ System.out.println("============LS Binding Check===========");
+ System.out.println(myListShuttle.getBaseClientId(faces));
+ System.out.println("============LS Binding Check===========");
+ }
+
+ public String getBindLabel() {
+ return bindLabel;
+ }
+
+ public void setBindLabel(String bindLabel) {
+ this.bindLabel = bindLabel;
+ }
+
+ public HtmlListShuttle getMyListShuttle() {
+ return myListShuttle;
+ }
+
+ public void setMyListShuttle(HtmlListShuttle myListShuttle) {
+ this.myListShuttle = myListShuttle;
+ }
+
public boolean getRendered() {
return rendered;
}
Modified:
branches/3.1.x/test-applications/facelets/src/main/webapp/ListShuttle/ListShuttle.xhtml
===================================================================
---
branches/3.1.x/test-applications/facelets/src/main/webapp/ListShuttle/ListShuttle.xhtml 2008-06-11
00:31:51 UTC (rev 8990)
+++
branches/3.1.x/test-applications/facelets/src/main/webapp/ListShuttle/ListShuttle.xhtml 2008-06-11
08:20:07 UTC (rev 8991)
@@ -32,7 +32,8 @@
rendered="#{listShuttle.rendered}"
moveControlsVerticalAlign="#{listShuttle.moveControlsVerticalAlign}"
- orderControlsVerticalAlign="#{listShuttle.orderControlsVerticalAlign}">
+ orderControlsVerticalAlign="#{listShuttle.orderControlsVerticalAlign}"
+ binding="#{listShuttle.myListShuttle}">
<h:column>
<f:facet name="header">
@@ -97,4 +98,11 @@
<h:graphicImage value="#{item.str3}" />
</h:column>
</rich:listShuttle>
+
+ <h:panelGrid columns="2">
+ <a4j:commandButton reRender="outBindingCheck"
actionListener="#{listShuttle.bindingCheck}"
+ value="binding Check" />
+ <h:outputText id="outBindingCheck"
value="#{listShuttle.bindLabel}" />
+ </h:panelGrid>
+
</f:subview>
\ No newline at end of file