Author: nbelaevski
Date: 2007-11-16 19:29:14 -0500 (Fri, 16 Nov 2007)
New Revision: 4067
Added:
trunk/sandbox/samples/listShuttleDemo/src/main/java/org/richfaces/ListShuttleDemoBean.java
trunk/sandbox/samples/listShuttleDemo/src/main/java/org/richfaces/ListShuttleOptionItem.java
Removed:
trunk/sandbox/samples/listShuttleDemo/src/main/java/org/richfaces/Bean.java
Modified:
trunk/sandbox/samples/listShuttleDemo/src/main/webapp/WEB-INF/faces-config.xml
trunk/sandbox/samples/listShuttleDemo/src/main/webapp/pages/index.jsp
Log:
listShuttle work in progress
Deleted: trunk/sandbox/samples/listShuttleDemo/src/main/java/org/richfaces/Bean.java
===================================================================
--- trunk/sandbox/samples/listShuttleDemo/src/main/java/org/richfaces/Bean.java 2007-11-17
00:28:14 UTC (rev 4066)
+++ trunk/sandbox/samples/listShuttleDemo/src/main/java/org/richfaces/Bean.java 2007-11-17
00:29:14 UTC (rev 4067)
@@ -1,29 +0,0 @@
-/**
- * License Agreement.
- *
- * Rich Faces - Natural Ajax for Java Server Faces (JSF)
- *
- * Copyright (C) 2007 Exadel, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License version 2.1 as published by the Free Software Foundation.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-package org.richfaces;
-/**
- * @author $Autor$
- *
- */
-public class Bean {
-
-}
\ No newline at end of file
Added:
trunk/sandbox/samples/listShuttleDemo/src/main/java/org/richfaces/ListShuttleDemoBean.java
===================================================================
---
trunk/sandbox/samples/listShuttleDemo/src/main/java/org/richfaces/ListShuttleDemoBean.java
(rev 0)
+++
trunk/sandbox/samples/listShuttleDemo/src/main/java/org/richfaces/ListShuttleDemoBean.java 2007-11-17
00:29:14 UTC (rev 4067)
@@ -0,0 +1,45 @@
+/**
+ *
+ */
+package org.richfaces;
+
+import java.util.List;
+import java.util.Random;
+
+/**
+ * @author Nick Belaevski
+ * mailto:nbelaevski@exadel.com
+ * created 16.11.2007
+ *
+ */
+public class ListShuttleDemoBean {
+ private ListShuttleOptionItem[] source;
+
+ private List<ListShuttleOptionItem> target;
+
+ public ListShuttleDemoBean() {
+ super();
+
+ source = new ListShuttleOptionItem[10];
+ for (int i = 0; i < source.length; i++) {
+ source[i] = new ListShuttleOptionItem("Item " + i, new
Random().nextInt(40));
+ }
+ }
+
+ public ListShuttleOptionItem[] getSource() {
+ return source;
+ }
+
+ public void setSource(ListShuttleOptionItem[] source) {
+ this.source = source;
+ }
+
+ public List<ListShuttleOptionItem> getTarget() {
+ return target;
+ }
+
+ public void setTarget(List<ListShuttleOptionItem> target) {
+ this.target = target;
+ }
+
+}
Added:
trunk/sandbox/samples/listShuttleDemo/src/main/java/org/richfaces/ListShuttleOptionItem.java
===================================================================
---
trunk/sandbox/samples/listShuttleDemo/src/main/java/org/richfaces/ListShuttleOptionItem.java
(rev 0)
+++
trunk/sandbox/samples/listShuttleDemo/src/main/java/org/richfaces/ListShuttleOptionItem.java 2007-11-17
00:29:14 UTC (rev 4067)
@@ -0,0 +1,40 @@
+/**
+ *
+ */
+package org.richfaces;
+
+
+/**
+ * @author Nick Belaevski
+ * mailto:nbelaevski@exadel.com
+ * created 16.11.2007
+ *
+ */
+public class ListShuttleOptionItem {
+ private String name;
+ private int price;
+
+ public ListShuttleOptionItem(String name, int price) {
+ super();
+ this.name = name;
+ this.price = price;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ public int getPrice() {
+ return price;
+ }
+
+ @Override
+ public String toString() {
+ return this.getClass().getSimpleName() + " [" + name + "] by " +
price;
+ }
+
+}
Modified: trunk/sandbox/samples/listShuttleDemo/src/main/webapp/WEB-INF/faces-config.xml
===================================================================
---
trunk/sandbox/samples/listShuttleDemo/src/main/webapp/WEB-INF/faces-config.xml 2007-11-17
00:28:14 UTC (rev 4066)
+++
trunk/sandbox/samples/listShuttleDemo/src/main/webapp/WEB-INF/faces-config.xml 2007-11-17
00:29:14 UTC (rev 4067)
@@ -3,8 +3,8 @@
"http://java.sun.com/dtd/web-facesconfig_1_1.dtd">
<faces-config>
<managed-bean>
- <managed-bean-name>bean</managed-bean-name>
- <managed-bean-class>org.richfaces.Bean</managed-bean-class>
- <managed-bean-scope>request</managed-bean-scope>
+ <managed-bean-name>listShuttleDemoBean</managed-bean-name>
+ <managed-bean-class>org.richfaces.ListShuttleDemoBean</managed-bean-class>
+ <managed-bean-scope>session</managed-bean-scope>
</managed-bean>
</faces-config>
Modified: trunk/sandbox/samples/listShuttleDemo/src/main/webapp/pages/index.jsp
===================================================================
--- trunk/sandbox/samples/listShuttleDemo/src/main/webapp/pages/index.jsp 2007-11-17
00:28:14 UTC (rev 4066)
+++ trunk/sandbox/samples/listShuttleDemo/src/main/webapp/pages/index.jsp 2007-11-17
00:29:14 UTC (rev 4067)
@@ -1,12 +1,23 @@
<%@ taglib
uri="http://java.sun.com/jsf/html" prefix="h" %>
<%@ taglib
uri="http://java.sun.com/jsf/core" prefix="f"%>
+
+<%@ taglib
uri="http://labs.jboss.com/jbossrichfaces/ui/ui/listShuttle"
prefix="ls" %>
+
<html>
<head>
<title></title>
</head>
<body>
<f:view>
+ <h:form>
+ <ls:listShuttle sourceValue="#{listShuttleDemoBean.source}"
targetValue="#{listShuttleDemoBean.target}">
+
+ </ls:listShuttle>
+
+ <h:commandButton value="Submit" />
+ <h:commandButton value="Submit Immediate" immediate="true"
/>
+ </h:form>
</f:view>
</body>
</html>