Author: ilya_shaikovsky
Date: 2011-01-25 06:00:14 -0500 (Tue, 25 Jan 2011)
New Revision: 21191
Added:
trunk/examples/richfaces-showcase/src/main/webapp/richfaces/dataTable/samples/dataTableEdit-sample.xhtml
trunk/examples/richfaces-showcase/src/main/webapp/richfaces/hashParam/
trunk/examples/richfaces-showcase/src/main/webapp/richfaces/hashParam/hashOptionsPopup.xhtml
trunk/examples/richfaces-showcase/src/main/webapp/richfaces/hashParam/samples/
trunk/examples/richfaces-showcase/src/main/webapp/richfaces/hashParam/samples/hashOptionsPopup-sample.xhtml
Modified:
trunk/examples/richfaces-showcase/src/main/java/org/richfaces/demo/tables/CarsBean.java
trunk/examples/richfaces-showcase/src/main/resources/org/richfaces/demo/data/common/navigation.xml
trunk/examples/richfaces-showcase/src/main/webapp/richfaces/component-sample.xhtml
trunk/examples/richfaces-showcase/src/main/webapp/richfaces/dataTable/dataTableEdit.xhtml
Log:
https://issues.jboss.org/browse/RFPL-736 + new dataTable sample
Modified:
trunk/examples/richfaces-showcase/src/main/java/org/richfaces/demo/tables/CarsBean.java
===================================================================
---
trunk/examples/richfaces-showcase/src/main/java/org/richfaces/demo/tables/CarsBean.java 2011-01-25
10:44:54 UTC (rev 21190)
+++
trunk/examples/richfaces-showcase/src/main/java/org/richfaces/demo/tables/CarsBean.java 2011-01-25
11:00:14 UTC (rev 21191)
@@ -32,7 +32,12 @@
private static final int ROUNDING_MODE = BigDecimal.ROUND_HALF_UP;
private List<InventoryItem> allInventoryItems = null;
private List<InventoryVendorList> inventoryVendorLists = null;
+ private InventoryItem currentCar;
+ public void remove() {
+ allInventoryItems.remove(currentCar);
+ }
+
public List<SelectItem> getVendorOptions() {
List<SelectItem> result = new ArrayList<SelectItem>();
result.add(new SelectItem("", ""));
@@ -191,4 +196,13 @@
return iiList;
}
+
+ public InventoryItem getCurrentCar() {
+ return currentCar;
+ }
+
+ public void setCurrentCar(InventoryItem currentCar) {
+ this.currentCar = currentCar;
+ }
+
}
Modified:
trunk/examples/richfaces-showcase/src/main/resources/org/richfaces/demo/data/common/navigation.xml
===================================================================
---
trunk/examples/richfaces-showcase/src/main/resources/org/richfaces/demo/data/common/navigation.xml 2011-01-25
10:44:54 UTC (rev 21190)
+++
trunk/examples/richfaces-showcase/src/main/resources/org/richfaces/demo/data/common/navigation.xml 2011-01-25
11:00:14 UTC (rev 21191)
@@ -200,7 +200,7 @@
</sample>
</samples>
</demo>
- <demo>
+ <demo new="true">
<id>dataTable</id>
<name>rich:dataTable</name>
<samples>
@@ -227,6 +227,10 @@
<id>tableFiltering</id>
<name>Data Table Filtering</name>
</sample>
+ <sample new="true">
+ <id>dataTableEdit</id>
+ <name>Data Table Edit</name>
+ </sample>
</samples>
</demo>
<demo>
@@ -607,6 +611,16 @@
</sample>
</samples>
</demo>
+ <demo new="true">
+ <id>hashParam</id>
+ <name>rich:hashParam</name>
+ <samples>
+ <sample>
+ <id>hashOptionsPopup</id>
+ <name>Passing hash options to rich:popupPanel</name>
+ </sample>
+ </samples>
+ </demo>
<demo>
<id>jquery</id>
<name>rich:jQuery</name>
Modified:
trunk/examples/richfaces-showcase/src/main/webapp/richfaces/component-sample.xhtml
===================================================================
---
trunk/examples/richfaces-showcase/src/main/webapp/richfaces/component-sample.xhtml 2011-01-25
10:44:54 UTC (rev 21190)
+++
trunk/examples/richfaces-showcase/src/main/webapp/richfaces/component-sample.xhtml 2011-01-25
11:00:14 UTC (rev 21191)
@@ -3,7 +3,7 @@
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:rich="http://java.sun.com/jsf/composite/org.richfaces.showcase...
+
xmlns:rich="http://richfaces.org/rich">
<ui:composition template="/templates/main.xhtml">
<ui:define name="demoSampleParameters">
Modified:
trunk/examples/richfaces-showcase/src/main/webapp/richfaces/dataTable/dataTableEdit.xhtml
===================================================================
---
trunk/examples/richfaces-showcase/src/main/webapp/richfaces/dataTable/dataTableEdit.xhtml 2011-01-25
10:44:54 UTC (rev 21190)
+++
trunk/examples/richfaces-showcase/src/main/webapp/richfaces/dataTable/dataTableEdit.xhtml 2011-01-25
11:00:14 UTC (rev 21191)
@@ -6,35 +6,7 @@
xmlns:a4j="http://richfaces.org/a4j">
<ui:composition>
- <h:form>
- <h:dataTable value="#{carsBean.allCars}" var="car"
id="table">
- <h:column>
- <f:facet name="header">
- <h:outputText value="Make" />
- </f:facet>
- <h:outputText value="#{car.make}"/>
- </h:column>
- <h:column>
- <f:facet name="header">
- <h:outputText value="Model" />
- </f:facet>
- <h:outputText value="#{car.model}"/>
- </h:column>
- <h:column>
- <f:facet name="header">
- <h:outputText value="Price" />
- </f:facet>
- <h:outputText value="#{car.price}"/>
- </h:column>
- <h:column>
- <f:facet name="header">
- Actions
- </f:facet>
- <a4j:commandLink value="Edit" action="#{carsBean.edit}"
render="table"/>
- <h:outputText value=" " />
- <a4j:commandLink value="Remove" action="#{carsBean.remove}"
render="table"/>
- </h:column>
- </h:dataTable>
- </h:form>
+ <ui:include src="#{demoNavigator.sampleIncludeURI}" />
+
</ui:composition>
</html>
\ No newline at end of file
Added:
trunk/examples/richfaces-showcase/src/main/webapp/richfaces/dataTable/samples/dataTableEdit-sample.xhtml
===================================================================
---
trunk/examples/richfaces-showcase/src/main/webapp/richfaces/dataTable/samples/dataTableEdit-sample.xhtml
(rev 0)
+++
trunk/examples/richfaces-showcase/src/main/webapp/richfaces/dataTable/samples/dataTableEdit-sample.xhtml 2011-01-25
11:00:14 UTC (rev 21191)
@@ -0,0 +1,78 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<ui:composition
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">
+ <h:form id="form">
+ <rich:dataTable value="#{carsBean.allInventoryItems}" var="car"
+ id="table" rows="15">
+ <f:facet name="noData">
+ Nothing found
+ </f:facet>
+ <rich:column>
+ <f:facet name="header">Vendor</f:facet>
+ <h:outputText value="#{car.vendor}" />
+ </rich:column>
+ <rich:column>
+ <f:facet name="header">Model</f:facet>
+ <h:outputText value="#{car.model}" />
+ </rich:column>
+ <rich:column>
+ <f:facet name="header">Price</f:facet>
+ <h:outputText value="#{car.price}" />
+ </rich:column>
+ <rich:column>
+ <f:facet name="header">Mileage</f:facet>
+ <h:outputText value="#{car.mileage}" />
+ </rich:column>
+ <rich:column>
+ <f:facet name="header">VIN</f:facet>
+ <h:outputText value="#{car.vin}" />
+ </rich:column>
+ <rich:column>
+ <f:facet name="header">Actions</f:facet>
+ <h:commandLink action="#{carsBean.remove}">
+ <h:graphicImage value="/images/icons/delete.gif"/>
+ <a4j:ajax render="table" execute="@this" />
+ <f:setPropertyActionListener target="#{carsBean.currentCar}"
+ value="#{car}" />
+ </h:commandLink>
+ <h:commandLink>
+ <h:graphicImage value="/images/icons/edit.gif"/>
+ <a4j:ajax render="edit" execute="@this"
+ oncomplete="#{rich:component('editPane')}.show()" />
+ <f:setPropertyActionListener target="#{carsBean.currentCar}"
+ value="#{car}" />
+ </h:commandLink>
+ </rich:column>
+ <f:facet name="footer">
+ <rich:dataScroller/>
+ </f:facet>
+ </rich:dataTable>
+ </h:form>
+ <rich:popupPanel header="Edit Car Details" id="editPane">
+ <h:form>
+ <h:panelGrid columns="3">
+ <h:outputText value="Vendor" />
+ <h:outputText value="#{carsBean.currentCar.vendor}" />
+ <h:panelGroup />
+ <h:outputText value="Model" />
+ <h:outputText value="#{carsBean.currentCar.model}" />
+ <h:panelGroup />
+ <h:outputText value="Price" />
+ <h:inputText value="#{carsBean.currentCar.price}" id="price"
/>
+ <rich:message for="price" />
+ <h:outputText value="Mileage" />
+ <h:inputText value="#{carsBean.currentCar.mileage}" id="mage"
/>
+ <rich:message for="mage" />
+ <h:outputText value="VIN" />
+ <h:inputText value="#{carsBean.currentCar.vin}" id="vin" />
+ <rich:message for="vin" />
+ </h:panelGrid>
+ <a4j:commandButton value="Store"/>
+ <a4j:commandButton value="Cancel"
onclick="#{rich:component('editPane')}.hide(); return false;"/>
+ </h:form>
+ </rich:popupPanel>
+</ui:composition>
\ No newline at end of file
Added:
trunk/examples/richfaces-showcase/src/main/webapp/richfaces/hashParam/hashOptionsPopup.xhtml
===================================================================
---
trunk/examples/richfaces-showcase/src/main/webapp/richfaces/hashParam/hashOptionsPopup.xhtml
(rev 0)
+++
trunk/examples/richfaces-showcase/src/main/webapp/richfaces/hashParam/hashOptionsPopup.xhtml 2011-01-25
11:00:14 UTC (rev 21191)
@@ -0,0 +1,26 @@
+<!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">
+
+<ui:composition>
+ <p><b>rich:hashParam</b> allows you to group client side parameters
+ into hash map in order to pass to client API functions of any
+ components.</p>
+ <p>Press "Show Popup" betton in order to call the pabel. All the
+ parameters for show method passed from component control nested
+ a4j:param's instead of to be defined with attributes in static way. As
+ the show() method accepts event and options hash - all the param's
+ except event grouped using <b>rich:hashParam</b> component and passed
+ as hash</p>
+ <ui:include src="#{demoNavigator.sampleIncludeURI}" />
+ <ui:include src="/templates/includes/source-view.xhtml">
+ <ui:param name="src" value="#{demoNavigator.sampleIncludeURI}"
/>
+ <ui:param name="sourceType" value="xhtml" />
+ <ui:param name="openLabel" value="View Source" />
+ <ui:param name="hideLabel" value="Hide Source" />
+ </ui:include>
+</ui:composition>
+
+</html>
\ No newline at end of file
Added:
trunk/examples/richfaces-showcase/src/main/webapp/richfaces/hashParam/samples/hashOptionsPopup-sample.xhtml
===================================================================
---
trunk/examples/richfaces-showcase/src/main/webapp/richfaces/hashParam/samples/hashOptionsPopup-sample.xhtml
(rev 0)
+++
trunk/examples/richfaces-showcase/src/main/webapp/richfaces/hashParam/samples/hashOptionsPopup-sample.xhtml 2011-01-25
11:00:14 UTC (rev 21191)
@@ -0,0 +1,54 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<ui:composition
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">
+
+ <rich:popupPanel id="pp" resizeable="true"
+ header="Popup panel shown using rich:componentControl and
rich:hashParam">
+ <f:facet name="controls">
+ <h:outputLink value="#"
+ onclick="#{rich:component('pp')}.hide(); return false;">
+ X
+ </h:outputLink>
+ </f:facet>
+ <h:outputText value="Settings applied by hashParam tag:" />
+ <h:panelGrid columns="2">
+ <h:outputText value="Width:" />
+ <h:outputText value="500px" />
+ <h:outputText value="Height:" />
+ <h:outputText value="300px" />
+ <h:outputText value="minWidth:" />
+ <h:outputText value="300px" />
+ <h:outputText value="minHeight:" />
+ <h:outputText value="150px" />
+ </h:panelGrid>
+ <p>Also panel getting centered by using:</p>
+ <p><a4j:param noEscape="true" name="left"
+ value="(screen.width/2)-250"/></p>
+ <p><a4j:param noEscape="true" name="top"
+ value="(screen.height/2)-150"/></p>
+ <fieldset><legend><b>NOTE:</b></legend>
+ <p>Pay your attention that show() api method requires event
+ parameter to be first according to signature. So we passed it before
+ hashParam.</p>
+ </fieldset>
+ </rich:popupPanel>
+
+ <h:commandButton value="Show popup">
+ <rich:componentControl target="pp" operation="show">
+ <a4j:param noEscape="true" value="event" />
+ <rich:hashParam>
+ <f:param name="width" value="500px" />
+ <f:param name="height" value="300px" />
+ <f:param name="minWidth" value="300px" />
+ <f:param name="minHeight" value="150px" />
+ <a4j:param noEscape="true" name="left"
value="(jQuery(window).width()/2)-250" />
+ <a4j:param noEscape="true" name="top"
value="(jQuery(window).height()/2)-150" />
+ </rich:hashParam>
+ </rich:componentControl>
+ </h:commandButton>
+
+</ui:composition>
\ No newline at end of file