Author: nbelaevski
Date: 2008-08-21 15:08:43 -0400 (Thu, 21 Aug 2008)
New Revision: 10170
Added:
trunk/samples/richfaces-demo/src/main/java/org/richfaces/demo/capitals/CapitalData.java
Modified:
trunk/samples/richfaces-demo/src/main/java/org/richfaces/demo/capitals/Capital.java
trunk/samples/richfaces-demo/src/main/resources/org/richfaces/demo/capitals/capitals-rules.xml
trunk/samples/richfaces-demo/src/main/resources/org/richfaces/demo/capitals/capitals.xml
Log:
Started implementation of JS objects in suggestion demo
Modified:
trunk/samples/richfaces-demo/src/main/java/org/richfaces/demo/capitals/Capital.java
===================================================================
---
trunk/samples/richfaces-demo/src/main/java/org/richfaces/demo/capitals/Capital.java 2008-08-21
18:58:59 UTC (rev 10169)
+++
trunk/samples/richfaces-demo/src/main/java/org/richfaces/demo/capitals/Capital.java 2008-08-21
19:08:43 UTC (rev 10170)
@@ -11,7 +11,14 @@
private String name;
private String state;
private String timeZone;
+ private CapitalData data;
+ public CapitalData getData() {
+ return data;
+ }
+ public void setData(CapitalData data) {
+ this.data = data;
+ }
private final static String FILE_EXT = ".gif";
public Capital() {
}
Added:
trunk/samples/richfaces-demo/src/main/java/org/richfaces/demo/capitals/CapitalData.java
===================================================================
---
trunk/samples/richfaces-demo/src/main/java/org/richfaces/demo/capitals/CapitalData.java
(rev 0)
+++
trunk/samples/richfaces-demo/src/main/java/org/richfaces/demo/capitals/CapitalData.java 2008-08-21
19:08:43 UTC (rev 10170)
@@ -0,0 +1,23 @@
+package org.richfaces.demo.capitals;
+
+import java.io.Serializable;
+import java.util.ArrayList;
+import java.util.List;
+
+public class CapitalData implements Serializable {
+
+ /**
+ *
+ */
+ private static final long serialVersionUID = -3456988151970108426L;
+ private List<String> items = new ArrayList<String>();
+
+ public void addItem(String item) {
+ items.add(item);
+ }
+
+ public List<String> getItems() {
+ return items;
+ }
+
+}
Modified:
trunk/samples/richfaces-demo/src/main/resources/org/richfaces/demo/capitals/capitals-rules.xml
===================================================================
---
trunk/samples/richfaces-demo/src/main/resources/org/richfaces/demo/capitals/capitals-rules.xml 2008-08-21
18:58:59 UTC (rev 10169)
+++
trunk/samples/richfaces-demo/src/main/resources/org/richfaces/demo/capitals/capitals-rules.xml 2008-08-21
19:08:43 UTC (rev 10170)
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
<!DOCTYPE digester-rules SYSTEM "digester-rules.dtd">
--->
+ -->
<digester-rules>
<pattern value="*/capital">
@@ -10,5 +10,14 @@
<bean-property-setter-rule pattern="state"
propertyname="state"/>
<bean-property-setter-rule pattern="timeZone"
propertyname="timeZone"/>
<set-next-rule methodname="addCapital"/>
+
+ <pattern value="data">
+ <object-create-rule classname="org.richfaces.demo.capitals.CapitalData"
/>
+ <set-next-rule methodname="setData"/>
+
+ <pattern value="item">
+ <call-method-rule methodname="addItem" paramcount="0" />
+ </pattern>
+ </pattern>
</pattern>
</digester-rules>
\ No newline at end of file
Modified:
trunk/samples/richfaces-demo/src/main/resources/org/richfaces/demo/capitals/capitals.xml
===================================================================
---
trunk/samples/richfaces-demo/src/main/resources/org/richfaces/demo/capitals/capitals.xml 2008-08-21
18:58:59 UTC (rev 10169)
+++
trunk/samples/richfaces-demo/src/main/resources/org/richfaces/demo/capitals/capitals.xml 2008-08-21
19:08:43 UTC (rev 10170)
@@ -4,6 +4,11 @@
<state>Alabama</state>
<name>Montgomery</name>
<timeZone>GMT-6</timeZone>
+ <!-- data>
+ <item>Birmingham</item>
+ <item>Montgomery</item>
+ <item>Mobile</item>
+ </data -->
</capital>
<capital>
<state>Alaska</state>
Show replies by date