You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by bo...@apache.org on 2006/08/17 22:14:43 UTC
svn commit: r432373 - in /myfaces/tobago/trunk/example/facelets/src/main:
java/org/apache/myfaces/tobago/example/facelets/ webapp/ webapp/WEB-INF/
Author: bommel
Date: Thu Aug 17 13:14:43 2006
New Revision: 432373
URL: http://svn.apache.org/viewvc?rev=432373&view=rev
Log:
added a table to facelets example
Added:
myfaces/tobago/trunk/example/facelets/src/main/java/org/apache/myfaces/tobago/example/facelets/MessageBackingBean.java
myfaces/tobago/trunk/example/facelets/src/main/java/org/apache/myfaces/tobago/example/facelets/User.java
myfaces/tobago/trunk/example/facelets/src/main/webapp/table.xml
Modified:
myfaces/tobago/trunk/example/facelets/src/main/webapp/WEB-INF/faces-config.xml
myfaces/tobago/trunk/example/facelets/src/main/webapp/WEB-INF/web.xml
Added: myfaces/tobago/trunk/example/facelets/src/main/java/org/apache/myfaces/tobago/example/facelets/MessageBackingBean.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/example/facelets/src/main/java/org/apache/myfaces/tobago/example/facelets/MessageBackingBean.java?rev=432373&view=auto
==============================================================================
--- myfaces/tobago/trunk/example/facelets/src/main/java/org/apache/myfaces/tobago/example/facelets/MessageBackingBean.java (added)
+++ myfaces/tobago/trunk/example/facelets/src/main/java/org/apache/myfaces/tobago/example/facelets/MessageBackingBean.java Thu Aug 17 13:14:43 2006
@@ -0,0 +1,47 @@
+package org.apache.myfaces.tobago.example.facelets;
+
+/*
+ * Copyright 2002-2005 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import javax.faces.model.SelectItem;
+import java.util.List;
+import java.util.ArrayList;
+
+public class MessageBackingBean {
+ private String type;
+
+ public String getType() {
+ return type;
+ }
+
+ public void setType(String type) {
+ this.type = type;
+ }
+
+ public SelectItem [] getSelectionItems() {
+ SelectItem items [] = new SelectItem[2];
+ items[0] = new SelectItem("One", "One");
+ items[1] = new SelectItem("Two", "Two");
+ return items;
+ }
+
+ public List<User> getList() {
+ List<User> list = new ArrayList<User>();
+ list.add(new User("Anton", "Antonius"));
+ list.add(new User("Bill", "Bilson"));
+ return list;
+ }
+}
Added: myfaces/tobago/trunk/example/facelets/src/main/java/org/apache/myfaces/tobago/example/facelets/User.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/example/facelets/src/main/java/org/apache/myfaces/tobago/example/facelets/User.java?rev=432373&view=auto
==============================================================================
--- myfaces/tobago/trunk/example/facelets/src/main/java/org/apache/myfaces/tobago/example/facelets/User.java (added)
+++ myfaces/tobago/trunk/example/facelets/src/main/java/org/apache/myfaces/tobago/example/facelets/User.java Thu Aug 17 13:14:43 2006
@@ -0,0 +1,35 @@
+package org.apache.myfaces.tobago.example.facelets;
+
+/*
+ * Copyright 2002-2005 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+public class User {
+ private String name;
+ private String surname;
+
+ public User(String name, String surname) {
+ this.name = name;
+ this.surname = surname;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public String getSurname() {
+ return surname;
+ }
+}
Modified: myfaces/tobago/trunk/example/facelets/src/main/webapp/WEB-INF/faces-config.xml
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/example/facelets/src/main/webapp/WEB-INF/faces-config.xml?rev=432373&r1=432372&r2=432373&view=diff
==============================================================================
--- myfaces/tobago/trunk/example/facelets/src/main/webapp/WEB-INF/faces-config.xml (original)
+++ myfaces/tobago/trunk/example/facelets/src/main/webapp/WEB-INF/faces-config.xml Thu Aug 17 13:14:43 2006
@@ -41,6 +41,12 @@
<managed-bean-scope>session</managed-bean-scope>
</managed-bean>
+ <managed-bean>
+ <managed-bean-name>messageBackingBean</managed-bean-name>
+ <managed-bean-class>org.apache.myfaces.tobago.example.facelets.MessageBackingBean</managed-bean-class>
+ <managed-bean-scope>session</managed-bean-scope>
+ </managed-bean>
+
<navigation-rule>
<navigation-case>
<from-outcome>next</from-outcome>
Modified: myfaces/tobago/trunk/example/facelets/src/main/webapp/WEB-INF/web.xml
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/example/facelets/src/main/webapp/WEB-INF/web.xml?rev=432373&r1=432372&r2=432373&view=diff
==============================================================================
--- myfaces/tobago/trunk/example/facelets/src/main/webapp/WEB-INF/web.xml (original)
+++ myfaces/tobago/trunk/example/facelets/src/main/webapp/WEB-INF/web.xml Thu Aug 17 13:14:43 2006
@@ -21,7 +21,7 @@
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"
version="2.4">
- <display-name>Blank Tobago Application</display-name>
+ <display-name>Tobago Facelets Example Application</display-name>
<context-param>
Added: myfaces/tobago/trunk/example/facelets/src/main/webapp/table.xml
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/example/facelets/src/main/webapp/table.xml?rev=432373&view=auto
==============================================================================
--- myfaces/tobago/trunk/example/facelets/src/main/webapp/table.xml (added)
+++ myfaces/tobago/trunk/example/facelets/src/main/webapp/table.xml Thu Aug 17 13:14:43 2006
@@ -0,0 +1,38 @@
+<f:view xmlns:f="http://java.sun.com/jsf/core"
+ xmlns:ui="http://java.sun.com/jsf/facelets"
+ xmlns:tc="http://myfaces.apache.org/tobago/component"
+ xmlns:tx="http://myfaces.apache.org/tobago/facelet-extension">
+ <tc:page label="Tobago Sheet Faclets" width="640px" height="300px" >
+ <f:facet name="layout">
+ <tc:gridLayout margin="10px" rows="1*;2*;2*"/>
+ </f:facet>
+ <tc:messages />
+ <tc:form>
+ <tc:box label="Busqueda de usuarios" >
+ <f:facet name="layout">
+ <tc:gridLayout rows="fixed;*" columns="1*;1*" />
+ </f:facet>
+ <f:facet name="toolBar">
+ <tc:toolBar>
+ <tc:button label="Buscar" defaultCommand="true" />
+ <tc:button label="Agregar" />
+ </tc:toolBar>
+ </f:facet>
+ <tx:selectOneChoice value="#{messageBackingBean.type}" label="Tipo Usuario">
+ <f:selectItems value="#{messageBackingBean.selectionItems}"/>
+ </tx:selectOneChoice>
+
+ <tx:in label="Usuario" />
+ <tc:cell spanX="2" >
+ <tc:sheet columns="1*" value="#{messageBackingBean.list}"
+ var="emp" showPageRange="center"
+ showRowRange="left" rows="5" >
+ <tc:column label="Nombre" sortable="true" >
+ <tc:out value="#{emp.name} #{emp.surname}" />
+ </tc:column>
+ </tc:sheet>
+ </tc:cell>
+ </tc:box>
+ </tc:form>
+ </tc:page>
+</f:view>
\ No newline at end of file