Author: ilya_shaikovsky
Date: 2009-04-23 06:43:33 -0400 (Thu, 23 Apr 2009)
New Revision: 13789
Added:
trunk/samples/richfaces-demo/src/main/webapp/richfaces/dataTableScroller/customScroller.xhtml
trunk/samples/richfaces-demo/src/main/webapp/richfaces/dataTableScroller/examples/customScroller.xhtml
Modified:
trunk/samples/richfaces-demo/src/main/java/org/richfaces/datatablescroller/DataTableScrollerBean.java
trunk/samples/richfaces-demo/src/main/resources/org/richfaces/demo/common/components.properties
trunk/samples/richfaces-demo/src/main/webapp/richfaces/dataTableScroller.xhtml
Log:
https://jira.jboss.org/jira/browse/RF-6576
Modified:
trunk/samples/richfaces-demo/src/main/java/org/richfaces/datatablescroller/DataTableScrollerBean.java
===================================================================
---
trunk/samples/richfaces-demo/src/main/java/org/richfaces/datatablescroller/DataTableScrollerBean.java 2009-04-23
10:38:52 UTC (rev 13788)
+++
trunk/samples/richfaces-demo/src/main/java/org/richfaces/datatablescroller/DataTableScrollerBean.java 2009-04-23
10:43:33 UTC (rev 13789)
@@ -12,6 +12,8 @@
import java.util.Random;
import java.util.Set;
+import javax.faces.model.SelectItem;
+
import org.richfaces.component.UIScrollableDataTable;
import org.richfaces.demo.datafilterslider.DemoInventoryItem;
import org.richfaces.model.SortField;
@@ -27,6 +29,16 @@
private DemoInventoryItem currentItem = new DemoInventoryItem();
+ private int rows = 10;
+
+ public int getRows() {
+ return rows;
+ }
+
+ public void setRows(int rows) {
+ this.rows = rows;
+ }
+
private Set<Integer> keys = new HashSet<Integer>();
private int currentRow;
@@ -103,6 +115,18 @@
return allCars;
}
+ public List<SelectItem> getPagesToScroll() {
+ List<SelectItem> list = new ArrayList<SelectItem>();
+ for (int i = 0; i <=allCars.size()/getRows(); i++) {
+ if (Math.abs(i-scrollerPage) < 5){
+ SelectItem item = new SelectItem(i);
+ if (scrollerPage==i) item.setDisabled(true);
+ list.add(item);
+ }
+ }
+ return list;
+ }
+
public List<DemoInventoryItem> getTenRandomCars() {
List<DemoInventoryItem> result = new ArrayList<DemoInventoryItem>();
int size = getAllCars().size()-1;
Modified:
trunk/samples/richfaces-demo/src/main/resources/org/richfaces/demo/common/components.properties
===================================================================
---
trunk/samples/richfaces-demo/src/main/resources/org/richfaces/demo/common/components.properties 2009-04-23
10:38:52 UTC (rev 13788)
+++
trunk/samples/richfaces-demo/src/main/resources/org/richfaces/demo/common/components.properties 2009-04-23
10:43:33 UTC (rev 13789)
@@ -29,7 +29,7 @@
togglePanel= richOutputs, Toggle Panel,
/images/ico_TogglePanel.gif, /images/cn_TogglePanel.gif,
togglePanel.html,
jbossrichfaces/freezone/docs/tlddoc/rich/togglePanel.html,
jbossrichfaces/freezone/docs/apidoc/org/richfaces/component/UITogglePanel.html,
/richfaces/togglePanel.jsf
panelMenu= richOutputs, Panel Menu,
/images/ico_panelMenu.gif, /images/cn_PanelMenu.gif,
panelMenu.html,
jbossrichfaces/freezone/docs/tlddoc/rich/panelMenu.html,
jbossrichfaces/freezone/docs/apidoc/org/richfaces/component/UIPanelMenu.html,
/richfaces/panelMenu.jsf
suggestionBox= richInputs, Suggestion Box,
/images/ico_SuggestionBox.gif, /images/cn_SuggestionBox.gif,
suggestionbox.html,
jbossrichfaces/freezone/docs/tlddoc/rich/suggestionbox.html,
jbossrichfaces/freezone/docs/apidoc/org/richfaces/component/UISuggestionBox.html,
/richfaces/suggestionBox.jsf
-dataTableScroller= richDataIterators, Data Scroller,
/images/ico_DataTableScroller.gif, /images/cn_DataTableScroller.gif,
datascroller.html,
jbossrichfaces/freezone/docs/tlddoc/rich/datascroller.html,
jbossrichfaces/freezone/docs/apidoc/org/richfaces/component/UIDatascroller.html,
/richfaces/dataTableScroller.jsf
+dataTableScroller= richDataIterators, Data Scroller,
/images/ico_DataTableScroller.gif, /images/cn_DataTableScroller.gif,
datascroller.html,
jbossrichfaces/freezone/docs/tlddoc/rich/datascroller.html,
jbossrichfaces/freezone/docs/apidoc/org/richfaces/component/UIDatascroller.html,
/richfaces/dataTableScroller.jsf, new
dropDownMenu= richMenu, Drop Down Menu,
/images/ico_DropDownMenu.gif, /images/cn_DropDownMenu.gif,
dropDownMenu.html,
jbossrichfaces/freezone/docs/tlddoc/rich/dropDownMenu.html,
jbossrichfaces/freezone/docs/apidoc/org/richfaces/component/UIDropDownMenu.html,
/richfaces/dropDownMenu.jsf
menuGroup= richMenu, Menu Group,
/images/ico_MenuGroup.gif, /images/cn_MenuGroup.gif,
menuGroup.html,
jbossrichfaces/freezone/docs/tlddoc/rich/menuGroup.html,
jbossrichfaces/freezone/docs/apidoc/org/richfaces/component/UIMenuGroup.html,
/richfaces/dropDownMenu.jsf
menuItem= richMenu, Menu Item, /images/ico_MenuItem.gif,
/images/cn_MenuItem.gif, menuItem.html,
jbossrichfaces/freezone/docs/tlddoc/rich/menuItem.html,
jbossrichfaces/freezone/docs/apidoc/org/richfaces/component/UIMenuItem.html,
/richfaces/dropDownMenu.jsf
Added:
trunk/samples/richfaces-demo/src/main/webapp/richfaces/dataTableScroller/customScroller.xhtml
===================================================================
---
trunk/samples/richfaces-demo/src/main/webapp/richfaces/dataTableScroller/customScroller.xhtml
(rev 0)
+++
trunk/samples/richfaces-demo/src/main/webapp/richfaces/dataTableScroller/customScroller.xhtml 2009-04-23
10:43:33 UTC (rev 13789)
@@ -0,0 +1,31 @@
+<!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:ui="http://java.sun.com/jsf/facelets"
+
xmlns:h="http://java.sun.com/jsf/html"
+
xmlns:f="http://java.sun.com/jsf/core"
+
xmlns:a4j="http://richfaces.org/a4j"
+
xmlns:rich="http://richfaces.org/rich">
+<ui:composition template="/templates/component-sample.xhtml">
+ <ui:define name="sample">
+ <p>
+ This sample designed to show how to use <b>datascroller</b> component
+ <b>facets</b> for component look and feel and functionality
<b>customization</b>.
+ </p>
+ <p>
+ As you could see the <b>datascroller</b> has customized step controls
+ and default buttons changes to select which allows to switch to
+ four pages nearest to current one.
+ </p>
+ <fieldset class="demo_fieldset">
+ <legend class="demo_legend">Data Scroller
customization</legend>
+ <div class="sample-container">
+ <ui:include
src="/richfaces/dataTableScroller/examples/customScroller.xhtml"/>
+ <ui:include src="/templates/include/sourceview.xhtml">
+ <ui:param name="sourcepath"
value="/richfaces/dataTableScroller/examples/customScroller.xhtml"/>
+ <ui:param name="openlabel" value="View Source" />
+ </ui:include>
+ </div>
+ </fieldset>
+ </ui:define>
+</ui:composition>
+</html>
Added:
trunk/samples/richfaces-demo/src/main/webapp/richfaces/dataTableScroller/examples/customScroller.xhtml
===================================================================
---
trunk/samples/richfaces-demo/src/main/webapp/richfaces/dataTableScroller/examples/customScroller.xhtml
(rev 0)
+++
trunk/samples/richfaces-demo/src/main/webapp/richfaces/dataTableScroller/examples/customScroller.xhtml 2009-04-23
10:43:33 UTC (rev 13789)
@@ -0,0 +1,87 @@
+<ui:composition
xmlns="http://www.w3.org/1999/xhtml"
+
xmlns:ui="http://java.sun.com/jsf/facelets"
+
xmlns:h="http://java.sun.com/jsf/html"
+
xmlns:f="http://java.sun.com/jsf/core"
+
xmlns:a4j="http://richfaces.org/a4j"
+
xmlns:rich="http://richfaces.org/rich">
+ <style>
+.scrollerCell {
+ padding-right: 10px;
+ padding-left: 10px;
+}
+</style>
+ <h:form>
+ <rich:dataTable width="483" id="carList"
+ rows="#{dataTableScrollerBean.rows}" columnClasses="col"
+ value="#{dataTableScrollerBean.allCars}" var="category">
+ <f:facet name="header">
+ <rich:columnGroup>
+ <rich:column>
+ <h:outputText value="Make" />
+ </rich:column>
+ <rich:column>
+ <h:outputText value="Model" />
+ </rich:column>
+ <rich:column>
+ <h:outputText value="Price" />
+ </rich:column>
+ <rich:column>
+ <h:outputText value="Mileage" />
+ </rich:column>
+ </rich:columnGroup>
+ </f:facet>
+ <rich:column>
+ <h:outputText value="#{category.make}" />
+ </rich:column>
+ <rich:column>
+ <h:outputText value="#{category.model}" />
+ </rich:column>
+ <rich:column>
+ <h:outputText value="#{category.price}" />
+ </rich:column>
+ <rich:column>
+ <h:outputText value="#{category.mileage}" />
+ </rich:column>
+ <f:facet name="footer">
+ <rich:datascroller maxPages="20" fastControls="hide"
+ page="#{dataTableScrollerBean.scrollerPage}" pagesVar="pages"
+ id="ds">
+ <f:facet name="first">
+ <h:outputText value="First" styleClass="scrollerCell" />
+ </f:facet>
+ <f:facet name="first_disabled">
+ <h:outputText value="First" styleClass="scrollerCell" />
+ </f:facet>
+ <f:facet name="last">
+ <h:outputText value="Last" styleClass="scrollerCell" />
+ </f:facet>
+ <f:facet name="last_disabled">
+ <h:outputText value="Last" styleClass="scrollerCell" />
+ </f:facet>
+ <f:facet name="previous">
+ <h:outputText value="Previous" styleClass="scrollerCell"
/>
+ </f:facet>
+ <f:facet name="previous_disabled">
+ <h:outputText value="Previous" styleClass="scrollerCell"
/>
+ </f:facet>
+ <f:facet name="next">
+ <h:outputText value="Next" styleClass="scrollerCell" />
+ </f:facet>
+ <f:facet name="next_disabled">
+ <h:outputText value="Next" styleClass="scrollerCell" />
+ </f:facet>
+ <f:facet name="pages">
+ <h:panelGroup>
+ <h:outputText value="Page " />
+ <h:selectOneMenu value="#{dataTableScrollerBean.scrollerPage}"
+ onchange="#{rich:component('ds')}.switchToPage(this.value)">
+ <f:selectItems value="#{dataTableScrollerBean.pagesToScroll}" />
+ </h:selectOneMenu>
+ <h:outputText value=" of #{pages}" />
+ </h:panelGroup>
+ </f:facet>
+ </rich:datascroller>
+ </f:facet>
+ </rich:dataTable>
+ </h:form>
+</ui:composition>
Modified: trunk/samples/richfaces-demo/src/main/webapp/richfaces/dataTableScroller.xhtml
===================================================================
---
trunk/samples/richfaces-demo/src/main/webapp/richfaces/dataTableScroller.xhtml 2009-04-23
10:38:52 UTC (rev 13788)
+++
trunk/samples/richfaces-demo/src/main/webapp/richfaces/dataTableScroller.xhtml 2009-04-23
10:43:33 UTC (rev 13789)
@@ -7,7 +7,20 @@
<ui:composition template="/templates/main.xhtml">
<ui:define name="title">RichFaces - Open Source Rich JSF Components -
Data Table Scroller</ui:define>
<ui:define name="body">
- <ui:include src="/templates/include/tab-panel.xhtml" />
+ <rich:tabPanel switchType="server" styleClass="top_tab"
contentClass="content_tab" headerClass="header_tabs_class"
inactiveTabClass="inactive_tab" activeTabClass="active_tab"
+ selectedTab="#{componentNavigator.currentComponent.activeTab}"
valueChangeListener="#{componentNavigator.tabPanelSwitched}">
+ <rich:tab label="Usage" name="usage">
+ <ui:include src="/richfaces/dataTableScroller/usage.xhtml"/>
+ </rich:tab>
+ <rich:tab label="Scroller Facets Usage"
name="scrollerfacets">
+ <ui:include
src="/richfaces/dataTableScroller/customScroller.xhtml"/>
+ </rich:tab>
+ <rich:tab name="info" label="Tag Information">
+ <rich:insert
+ src="/WEB-INF/#{componentNavigator.currentComponent.tagInfoLocation}"
+ errorContent="/templates/include/tagInfoNotes.xhtml" />
+ </rich:tab>
+ </rich:tabPanel>
</ui:define>
</ui:composition>
</html>