You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by lo...@apache.org on 2007/07/30 15:55:21 UTC
svn commit: r560982 - in /myfaces/tobago/trunk/example/demo/src/main:
java/org/apache/myfaces/tobago/example/reference/SimpleBean.java
webapp/reference/sheet.jsp
Author: lofwyr
Date: Mon Jul 30 06:55:20 2007
New Revision: 560982
URL: http://svn.apache.org/viewvc?view=rev&rev=560982
Log:
sample
Modified:
myfaces/tobago/trunk/example/demo/src/main/java/org/apache/myfaces/tobago/example/reference/SimpleBean.java
myfaces/tobago/trunk/example/demo/src/main/webapp/reference/sheet.jsp
Modified: myfaces/tobago/trunk/example/demo/src/main/java/org/apache/myfaces/tobago/example/reference/SimpleBean.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/example/demo/src/main/java/org/apache/myfaces/tobago/example/reference/SimpleBean.java?view=diff&rev=560982&r1=560981&r2=560982
==============================================================================
--- myfaces/tobago/trunk/example/demo/src/main/java/org/apache/myfaces/tobago/example/reference/SimpleBean.java (original)
+++ myfaces/tobago/trunk/example/demo/src/main/java/org/apache/myfaces/tobago/example/reference/SimpleBean.java Mon Jul 30 06:55:20 2007
@@ -1,5 +1,7 @@
package org.apache.myfaces.tobago.example.reference;
+import java.util.Date;
+
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
@@ -19,20 +21,22 @@
public class SimpleBean {
- private String name;
+ private int number;
private String value;
+ private Date date;
- public SimpleBean(String name, String value) {
- this.name = name;
+ public SimpleBean(int number, String value) {
+ this.number = number;
this.value = value;
+ this.date = new Date();
}
- public String getName() {
- return name;
+ public int getNumber() {
+ return number;
}
- public void setName(String name) {
- this.name = name;
+ public void setNumber(int number) {
+ this.number = number;
}
public String getValue() {
@@ -41,5 +45,13 @@
public void setValue(String value) {
this.value = value;
+ }
+
+ public Date getDate() {
+ return date;
+ }
+
+ public void setDate(Date date) {
+ this.date = date;
}
}
Modified: myfaces/tobago/trunk/example/demo/src/main/webapp/reference/sheet.jsp
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/example/demo/src/main/webapp/reference/sheet.jsp?view=diff&rev=560982&r1=560981&r2=560982
==============================================================================
--- myfaces/tobago/trunk/example/demo/src/main/webapp/reference/sheet.jsp (original)
+++ myfaces/tobago/trunk/example/demo/src/main/webapp/reference/sheet.jsp Mon Jul 30 06:55:20 2007
@@ -21,10 +21,11 @@
System.out.println("1" + session.getAttribute("simpleList"));
if (simpleList == null) {
simpleList = new SimpleBean[]{
- new SimpleBean("1", "One"),
- new SimpleBean("2", "Two"),
- new SimpleBean("3", "Three"),
- new SimpleBean("4", "Four")};
+ new SimpleBean(1, "One"),
+ new SimpleBean(2, "Two"),
+ new SimpleBean(3, "Three"),
+ new SimpleBean(4, "Four"),
+ new SimpleBean(5000000, "Five Million")};
}
session.setAttribute("simpleList", simpleList);
System.out.println("2" + session.getAttribute("simpleList"));
@@ -56,12 +57,17 @@
</f:facet>
</tc:separator>
- <tc:sheet value="#{simpleList}" columns="*;*" var="bean" rows="5">
+ <tc:sheet value="#{simpleList}" columns="*;*;*" var="bean" rows="5">
<tc:column label="Cipher">
- <tc:out value="#{bean.name}"/>
+ <tc:out value="#{bean.number}"/>
</tc:column>
<tc:column label="Name">
<tc:out value="#{bean.value}"/>
+ </tc:column>
+ <tc:column label="Date">
+ <tc:in value="#{bean.date}">
+ <f:convertDateTime dateStyle="medium" type="date"/>
+ </tc:in>
</tc:column>
</tc:sheet>