Author: ilya_shaikovsky
Date: 2010-07-23 09:06:59 -0400 (Fri, 23 Jul 2010)
New Revision: 18212
Added:
root/examples/richfaces-showcase/trunk/src/main/java/org/richfaces/demo/lists/
root/examples/richfaces-showcase/trunk/src/main/java/org/richfaces/demo/lists/ListBean.java
root/examples/richfaces-showcase/trunk/src/main/webapp/richfaces/list/
root/examples/richfaces-showcase/trunk/src/main/webapp/richfaces/list/lists.xhtml
Modified:
root/examples/richfaces-showcase/trunk/src/main/resources/org/richfaces/demo/data/common/navigation.xml
Log:
https://jira.jboss.org/browse/RF-8967
Added:
root/examples/richfaces-showcase/trunk/src/main/java/org/richfaces/demo/lists/ListBean.java
===================================================================
---
root/examples/richfaces-showcase/trunk/src/main/java/org/richfaces/demo/lists/ListBean.java
(rev 0)
+++
root/examples/richfaces-showcase/trunk/src/main/java/org/richfaces/demo/lists/ListBean.java 2010-07-23
13:06:59 UTC (rev 18212)
@@ -0,0 +1,18 @@
+package org.richfaces.demo.lists;
+
+import javax.faces.bean.ManagedBean;
+import javax.faces.bean.RequestScoped;
+
+@ManagedBean
+@RequestScoped
+public class ListBean {
+ private String listType = "ordered";
+
+ public String getListType() {
+ return listType;
+ }
+
+ public void setListType(String listType) {
+ this.listType = listType;
+ }
+}
Modified:
root/examples/richfaces-showcase/trunk/src/main/resources/org/richfaces/demo/data/common/navigation.xml
===================================================================
---
root/examples/richfaces-showcase/trunk/src/main/resources/org/richfaces/demo/data/common/navigation.xml 2010-07-23
10:42:23 UTC (rev 18211)
+++
root/examples/richfaces-showcase/trunk/src/main/resources/org/richfaces/demo/data/common/navigation.xml 2010-07-23
13:06:59 UTC (rev 18212)
@@ -264,6 +264,16 @@
</sample>
</samples>
</demo>
+ <demo>
+ <id>list</id>
+ <name>rich:list</name>
+ <samples>
+ <sample>
+ <id>lists</id>
+ <name>Data Lists Component</name>
+ </sample>
+ </samples>
+ </demo>
</demos>
</group>
<group new="true">
Added: root/examples/richfaces-showcase/trunk/src/main/webapp/richfaces/list/lists.xhtml
===================================================================
--- root/examples/richfaces-showcase/trunk/src/main/webapp/richfaces/list/lists.xhtml
(rev 0)
+++
root/examples/richfaces-showcase/trunk/src/main/webapp/richfaces/list/lists.xhtml 2010-07-23
13:06:59 UTC (rev 18212)
@@ -0,0 +1,47 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html
xmlns="http://www.w3.org/1999/xhtml"
+
xmlns:h="http://java.sun.com/jsf/html"
+
xmlns:f="http://java.sun.com/jsf/core"
+
xmlns:ui="http://java.sun.com/jsf/facelets"
+
xmlns:a4j="http://richfaces.org/a4j"
+
xmlns:rich="http://richfaces.org/rich">
+
+<ui:composition>
+ <p><b>rich:list</b> component allows to build one of the HTML lists
+ (UL, OL, DL) dynamically from backend data</p>
+ <p>It accepts the same data types as the other iteration components
+ and renders them according to <b>type</b> attribute.</p>
+ <h:form id="form">
+ <h:outputText value="List Type: " style="font-weight:bold"
/>
+ <a4j:commandLink value="ordered" render="list,form">
+ <a4j:param name="t" value="ordered"
assignTo="#{listBean.listType}" />
+ <f:attribute name="style"
+ value="#{(listBean.listType=='ordered') ? 'color:orange' :
''}" />
+ </a4j:commandLink>
+ <h:outputText value=" | " />
+ <a4j:commandLink value="unordered" render="list,form">
+ <a4j:param name="t" value="unordered"
assignTo="#{listBean.listType}" />
+ <f:attribute name="style"
+ value="#{(listBean.listType=='unordered') ? 'color:orange' :
''}" />
+ </a4j:commandLink>
+ <h:outputText value=" | " />
+ <a4j:commandLink value="definitions" render="list,form">
+ <a4j:param name="t" value="definitions"
+ assignTo="#{listBean.listType}" />
+ <f:attribute name="style"
+ value="#{(listBean.listType=='definitions') ? 'color:orange' :
''}" />
+ </a4j:commandLink>
+ </h:form>
+
+ <rich:list value="#{carsBean.inventoryVendorLists}" id="list"
+ var="vendorList" type="#{listBean.listType}">
+ <f:facet name="term">
+ <h:panelGroup layout="block">
+ <h:outputText value="In stock: #{vendorList.count}"
+ style="font-weight:bold" />
+ </h:panelGroup>
+ </f:facet>
+ <h:outputText value="#{vendorList.vendor}" />
+ </rich:list>
+</ui:composition>
+</html>
\ No newline at end of file