Author: nbelaevski
Date: 2007-10-28 23:11:34 -0400 (Sun, 28 Oct 2007)
New Revision: 3584
Added:
trunk/sandbox/samples/orderingListDemo/src/main/java/org/richfaces/OptionItem.java
trunk/sandbox/samples/orderingListDemo/src/main/java/org/richfaces/OrderingListDemoBean.java
Modified:
trunk/sandbox/samples/orderingListDemo/pom.xml
trunk/sandbox/samples/orderingListDemo/src/main/webapp/WEB-INF/faces-config.xml
trunk/sandbox/samples/orderingListDemo/src/main/webapp/WEB-INF/web.xml
trunk/sandbox/samples/orderingListDemo/src/main/webapp/pages/index.jsp
Log:
orderingList & listShuttle components updated:
- pom.xml
- sandbox added to group
- required dependencies added & excess removed
- listShuttle renamed to orderingList
- orderingListDemo: beans & demo page added
- orderinList: added rendering of table using AbstractRowsRenderer from dataTable
Modified: trunk/sandbox/samples/orderingListDemo/pom.xml
===================================================================
--- trunk/sandbox/samples/orderingListDemo/pom.xml 2007-10-29 03:11:27 UTC (rev 3583)
+++ trunk/sandbox/samples/orderingListDemo/pom.xml 2007-10-29 03:11:34 UTC (rev 3584)
@@ -1,16 +1,23 @@
-<?xml version="1.0"?><project>
+<?xml version="1.0"?>
+<project
xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/maven-v4_0_0.xsd">
<parent>
<artifactId>samples</artifactId>
<groupId>org.richfaces.sandbox</groupId>
<version>3.2.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
- <groupId>org.richfaces</groupId>
+ <groupId>org.richfaces.sandbox.samples</groupId>
<artifactId>orderingListDemo</artifactId>
<packaging>war</packaging>
<name>orderingListDemo Maven Webapp</name>
- <version>1.0-SNAPSHOT</version>
<build>
<finalName>orderingListDemo</finalName>
</build>
+ <dependencies>
+ <dependency>
+ <groupId>org.richfaces.sandbox.ui</groupId>
+ <artifactId>orderingList</artifactId>
+ <version>3.2.0-SNAPSHOT</version>
+ </dependency>
+ </dependencies>
</project>
\ No newline at end of file
Added: trunk/sandbox/samples/orderingListDemo/src/main/java/org/richfaces/OptionItem.java
===================================================================
--- trunk/sandbox/samples/orderingListDemo/src/main/java/org/richfaces/OptionItem.java
(rev 0)
+++
trunk/sandbox/samples/orderingListDemo/src/main/java/org/richfaces/OptionItem.java 2007-10-29
03:11:34 UTC (rev 3584)
@@ -0,0 +1,24 @@
+package org.richfaces;
+
+public class OptionItem {
+ private String name;
+ private int price;
+
+ public OptionItem(String name, int price) {
+ super();
+ this.name = name;
+ this.price = price;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public int getPrice() {
+ return price;
+ }
+
+ public void action() {
+ System.out.println("OptionItem.action(): " + name + " " + price);
+ }
+}
Added:
trunk/sandbox/samples/orderingListDemo/src/main/java/org/richfaces/OrderingListDemoBean.java
===================================================================
---
trunk/sandbox/samples/orderingListDemo/src/main/java/org/richfaces/OrderingListDemoBean.java
(rev 0)
+++
trunk/sandbox/samples/orderingListDemo/src/main/java/org/richfaces/OrderingListDemoBean.java 2007-10-29
03:11:34 UTC (rev 3584)
@@ -0,0 +1,20 @@
+package org.richfaces;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Random;
+
+public class OrderingListDemoBean {
+
+ private List<OptionItem> items = new ArrayList<OptionItem>();
+
+ public OrderingListDemoBean() {
+ for (int i = 0; i < 10; i++) {
+ items.add(new OptionItem("Item " + i, new Random().nextInt(200)));
+ }
+ }
+
+ public List<OptionItem> getItems() {
+ return items;
+ }
+}
Modified: trunk/sandbox/samples/orderingListDemo/src/main/webapp/WEB-INF/faces-config.xml
===================================================================
---
trunk/sandbox/samples/orderingListDemo/src/main/webapp/WEB-INF/faces-config.xml 2007-10-29
03:11:27 UTC (rev 3583)
+++
trunk/sandbox/samples/orderingListDemo/src/main/webapp/WEB-INF/faces-config.xml 2007-10-29
03:11:34 UTC (rev 3584)
@@ -7,4 +7,9 @@
<managed-bean-class>org.richfaces.Bean</managed-bean-class>
<managed-bean-scope>request</managed-bean-scope>
</managed-bean>
+ <managed-bean>
+ <managed-bean-name>demoBean</managed-bean-name>
+
<managed-bean-class>org.richfaces.OrderingListDemoBean</managed-bean-class>
+ <managed-bean-scope>session</managed-bean-scope>
+ </managed-bean>
</faces-config>
Modified: trunk/sandbox/samples/orderingListDemo/src/main/webapp/WEB-INF/web.xml
===================================================================
--- trunk/sandbox/samples/orderingListDemo/src/main/webapp/WEB-INF/web.xml 2007-10-29
03:11:27 UTC (rev 3583)
+++ trunk/sandbox/samples/orderingListDemo/src/main/webapp/WEB-INF/web.xml 2007-10-29
03:11:34 UTC (rev 3584)
@@ -10,6 +10,10 @@
<param-name>javax.faces.STATE_SAVING_METHOD</param-name>
<param-value>server</param-value>
</context-param>
+ <context-param>
+ <param-name>org.ajax4jsf.COMPRESS_SCRIPT</param-name>
+ <param-value>false</param-value>
+ </context-param>
<!--
-->
<filter>
Modified: trunk/sandbox/samples/orderingListDemo/src/main/webapp/pages/index.jsp
===================================================================
--- trunk/sandbox/samples/orderingListDemo/src/main/webapp/pages/index.jsp 2007-10-29
03:11:27 UTC (rev 3583)
+++ trunk/sandbox/samples/orderingListDemo/src/main/webapp/pages/index.jsp 2007-10-29
03:11:34 UTC (rev 3584)
@@ -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/orderingList"
prefix="ol" %>
+
<html>
<head>
<title></title>
</head>
<body>
<f:view>
-
+ <h:form>
+ <ol:orderingList value="#{demoBean.items}" var="item">
+ <h:column>
+ <h:outputText value="#{item.name}" />
+ </h:column>
+ <h:column>
+ <h:outputText value="#{item.price}" />
+ </h:column>
+ </ol:orderingList>
+ </h:form>
</f:view>
</body>
</html>