JBoss Rich Faces SVN: r6928 - trunk/samples/datascroller-sample/src/main/webapp/pages.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2008-03-18 14:07:09 -0400 (Tue, 18 Mar 2008)
New Revision: 6928
Modified:
trunk/samples/datascroller-sample/src/main/webapp/pages/index.jsp
Log:
http://jira.jboss.com/jira/browse/RF-2182
Modified: trunk/samples/datascroller-sample/src/main/webapp/pages/index.jsp
===================================================================
--- trunk/samples/datascroller-sample/src/main/webapp/pages/index.jsp 2008-03-18 17:47:16 UTC (rev 6927)
+++ trunk/samples/datascroller-sample/src/main/webapp/pages/index.jsp 2008-03-18 18:07:09 UTC (rev 6928)
@@ -24,9 +24,8 @@
<h:outputText value="Data Table test" />
<br />
+ <ds:datascroller page="2" for="master" reRender="actionCount, eventCount" rendered="true" fastStep="2" actionListener="#{testBean.onAction}" renderIfSinglePage="#{testBean.renderIfSinglePage}" scrollerListener="#{testBean.doScroll}" maxPages="#{testBean.maxpage}"/>
-
-
<h:dataTable rows="#{testBean.rows}" id="master" border="1" value="#{testBean.data}" var="data">
<f:facet name="header">
<h:outputText value="My table" />
@@ -59,7 +58,6 @@
</f:facet>
</h:column>
<f:facet name="footer">
- <ds:datascroller page="-1" for="master" reRender="actionCount, eventCount" rendered="true" fastStep="2" actionListener="#{testBean.onAction}" renderIfSinglePage="#{testBean.renderIfSinglePage}" scrollerListener="#{testBean.doScroll}" maxPages="#{testBean.maxpage}"/>
</f:facet>
</h:dataTable>
16 years, 10 months
JBoss Rich Faces SVN: r6927 - in trunk/samples/richfaces-demo/src/main/webapp/richfaces/filteringFeature: examples and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: ilya_shaikovsky
Date: 2008-03-18 13:47:16 -0400 (Tue, 18 Mar 2008)
New Revision: 6927
Modified:
trunk/samples/richfaces-demo/src/main/webapp/richfaces/filteringFeature/examples/externalFiltering.xhtml
trunk/samples/richfaces-demo/src/main/webapp/richfaces/filteringFeature/externalFilteringUsage.xhtml
Log:
Modified: trunk/samples/richfaces-demo/src/main/webapp/richfaces/filteringFeature/examples/externalFiltering.xhtml
===================================================================
--- trunk/samples/richfaces-demo/src/main/webapp/richfaces/filteringFeature/examples/externalFiltering.xhtml 2008-03-18 17:44:14 UTC (rev 6926)
+++ trunk/samples/richfaces-demo/src/main/webapp/richfaces/filteringFeature/examples/externalFiltering.xhtml 2008-03-18 17:47:16 UTC (rev 6927)
@@ -0,0 +1,32 @@
+<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">
+ <h:form>
+ <style>
+ .rich-inplace-view{
+ color:gray;
+ border-bottom-color:gray;
+ }
+ </style>
+ <rich:dataTable value="#{capitalsBean.capitals}" var="cap" width="500px">
+ <f:facet name="header">
+ <h:outputText value="Filtering Example"/>
+ </f:facet>
+ <rich:column>
+ <f:facet name="header">
+ <h:graphicImage value="/images/ico_DataTable.gif"></h:graphicImage>
+ </f:facet>
+ <h:graphicImage value="#{cap.stateFlag}"/>
+ </rich:column>
+ <rich:column filterBy="#{cap.state}" filterDefaultLabel="click to filter">
+ <h:outputText value="#{cap.state}"></h:outputText>
+ </rich:column>
+ <rich:column filterBy="#{cap.name}" filterDefaultLabel="click to filter">
+ <h:outputText value="#{cap.name}"/>
+ </rich:column>
+ </rich:dataTable>
+ </h:form>
+</ui:composition>
\ No newline at end of file
Modified: trunk/samples/richfaces-demo/src/main/webapp/richfaces/filteringFeature/externalFilteringUsage.xhtml
===================================================================
--- trunk/samples/richfaces-demo/src/main/webapp/richfaces/filteringFeature/externalFilteringUsage.xhtml 2008-03-18 17:44:14 UTC (rev 6926)
+++ trunk/samples/richfaces-demo/src/main/webapp/richfaces/filteringFeature/externalFilteringUsage.xhtml 2008-03-18 17:47:16 UTC (rev 6927)
@@ -0,0 +1,29 @@
+<!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:rich="http://richfaces.org/rich">
+ <ui:composition template="/templates/component-sample.xhtml">
+ <ui:define name="sample">
+
+ <p>
+ SHORT DESCRIPTION
+ </p>
+
+ <div class="sample-container" >
+
+ <ui:include src="/richfaces/filteringFeature/examples/externalFiltering.xhtml"/>
+ <ui:include src="/templates/include/sourceview.xhtml">
+ <ui:param name="sourcepath" value="/richfaces/filteringFeature/examples/externalFiltering.xhtml"/>
+ </ui:include>
+ </div>
+
+ <p>
+ DESCRIPTION
+ </p>
+
+ </ui:define>
+
+ </ui:composition>
+</html>
16 years, 10 months
JBoss Rich Faces SVN: r6926 - in trunk/ui/combobox/src/main: templates and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: abelevich
Date: 2008-03-18 13:44:14 -0400 (Tue, 18 Mar 2008)
New Revision: 6926
Modified:
trunk/ui/combobox/src/main/java/org/richfaces/component/UIComboBox.java
trunk/ui/combobox/src/main/templates/combobox.jspx
Log:
http://jira.jboss.com/jira/browse/RF-2565
Modified: trunk/ui/combobox/src/main/java/org/richfaces/component/UIComboBox.java
===================================================================
--- trunk/ui/combobox/src/main/java/org/richfaces/component/UIComboBox.java 2008-03-18 17:24:09 UTC (rev 6925)
+++ trunk/ui/combobox/src/main/java/org/richfaces/component/UIComboBox.java 2008-03-18 17:44:14 UTC (rev 6926)
@@ -18,7 +18,7 @@
public abstract void setSuggestionValues(Object value);
public abstract String getDefaultLabel();
public abstract void setDefaultLabel(String label);
-
-
-
+ public abstract boolean isEnableManualInput();
+ public abstract void setEnableManualInput(boolean enableManualInput);
+
}
\ No newline at end of file
Modified: trunk/ui/combobox/src/main/templates/combobox.jspx
===================================================================
--- trunk/ui/combobox/src/main/templates/combobox.jspx 2008-03-18 17:24:09 UTC (rev 6925)
+++ trunk/ui/combobox/src/main/templates/combobox.jspx 2008-03-18 17:44:14 UTC (rev 6926)
@@ -188,6 +188,8 @@
buttonIconInactive = "url('" + buttonIconInactive + "')";
}
variables.setVariable("buttonIconInactive", buttonIconInactive);
+ variables.setVariable("enableManualInput", component.isEnableManualInput());
+
]]>
</jsp:scriptlet>
@@ -203,7 +205,8 @@
disabled="#{disabled}"
class="#{valueStyle} rich-combobox-input-inactive #{inputDisabledClass}" type="text"
value="#{value}"
- size="#{inputSize}"
+ size="#{inputSize}"
+ readonly="#{enableManualInput}"
onchange="#{component.attributes['onchange']}"
onselect="#{component.attributes['onselect']}"
onblur="#{component.attributes['onblur']}"
16 years, 10 months
JBoss Rich Faces SVN: r6925 - in trunk/samples/richfaces-demo/src/main/webapp: richfaces/calendar and 2 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: dsvyatobatsko
Date: 2008-03-18 13:24:09 -0400 (Tue, 18 Mar 2008)
New Revision: 6925
Modified:
trunk/samples/richfaces-demo/src/main/webapp/css/common.css
trunk/samples/richfaces-demo/src/main/webapp/richfaces/calendar/examples/calSample.xhtml
trunk/samples/richfaces-demo/src/main/webapp/richfaces/calendar/usage.xhtml
trunk/samples/richfaces-demo/src/main/webapp/templates/include/dynamic-css.xhtml
trunk/samples/richfaces-demo/src/main/webapp/templates/include/sourceview.xhtml
Log:
http://jira.jboss.com/jira/browse/RF-2542 Demo-site common changes
Modified: trunk/samples/richfaces-demo/src/main/webapp/css/common.css
===================================================================
--- trunk/samples/richfaces-demo/src/main/webapp/css/common.css 2008-03-18 17:20:00 UTC (rev 6924)
+++ trunk/samples/richfaces-demo/src/main/webapp/css/common.css 2008-03-18 17:24:09 UTC (rev 6925)
@@ -1,6 +1,16 @@
+.demo_fieldset{
+ margin : 20px;
+ border : 1px solid #ACBECE;
+}
+
+.demo_legend{
+ font-weight : bold;
+ margin : 0px 10px 0px 20px;
+}
+
form {
- margin:0;
- padding:0;
+ margin: 0;
+ padding: 0;
}
* {
@@ -14,9 +24,9 @@
font-family: Verdana,Arial;
}
- .footer-text {
- font-size: 10px;
- }
+.footer-text {
+ font-size: 10px;
+}
body{
margin : 0px;
Modified: trunk/samples/richfaces-demo/src/main/webapp/richfaces/calendar/examples/calSample.xhtml
===================================================================
--- trunk/samples/richfaces-demo/src/main/webapp/richfaces/calendar/examples/calSample.xhtml 2008-03-18 17:20:00 UTC (rev 6924)
+++ trunk/samples/richfaces-demo/src/main/webapp/richfaces/calendar/examples/calSample.xhtml 2008-03-18 17:24:09 UTC (rev 6925)
@@ -6,8 +6,8 @@
xmlns:rich="http://richfaces.org/rich">
<style type="text/css">
- .ecol1 { width:250px; vertical-align: top; }
- .ecol2 { vertical-align: top; border-left:1px solid #CCC; }
+ .ecol1 { vertical-align: top; padding-right : 25px }
+ .ecol2 { vertical-align: top; border-left: #ACBECE 1px solid; padding-left : 10px }
.rich-calendar-tool-btn{
font-family: Arial, Verdana;
}
Modified: trunk/samples/richfaces-demo/src/main/webapp/richfaces/calendar/usage.xhtml
===================================================================
--- trunk/samples/richfaces-demo/src/main/webapp/richfaces/calendar/usage.xhtml 2008-03-18 17:20:00 UTC (rev 6924)
+++ trunk/samples/richfaces-demo/src/main/webapp/richfaces/calendar/usage.xhtml 2008-03-18 17:24:09 UTC (rev 6925)
@@ -14,15 +14,16 @@
is initially rendered as input for date and button on the right side to call a popup.
In case of an inline mode, the monthly calendar is located on a page initially.
</p>
-
- <div class="sample-container" >
- <ui:include src="/richfaces/calendar/examples/calSample.xhtml"/>
- <ui:include src="/templates/include/sourceview.xhtml">
- <ui:param name="sourcepath" value="/richfaces/calendar/examples/calSample.xhtml"/>
- </ui:include>
-
- </div>
+ <fieldset class="demo_fieldset">
+ <legend class="demo_legend">Calendar Demo</legend>
+ <div class="sample-container" >
+ <ui:include src="/richfaces/calendar/examples/calSample.xhtml"/>
+ <ui:include src="/templates/include/sourceview.xhtml">
+ <ui:param name="sourcepath" value="/richfaces/calendar/examples/calSample.xhtml"/>
+ </ui:include>
+ </div>
+ </fieldset>
<p>Calendar component allows to work with <b>time</b> also. You should just define time in pattern ( for example "<i>d/M/yy HH:mm</i>" as it's defined in this sample by default)
</p>
<p>After you choose some date, you'll be able to manage time for this date. Spinner will be called after click on the time fields to edit them.</p>
Modified: trunk/samples/richfaces-demo/src/main/webapp/templates/include/dynamic-css.xhtml
===================================================================
--- trunk/samples/richfaces-demo/src/main/webapp/templates/include/dynamic-css.xhtml 2008-03-18 17:20:00 UTC (rev 6924)
+++ trunk/samples/richfaces-demo/src/main/webapp/templates/include/dynamic-css.xhtml 2008-03-18 17:24:09 UTC (rev 6925)
@@ -30,9 +30,23 @@
font-size:19px;
}
div.esample {
- border:1px solid #CCCCCC;
- padding:0px 8px 0px 8px;
+ border-right: #CCCCCC 1px solid;
+ padding-right: 8px;
+ border-top: #CCCCCC 1px solid;
+ padding-left: 8px;
+ padding-bottom: 0px;
+ border-left: #CCCCCC 1px solid;
+ padding-top: 0px;
+ border-bottom: #CCCCCC 1px solid
}
+p {
+ font-family : verdana;
+ font-size : 11px;
+ line-height : 150%;
+}
+a {
+ color : #ACBECE
+}
</style>
</ui:composition>
</html>
Modified: trunk/samples/richfaces-demo/src/main/webapp/templates/include/sourceview.xhtml
===================================================================
--- trunk/samples/richfaces-demo/src/main/webapp/templates/include/sourceview.xhtml 2008-03-18 17:20:00 UTC (rev 6924)
+++ trunk/samples/richfaces-demo/src/main/webapp/templates/include/sourceview.xhtml 2008-03-18 17:24:09 UTC (rev 6925)
@@ -20,46 +20,32 @@
<style>
.viewsourcepanel {
- padding-bottom:0px;
- width:100%;
- overflow:auto;
- border-width:0;
- background-color:#FFFFE7;
+ border : 0px; padding: 0px; margin : 2px 0px 0px 0px; overflow: auto; width: 100%; background-color: #F3F7FB;
}
+
.viewsourcebody {
- padding:0;
+ padding-right: 0px; padding-left: 0px; padding-bottom: 0px; padding-top: 0px
}
+
.viewsourceheader {
- background-color:#E6F3F7;
- background-image:none;
- border-width:0px;
- padding:0px;
- height:6px;
+ border: 0px; padding: 0px; height: 6px; background-color: #E1E7ED;
}
+
.viewsourcediv {
- padding:0 10px 10px 10px;
+ padding-right: 10px; padding-left: 10px; padding-bottom: 10px; padding-top: 5px; border-top : 2px solid #FFFFFF; border-bottom : 2px solid #FFFFFF;
}
+
.viewsourcediv pre {
- margin:0;
+ margin: 0px
}
-
+
.viewsourcelooklink {
- cursor:pointer;
- text-decoration:underline;
- padding-left:5px;
- color:blue;
- font-size:11px;
- font-family:Verdana;
+ padding-left: 5px; font-size: 11px; cursor: pointer; color: #7795AF; font-family: Verdana; text-decoration: underline
}
-
+
.viewsourcehidelink {
- text-align:right;
- cursor:pointer;
- display:block;
- background-color:#E6F3F7;
- text-decoration:none;
+ display: block; color: #7795AF; cursor: pointer; background-color: #E1E7ED; text-align: right; text-decoration: none; padding : 2px
}
-
</style>
<f:subview>
<div>
16 years, 10 months
JBoss Rich Faces SVN: r6924 - in trunk/samples/richfaces-demo/src/main: webapp/richfaces and 4 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: ilya_shaikovsky
Date: 2008-03-18 13:20:00 -0400 (Tue, 18 Mar 2008)
New Revision: 6924
Added:
trunk/samples/richfaces-demo/src/main/webapp/richfaces/filteringFeature.xhtml
trunk/samples/richfaces-demo/src/main/webapp/richfaces/filteringFeature/
trunk/samples/richfaces-demo/src/main/webapp/richfaces/filteringFeature/examples/
trunk/samples/richfaces-demo/src/main/webapp/richfaces/filteringFeature/examples/externalFiltering.xhtml
trunk/samples/richfaces-demo/src/main/webapp/richfaces/filteringFeature/examples/simpleFiltering.xhtml
trunk/samples/richfaces-demo/src/main/webapp/richfaces/filteringFeature/externalFilteringUsage.xhtml
trunk/samples/richfaces-demo/src/main/webapp/richfaces/filteringFeature/filteringUsage.xhtml
trunk/samples/richfaces-demo/src/main/webapp/richfaces/sortingFeature.xhtml
Removed:
trunk/samples/richfaces-demo/src/main/webapp/richfaces/sortingFilteringFeature.xhtml
trunk/samples/richfaces-demo/src/main/webapp/richfaces/sortingFilteringFeatures/examples/externalFiltering.xhtml
trunk/samples/richfaces-demo/src/main/webapp/richfaces/sortingFilteringFeatures/examples/simpleFiltering.xhtml
trunk/samples/richfaces-demo/src/main/webapp/richfaces/sortingFilteringFeatures/filteringUsage.xhtml
Modified:
trunk/samples/richfaces-demo/src/main/resources/org/richfaces/demo/common/components.properties
Log:
split filtering and sorting features
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 2008-03-18 17:12:14 UTC (rev 6923)
+++ trunk/samples/richfaces-demo/src/main/resources/org/richfaces/demo/common/components.properties 2008-03-18 17:20:00 UTC (rev 6924)
@@ -77,5 +77,6 @@
comboBox= richInputs, Combo Box, \t\t/images/ico_ComboBox.gif, \t\t/images/cn_ComboBox.gif, RichFacesComponentsLibrary.html\#comboBox, jbossrichfaces/freezone/docs/tlddoc/rich/comboBox.html, jbossrichfaces/freezone/docs/apidoc/org/richfaces/component/UIcomboBox.html, \t\t\t\t\t/richfaces/comboBox.jsf
inplaceInput= richInputs, Inplace Input, \t\t/images/ico_InplaceInput.gif, \t\t/images/cn_InplaceInput.gif, RichFacesComponentsLibrary.html\#inplaceInput, jbossrichfaces/freezone/docs/tlddoc/rich/inplaceInput.html, jbossrichfaces/freezone/docs/apidoc/org/richfaces/component/UIinplaceInput.html, \t\t\t\t\t/richfaces/inplaceInput.jsf
inplaceSelect= richInputs, Inplace Select, \t\t/images/ico_InplaceSelect.gif, \t\t/images/cn_InplaceSelect.gif, RichFacesComponentsLibrary.html\#inplaceSelect, jbossrichfaces/freezone/docs/tlddoc/rich/inplaceSelect.html, jbossrichfaces/freezone/docs/apidoc/org/richfaces/component/UIinplaceSelect.html, \t\t\t\t\t/richfaces/inplaceSelect.jsf
-sortingFiltering= richDataIterators, Sorting and Filtering Features, \t\t/images/ico_DataTable.gif, \t\t/images/cn_DataTable.gif, RichFacesComponentsLibrary.html\#dataTable, jbossrichfaces/freezone/docs/tlddoc/rich/dataTable.html, jbossrichfaces/freezone/docs/apidoc/org/richfaces/component/UIdataTable.html, \t\t\t\t\t/richfaces/sortingFilteringFeature.jsf
-columns= richDataIterators, \t\tColumns, \t\t/images/ico_columns.gif, \t\t/images/cn_Columns.gif, \t\t\tRichFacesComponentsLibrary.html\#columns, jbossrichfaces/freezone/docs/tlddoc/rich/columns.html, jbossrichfaces/freezone/docs/apidoc/org/richfaces/component/UIColumns.html, \t\t\t\t\t/richfaces/columns.jsf
\ No newline at end of file
+sorting= richDataIterators, Sorting Feature, \t\t/images/ico_DataTable.gif, \t\t/images/cn_DataTable.gif, RichFacesComponentsLibrary.html\#dataTable, jbossrichfaces/freezone/docs/tlddoc/rich/dataTable.html, jbossrichfaces/freezone/docs/apidoc/org/richfaces/component/UIdataTable.html, \t\t\t\t\t/richfaces/sortingFeature.jsf
+filtering= richDataIterators, Filtering Feature, \t\t/images/ico_DataTable.gif, \t\t/images/cn_DataTable.gif, RichFacesComponentsLibrary.html\#dataTable, jbossrichfaces/freezone/docs/tlddoc/rich/dataTable.html, jbossrichfaces/freezone/docs/apidoc/org/richfaces/component/UIdataTable.html, \t\t\t\t\t/richfaces/filteringFeature.jsf
+columns = richDataIterators, \t\tColumns, \t\t/images/ico_columns.gif, \t\t/images/cn_Columns.gif, \t\t\tRichFacesComponentsLibrary.html\#columns, jbossrichfaces/freezone/docs/tlddoc/rich/columns.html, jbossrichfaces/freezone/docs/apidoc/org/richfaces/component/UIColumns.html, \t\t\t\t\t/richfaces/columns.jsf
\ No newline at end of file
Added: trunk/samples/richfaces-demo/src/main/webapp/richfaces/filteringFeature/examples/externalFiltering.xhtml
===================================================================
Added: trunk/samples/richfaces-demo/src/main/webapp/richfaces/filteringFeature/examples/simpleFiltering.xhtml
===================================================================
--- trunk/samples/richfaces-demo/src/main/webapp/richfaces/filteringFeature/examples/simpleFiltering.xhtml (rev 0)
+++ trunk/samples/richfaces-demo/src/main/webapp/richfaces/filteringFeature/examples/simpleFiltering.xhtml 2008-03-18 17:20:00 UTC (rev 6924)
@@ -0,0 +1,32 @@
+<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">
+ <h:form>
+ <style>
+ .rich-inplace-view{
+ color:gray;
+ border-bottom-color:gray;
+ }
+ </style>
+ <rich:dataTable value="#{capitalsBean.capitals}" var="cap" width="500px">
+ <f:facet name="header">
+ <h:outputText value="Filtering Example"/>
+ </f:facet>
+ <rich:column>
+ <f:facet name="header">
+ <h:graphicImage value="/images/ico_DataTable.gif"></h:graphicImage>
+ </f:facet>
+ <h:graphicImage value="#{cap.stateFlag}"/>
+ </rich:column>
+ <rich:column filterBy="#{cap.state}" filterDefaultLabel="click to filter">
+ <h:outputText value="#{cap.state}"></h:outputText>
+ </rich:column>
+ <rich:column filterBy="#{cap.name}" filterDefaultLabel="click to filter">
+ <h:outputText value="#{cap.name}"/>
+ </rich:column>
+ </rich:dataTable>
+ </h:form>
+</ui:composition>
\ No newline at end of file
Added: trunk/samples/richfaces-demo/src/main/webapp/richfaces/filteringFeature/externalFilteringUsage.xhtml
===================================================================
Added: trunk/samples/richfaces-demo/src/main/webapp/richfaces/filteringFeature/filteringUsage.xhtml
===================================================================
--- trunk/samples/richfaces-demo/src/main/webapp/richfaces/filteringFeature/filteringUsage.xhtml (rev 0)
+++ trunk/samples/richfaces-demo/src/main/webapp/richfaces/filteringFeature/filteringUsage.xhtml 2008-03-18 17:20:00 UTC (rev 6924)
@@ -0,0 +1,29 @@
+<!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:rich="http://richfaces.org/rich">
+ <ui:composition template="/templates/component-sample.xhtml">
+ <ui:define name="sample">
+
+ <p>
+ SHORT DESCRIPTION
+ </p>
+
+ <div class="sample-container" >
+
+ <ui:include src="/richfaces/filteringFeature/examples/simpleFiltering.xhtml"/>
+ <ui:include src="/templates/include/sourceview.xhtml">
+ <ui:param name="sourcepath" value="/richfaces/filteringFeature/examples/simpleFiltering.xhtml"/>
+ </ui:include>
+ </div>
+
+ <p>
+ DESCRIPTION
+ </p>
+
+ </ui:define>
+
+ </ui:composition>
+</html>
Added: trunk/samples/richfaces-demo/src/main/webapp/richfaces/filteringFeature.xhtml
===================================================================
--- trunk/samples/richfaces-demo/src/main/webapp/richfaces/filteringFeature.xhtml (rev 0)
+++ trunk/samples/richfaces-demo/src/main/webapp/richfaces/filteringFeature.xhtml 2008-03-18 17:20:00 UTC (rev 6924)
@@ -0,0 +1,20 @@
+<!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:rich="http://richfaces.org/rich">
+<ui:composition template="/templates/main.xhtml">
+ <ui:define name="title">RichFaces - Open Source Rich JSF Components - Filtering Feature</ui:define>
+ <ui:define name="body">
+ <rich:tabPanel switchType="server" value="#{componentNavigator.activeTab}" styleClass="top_tab" contentClass="content_tab" headerClass="header_tabs_class" inactiveTabClass="inactive_tab" activeTabClass="active_tab">
+ <rich:tab label="Built-In Filtering Usage">
+ <ui:include src="/richfaces/filteringFeature/filteringUsage.xhtml"/>
+ </rich:tab>
+ <ui:include src="/templates/include/tagInfo.xhtml">
+ <ui:param name="path" value="rich/filtering"/>
+ </ui:include>
+ </rich:tabPanel>
+ </ui:define>
+</ui:composition>
+</html>
Copied: trunk/samples/richfaces-demo/src/main/webapp/richfaces/sortingFeature.xhtml (from rev 6889, trunk/samples/richfaces-demo/src/main/webapp/richfaces/sortingFilteringFeature.xhtml)
===================================================================
--- trunk/samples/richfaces-demo/src/main/webapp/richfaces/sortingFeature.xhtml (rev 0)
+++ trunk/samples/richfaces-demo/src/main/webapp/richfaces/sortingFeature.xhtml 2008-03-18 17:20:00 UTC (rev 6924)
@@ -0,0 +1,20 @@
+<!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:rich="http://richfaces.org/rich">
+<ui:composition template="/templates/main.xhtml">
+ <ui:define name="title">RichFaces - Open Source Rich JSF Components - Sorting and Filtering Features</ui:define>
+ <ui:define name="body">
+ <rich:tabPanel switchType="server" styleClass="top_tab" contentClass="content_tab" headerClass="header_tabs_class" inactiveTabClass="inactive_tab" activeTabClass="active_tab">
+ <rich:tab label="Built-in Sorting Feature">
+ <ui:include src="/richfaces/sortingFilteringFeatures/sortingUsage.xhtml"/>
+ </rich:tab>
+ <rich:tab label="External Sorting">
+ <ui:include src="/richfaces/sortingFilteringFeatures/externalSortingUsage.xhtml"/>
+ </rich:tab>
+ </rich:tabPanel>
+ </ui:define>
+</ui:composition>
+</html>
Deleted: trunk/samples/richfaces-demo/src/main/webapp/richfaces/sortingFilteringFeature.xhtml
===================================================================
--- trunk/samples/richfaces-demo/src/main/webapp/richfaces/sortingFilteringFeature.xhtml 2008-03-18 17:12:14 UTC (rev 6923)
+++ trunk/samples/richfaces-demo/src/main/webapp/richfaces/sortingFilteringFeature.xhtml 2008-03-18 17:20:00 UTC (rev 6924)
@@ -1,23 +0,0 @@
-<!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:rich="http://richfaces.org/rich">
-<ui:composition template="/templates/main.xhtml">
- <ui:define name="title">RichFaces - Open Source Rich JSF Components - Sorting and Filtering Features</ui:define>
- <ui:define name="body">
- <rich:tabPanel switchType="server" styleClass="top_tab" contentClass="content_tab" headerClass="header_tabs_class" inactiveTabClass="inactive_tab" activeTabClass="active_tab">
- <rich:tab label="Filtering Feature">
- <ui:include src="/richfaces/sortingFilteringFeatures/filteringUsage.xhtml"/>
- </rich:tab>
- <rich:tab label="Built-in Sorting Feature">
- <ui:include src="/richfaces/sortingFilteringFeatures/sortingUsage.xhtml"/>
- </rich:tab>
- <rich:tab label="External Sorting">
- <ui:include src="/richfaces/sortingFilteringFeatures/externalSortingUsage.xhtml"/>
- </rich:tab>
- </rich:tabPanel>
- </ui:define>
-</ui:composition>
-</html>
Deleted: trunk/samples/richfaces-demo/src/main/webapp/richfaces/sortingFilteringFeatures/examples/externalFiltering.xhtml
===================================================================
Deleted: trunk/samples/richfaces-demo/src/main/webapp/richfaces/sortingFilteringFeatures/examples/simpleFiltering.xhtml
===================================================================
--- trunk/samples/richfaces-demo/src/main/webapp/richfaces/sortingFilteringFeatures/examples/simpleFiltering.xhtml 2008-03-18 17:12:14 UTC (rev 6923)
+++ trunk/samples/richfaces-demo/src/main/webapp/richfaces/sortingFilteringFeatures/examples/simpleFiltering.xhtml 2008-03-18 17:20:00 UTC (rev 6924)
@@ -1,32 +0,0 @@
-<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">
- <h:form>
- <style>
- .rich-inplace-view{
- color:gray;
- border-bottom-color:gray;
- }
- </style>
- <rich:dataTable value="#{capitalsBean.capitals}" var="cap" width="500px">
- <f:facet name="header">
- <h:outputText value="Filtering Example"/>
- </f:facet>
- <rich:column>
- <f:facet name="header">
- <h:graphicImage value="/images/ico_DataTable.gif"></h:graphicImage>
- </f:facet>
- <h:graphicImage value="#{cap.stateFlag}"/>
- </rich:column>
- <rich:column filterBy="#{cap.state}" filterDefaultLabel="click to filter">
- <h:outputText value="#{cap.state}"></h:outputText>
- </rich:column>
- <rich:column filterBy="#{cap.name}" filterDefaultLabel="click to filter">
- <h:outputText value="#{cap.name}"/>
- </rich:column>
- </rich:dataTable>
- </h:form>
-</ui:composition>
\ No newline at end of file
Deleted: trunk/samples/richfaces-demo/src/main/webapp/richfaces/sortingFilteringFeatures/filteringUsage.xhtml
===================================================================
--- trunk/samples/richfaces-demo/src/main/webapp/richfaces/sortingFilteringFeatures/filteringUsage.xhtml 2008-03-18 17:12:14 UTC (rev 6923)
+++ trunk/samples/richfaces-demo/src/main/webapp/richfaces/sortingFilteringFeatures/filteringUsage.xhtml 2008-03-18 17:20:00 UTC (rev 6924)
@@ -1,29 +0,0 @@
-<!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:rich="http://richfaces.org/rich">
- <ui:composition template="/templates/component-sample.xhtml">
- <ui:define name="sample">
-
- <p>
- SHORT DESCRIPTION
- </p>
-
- <div class="sample-container" >
-
- <ui:include src="/richfaces/sortingFilteringFeatures/examples/simpleFiltering.xhtml"/>
- <ui:include src="/templates/include/sourceview.xhtml">
- <ui:param name="sourcepath" value="/richfaces/sortingFilteringFeatures/examples/simpleFiltering.xhtml"/>
- </ui:include>
- </div>
-
- <p>
- DESCRIPTION
- </p>
-
- </ui:define>
-
- </ui:composition>
-</html>
16 years, 10 months
JBoss Rich Faces SVN: r6923 - trunk/ui/inplaceSelect/src/main/resources/org/richfaces/renderkit/html/scripts.
by richfaces-svn-commits@lists.jboss.org
Author: abelevich
Date: 2008-03-18 13:12:14 -0400 (Tue, 18 Mar 2008)
New Revision: 6923
Modified:
trunk/ui/inplaceSelect/src/main/resources/org/richfaces/renderkit/html/scripts/inplaceselect.js
Log:
rename inputProcessing method to the save for spec compatibility
Modified: trunk/ui/inplaceSelect/src/main/resources/org/richfaces/renderkit/html/scripts/inplaceselect.js
===================================================================
--- trunk/ui/inplaceSelect/src/main/resources/org/richfaces/renderkit/html/scripts/inplaceselect.js 2008-03-18 17:11:23 UTC (rev 6922)
+++ trunk/ui/inplaceSelect/src/main/resources/org/richfaces/renderkit/html/scripts/inplaceselect.js 2008-03-18 17:12:14 UTC (rev 6923)
@@ -70,7 +70,7 @@
this.comboList.hideWithDelay();
}
if (this.attributes.showControls) {
- this.inputProcessing();
+ this.save();
}
this.comboList.isList = false;
/*this.comboList.hideWithDelay();*/
@@ -108,7 +108,7 @@
tmpValueKeyDownHandlerIn : function(event) {
switch (event.keyCode) {
case Event.KEY_RETURN :
- this.inputProcessing();
+ this.save();
this.comboList.hideWithDelay();
Event.stop(event);
break;
@@ -126,7 +126,7 @@
}
},
- inputProcessing : function($super) {
+ save : function($super) {
if (this.comboList.activeItem) {
var userValue = this.comboList.activeItem.innerHTML;
this.tempValueKeeper.value = userValue;
16 years, 10 months
JBoss Rich Faces SVN: r6922 - trunk/ui/inplaceInput/src/main/resources/org/richfaces/renderkit/html/scripts.
by richfaces-svn-commits@lists.jboss.org
Author: abelevich
Date: 2008-03-18 13:11:23 -0400 (Tue, 18 Mar 2008)
New Revision: 6922
Modified:
trunk/ui/inplaceInput/src/main/resources/org/richfaces/renderkit/html/scripts/inplaceinput.js
Log:
rename inputProcessing function to the save for spec compatibility
Modified: trunk/ui/inplaceInput/src/main/resources/org/richfaces/renderkit/html/scripts/inplaceinput.js
===================================================================
--- trunk/ui/inplaceInput/src/main/resources/org/richfaces/renderkit/html/scripts/inplaceinput.js 2008-03-18 16:37:58 UTC (rev 6921)
+++ trunk/ui/inplaceInput/src/main/resources/org/richfaces/renderkit/html/scripts/inplaceinput.js 2008-03-18 17:11:23 UTC (rev 6922)
@@ -37,7 +37,8 @@
this.inplaceInput.observe(this.editEvent, function(e){this.switchingStatesHandler(e);}.bindAsEventListener(this));
this.inplaceInput.observe("mouseout", function(e){this.inplaceMouseOutHandler(e);}.bindAsEventListener(this));
this.inplaceInput.observe("mouseover", function(e){this.inplaceMouseOverHandler(e);}.bindAsEventListener(this));
-
+
+
this.tempValueKeeper.observe("blur", function(e){this.tmpValueBlurHandler(e);}.bindAsEventListener(this));
this.tempValueKeeper.observe("keydown", function(e){this.tmpValueKeyDownHandler(e);}.bindAsEventListener(this));
@@ -129,7 +130,7 @@
}
if (!this.attributes.showControls) {
- this.inputProcessing();
+ this.save();
}
},
@@ -139,11 +140,11 @@
this.cancel();
break;
case Event.KEY_RETURN :
- this.inputProcessing();
+ this.save();
Event.stop(e);
break;
case Event.KEY_TAB :
- this.inputProcessing();
+ this.save();
this.byTab = true;
break;
}
@@ -154,7 +155,7 @@
},*/
okHandler : function(e) {
- this.inputProcessing();
+ this.save();
Event.stop(e);
},
@@ -266,7 +267,7 @@
}
},
- inputProcessing : function() {
+ save : function() {
var userValue = this.tempValueKeeper.value;
var value = this.valueKeeper.value;
if (this.events.onviewactivation) {
16 years, 10 months
JBoss Rich Faces SVN: r6921 - trunk/framework/impl/src/main/java/org/richfaces/renderkit.
by richfaces-svn-commits@lists.jboss.org
Author: maksimkaszynski
Date: 2008-03-18 12:37:58 -0400 (Tue, 18 Mar 2008)
New Revision: 6921
Modified:
trunk/framework/impl/src/main/java/org/richfaces/renderkit/RendererContributor.java
Log:
some code cleanup
Modified: trunk/framework/impl/src/main/java/org/richfaces/renderkit/RendererContributor.java
===================================================================
--- trunk/framework/impl/src/main/java/org/richfaces/renderkit/RendererContributor.java 2008-03-18 16:32:49 UTC (rev 6920)
+++ trunk/framework/impl/src/main/java/org/richfaces/renderkit/RendererContributor.java 2008-03-18 16:37:58 UTC (rev 6921)
@@ -35,5 +35,5 @@
public void decode(FacesContext context, UIComponent component, CompositeRenderer compositeRenderer);
public String[] getScriptDependencies();
public String[] getStyleDependencies();
- public Class getAcceptableClass();
+ public Class<?> getAcceptableClass();
}
16 years, 10 months
JBoss Rich Faces SVN: r6920 - in trunk/ui/scrollableDataTable/src: main/java/org/richfaces/component and 5 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: maksimkaszynski
Date: 2008-03-18 12:32:49 -0400 (Tue, 18 Mar 2008)
New Revision: 6920
Modified:
trunk/ui/scrollableDataTable/src/main/config/component/scrollable-data-table.xml
trunk/ui/scrollableDataTable/src/main/java/org/richfaces/component/UIScrollableDataTable.java
trunk/ui/scrollableDataTable/src/main/java/org/richfaces/event/sort/MultiColumnSortListener.java
trunk/ui/scrollableDataTable/src/main/java/org/richfaces/event/sort/SingleColumnSortListener.java
trunk/ui/scrollableDataTable/src/main/java/org/richfaces/model/internal/ComponentSortableDataModel.java
trunk/ui/scrollableDataTable/src/main/java/org/richfaces/model/selection/ClientSelection.java
trunk/ui/scrollableDataTable/src/main/java/org/richfaces/renderkit/html/ColumnWalker.java
trunk/ui/scrollableDataTable/src/main/java/org/richfaces/renderkit/html/ScrollableDataTableBaseRenderer.java
trunk/ui/scrollableDataTable/src/main/java/org/richfaces/renderkit/html/ScrollableDataTableOptions.java
trunk/ui/scrollableDataTable/src/main/java/org/richfaces/renderkit/html/ScrollableDataTableRendererState.java
trunk/ui/scrollableDataTable/src/main/java/org/richfaces/renderkit/html/SelectionRendererContributor.java
trunk/ui/scrollableDataTable/src/test/java/org/richfaces/renderkit/html/JSFComponentTest.java
trunk/ui/scrollableDataTable/src/test/java/org/richfaces/renderkit/html/ScrollableDataTableRendererStateTest.java
Log:
some code cleanup
Modified: trunk/ui/scrollableDataTable/src/main/config/component/scrollable-data-table.xml
===================================================================
--- trunk/ui/scrollableDataTable/src/main/config/component/scrollable-data-table.xml 2008-03-18 16:25:42 UTC (rev 6919)
+++ trunk/ui/scrollableDataTable/src/main/config/component/scrollable-data-table.xml 2008-03-18 16:32:49 UTC (rev 6920)
@@ -58,7 +58,7 @@
<defaultvalue>"500px"</defaultvalue>
</property>
- <property>
+ <property elonly="true">
<name>componentState</name>
<classname>org.ajax4jsf.model.DataComponentState</classname>
<description>It defines EL-binding for a component state for saving or redefinition</description>
@@ -137,7 +137,7 @@
</description>
</property>
- <property attachedstate="true">
+ <property attachedstate="true" elonly="true">
<name>sortOrder</name>
<classname>org.richfaces.model.SortOrder</classname>
<description>
@@ -145,7 +145,7 @@
</description>
</property>
- <property attachedstate="true">
+ <property attachedstate="true" elonly="true">
<name>selection</name>
<classname>org.richfaces.model.selection.Selection</classname>
<description>Value binding representing selected rows</description>
@@ -168,7 +168,7 @@
</description>
</property>
- <property>
+ <property el="false">
<name>rowKeyVar</name>
<classname>java.lang.String</classname>
<description>The attribute provides access to a row key in a Request scope</description>
@@ -189,7 +189,7 @@
<description>The attribute is a representation of an identifier for a specific data row</description>
</property>
- <property>
+ <property el="false">
<name>scriptVar</name>
<classname>java.lang.String</classname>
<description>Name of JavaScript variable corresponding to component
@@ -215,7 +215,7 @@
</description>
</property>
- <property>
+ <property el="false">
<name>stateVar</name>
<classname>java.lang.String</classname>
<description>
@@ -223,7 +223,7 @@
</description>
</property>
- <property hidden="true">
+ <property hidden="true" elonly="true">
<name>sortListener</name>
<classname>org.richfaces.event.sort.SortListener</classname>
@@ -232,7 +232,7 @@
</description>
</property>
- <property>
+ <property elonly="true">
<name>ajaxKeys</name>
<classname>java.util.Set</classname>
<description>This attribute defines row keys that are updated after an AJAX request</description>
Modified: trunk/ui/scrollableDataTable/src/main/java/org/richfaces/component/UIScrollableDataTable.java
===================================================================
--- trunk/ui/scrollableDataTable/src/main/java/org/richfaces/component/UIScrollableDataTable.java 2008-03-18 16:25:42 UTC (rev 6919)
+++ trunk/ui/scrollableDataTable/src/main/java/org/richfaces/component/UIScrollableDataTable.java 2008-03-18 16:32:49 UTC (rev 6920)
@@ -63,9 +63,9 @@
/**
* hold list of ranges previously accessed until updates are fully done for them
*/
- private List ranges;
+ private List<Range> ranges;
- private Collection responseData = new ArrayList();
+ private Collection<String> responseData = new ArrayList<String>();
private int reqRowsCount = -1;
@@ -77,11 +77,11 @@
public abstract void setSortOrder(SortOrder sortOrder) ;
- public Collection getResponseData() {
+ public Collection<String> getResponseData() {
return responseData;
}
- public void setResponseData(Collection responseData) {
+ public void setResponseData(Collection<String> responseData) {
this.responseData = responseData;
}
@@ -168,14 +168,14 @@
Object value = getValue();
- ScrollableTableDataModel model = null;
+ ScrollableTableDataModel<?> model = null;
if (value instanceof ScrollableTableDataModel) {
if (log.isDebugEnabled()) {
log.debug("Found instanceof " + value.getClass() + " will use it unwrapped");
}
- model = (ScrollableTableDataModel) value;
+ model = (ScrollableTableDataModel<?>) value;
} else {
model = new ComponentSortableDataModel(getVar(), value);
@@ -209,19 +209,22 @@
}
+
+ @SuppressWarnings("unchecked")
public void restoreState(FacesContext context, Object state) {
Object values[] = (Object[])state;
super.restoreState(context, values[0]);
- ranges = ((List)values[1]);
+ ranges = ((List<Range>)values[1]);
scrollPos = (String)values[2];
sortListener = (SortListener) restoreAttachedState(context, values[3]);
}
- protected Iterator dataChildren() {
+ @SuppressWarnings("unchecked")
+ protected Iterator<UIComponent> dataChildren() {
IteratorChain chain = new IteratorChain();
chain.addIterator(getFacets().values().iterator());
- for (Iterator i = getChildren().iterator(); i.hasNext(); ) {
+ for (Iterator<UIComponent> i = getChildren().iterator(); i.hasNext(); ) {
UIComponent kid = (UIComponent)i.next();
if (kid instanceof Column) {
chain.addIterator(kid.getChildren().iterator());
@@ -231,10 +234,11 @@
return chain;
}
- protected Iterator fixedChildren() {
+ @SuppressWarnings("unchecked")
+ protected Iterator<UIComponent> fixedChildren() {
IteratorChain chain = new IteratorChain(getFacets().values().iterator());
- for (Iterator i = getChildren().iterator(); i.hasNext(); ) {
+ for (Iterator<UIComponent> i = getChildren().iterator(); i.hasNext(); ) {
UIComponent kid = (UIComponent)i.next();
if (kid instanceof Column) {
chain.addIterator(kid.getFacets().values().iterator());
@@ -311,7 +315,7 @@
Range visitedRange = getComponentState().getRange();
if(ranges == null){
- ranges = new ArrayList();
+ ranges = new ArrayList<Range>();
}
if(!ranges.contains(visitedRange)){
@@ -320,7 +324,7 @@
if(useSavedRanges){
- for (Iterator iter = ranges.iterator(); iter.hasNext();) {
+ for (Iterator<Range> iter = ranges.iterator(); iter.hasNext();) {
ScrollableTableDataRange range = (ScrollableTableDataRange) iter.next();
if (log.isDebugEnabled()) {
Modified: trunk/ui/scrollableDataTable/src/main/java/org/richfaces/event/sort/MultiColumnSortListener.java
===================================================================
--- trunk/ui/scrollableDataTable/src/main/java/org/richfaces/event/sort/MultiColumnSortListener.java 2008-03-18 16:25:42 UTC (rev 6919)
+++ trunk/ui/scrollableDataTable/src/main/java/org/richfaces/event/sort/MultiColumnSortListener.java 2008-03-18 16:32:49 UTC (rev 6920)
@@ -45,8 +45,8 @@
sortOrder = new SortOrder();
grid.setSortOrder(sortOrder);
- if (grid.getValueBinding("sortOrder") != null) {
- grid.getValueBinding("sortOrder").setValue(FacesContext.getCurrentInstance(), sortOrder);
+ if (grid.getValueExpression("sortOrder") != null) {
+ grid.getValueExpression("sortOrder").setValue(FacesContext.getCurrentInstance().getELContext(), sortOrder);
}
}
@@ -60,10 +60,10 @@
fields = new SortField[] {new SortField(name, columnIndex, nextSortOrder(null, suggested))};
} else {
- List newFields = new LinkedList(Arrays.asList(fields));
+ List<SortField> newFields = new LinkedList<SortField>(Arrays.asList(fields));
SortField newField = null;
- for (Iterator iterator = newFields.iterator(); iterator.hasNext() && newField == null; ) {
+ for (Iterator<SortField> iterator = newFields.iterator(); iterator.hasNext() && newField == null; ) {
SortField sortField = (SortField) iterator.next();
if (sortField.getIndex() == columnIndex ||
(sortField.getName() != null &&
Modified: trunk/ui/scrollableDataTable/src/main/java/org/richfaces/event/sort/SingleColumnSortListener.java
===================================================================
--- trunk/ui/scrollableDataTable/src/main/java/org/richfaces/event/sort/SingleColumnSortListener.java 2008-03-18 16:25:42 UTC (rev 6919)
+++ trunk/ui/scrollableDataTable/src/main/java/org/richfaces/event/sort/SingleColumnSortListener.java 2008-03-18 16:32:49 UTC (rev 6920)
@@ -38,8 +38,8 @@
sortOrder = new SortOrder();
grid.setSortOrder(sortOrder);
- if (grid.getValueBinding("sortOrder") != null) {
- grid.getValueBinding("sortOrder").setValue(FacesContext.getCurrentInstance(), sortOrder);
+ if (grid.getValueExpression("sortOrder") != null) {
+ grid.getValueExpression("sortOrder").setValue(FacesContext.getCurrentInstance().getELContext(), sortOrder);
}
}
Modified: trunk/ui/scrollableDataTable/src/main/java/org/richfaces/model/internal/ComponentSortableDataModel.java
===================================================================
--- trunk/ui/scrollableDataTable/src/main/java/org/richfaces/model/internal/ComponentSortableDataModel.java 2008-03-18 16:25:42 UTC (rev 6919)
+++ trunk/ui/scrollableDataTable/src/main/java/org/richfaces/model/internal/ComponentSortableDataModel.java 2008-03-18 16:32:49 UTC (rev 6920)
@@ -39,7 +39,7 @@
* @author Maksim Kaszynski
*
*/
-public class ComponentSortableDataModel extends ScrollableTableDataModel {
+public class ComponentSortableDataModel extends ScrollableTableDataModel<Object> {
/**
Modified: trunk/ui/scrollableDataTable/src/main/java/org/richfaces/model/selection/ClientSelection.java
===================================================================
--- trunk/ui/scrollableDataTable/src/main/java/org/richfaces/model/selection/ClientSelection.java 2008-03-18 16:25:42 UTC (rev 6919)
+++ trunk/ui/scrollableDataTable/src/main/java/org/richfaces/model/selection/ClientSelection.java 2008-03-18 16:32:49 UTC (rev 6920)
@@ -26,7 +26,7 @@
private int activeRowIndex = -1;
- private List ranges = new ArrayList();
+ private List<SelectionRange> ranges = new ArrayList<SelectionRange>();
public ClientSelection() {
}
@@ -38,14 +38,14 @@
public boolean isSelected(int i) {
boolean result = false;
- Iterator iterator = ranges.iterator();
+ Iterator<SelectionRange> iterator = ranges.iterator();
while (iterator.hasNext() && !result) {
result |= ((SelectionRange) iterator.next()).within(i);
}
return result;
}
- public List getRanges() {
+ public List<SelectionRange> getRanges() {
return ranges;
}
Modified: trunk/ui/scrollableDataTable/src/main/java/org/richfaces/renderkit/html/ColumnWalker.java
===================================================================
--- trunk/ui/scrollableDataTable/src/main/java/org/richfaces/renderkit/html/ColumnWalker.java 2008-03-18 16:25:42 UTC (rev 6919)
+++ trunk/ui/scrollableDataTable/src/main/java/org/richfaces/renderkit/html/ColumnWalker.java 2008-03-18 16:32:49 UTC (rev 6920)
@@ -35,7 +35,7 @@
try {
if(component instanceof UIScrollableDataTable){
- for (Iterator iter = component.getChildren().iterator(); iter.hasNext(); ) {
+ for (Iterator<UIComponent> iter = component.getChildren().iterator(); iter.hasNext(); ) {
UIComponent kid = (UIComponent) iter.next();
if (kid.isRendered()) {
if (kid instanceof Column){
Modified: trunk/ui/scrollableDataTable/src/main/java/org/richfaces/renderkit/html/ScrollableDataTableBaseRenderer.java
===================================================================
--- trunk/ui/scrollableDataTable/src/main/java/org/richfaces/renderkit/html/ScrollableDataTableBaseRenderer.java 2008-03-18 16:25:42 UTC (rev 6919)
+++ trunk/ui/scrollableDataTable/src/main/java/org/richfaces/renderkit/html/ScrollableDataTableBaseRenderer.java 2008-03-18 16:32:49 UTC (rev 6920)
@@ -319,7 +319,7 @@
ajaxContext.getResponseData();
UIScrollableDataTable grid = state.getGrid();
- Collection collection = grid.getResponseData();
+ Collection<String> collection = grid.getResponseData();
grid.setRowKey(rowKey);
ResponseWriter writer = context.getResponseWriter();
@@ -329,7 +329,7 @@
String baseClientId = grid.getBaseClientId(context);
- for (Iterator iter = grid.getChildren().iterator(); iter.hasNext(); ) {
+ for (Iterator<UIComponent> iter = grid.getChildren().iterator(); iter.hasNext(); ) {
UIComponent kid = (UIComponent) iter.next();
if (kid.isRendered()) {
@@ -385,7 +385,7 @@
private void writeNormalTr(boolean frozenTRRendered,
ScrollableDataTableRendererState state,
- UIScrollableDataTable grid, Collection collection,
+ UIScrollableDataTable grid, Collection<String> collection,
ResponseWriter writer, String baseClientId) throws IOException {
String row_id;
if(frozenTRRendered){
@@ -571,13 +571,15 @@
ScrollableDataTableRendererState.restoreState(context);
}
-
public String getRowsAjaxUpdate(FacesContext context, UIScrollableDataTable grid){
JSFunction function = AjaxRendererUtils.buildAjaxFunction(grid, context);
- Map options = AjaxRendererUtils.buildEventOptions(context, grid);
+ Map<String, Object> options = AjaxRendererUtils.buildEventOptions(context, grid);
options.put("oncomplete", AjaxFunctionBuilder.getOnComplete(context, grid, AjaxFunctionBuilder.SCROLL));
- Map parametersMap = (Map)options.get("parameters");
+
+ @SuppressWarnings("unchecked")
+ Map<String, Object> parametersMap = (Map<String, Object>) options.get("parameters");
+
parametersMap.put(grid.getBaseClientId(context) + ":scroll", "");
function.addParameter(options);
String completeFunction = function.toScript()+"; return false;";
@@ -603,7 +605,7 @@
ExternalContext externalContext = context.getExternalContext();
String clientId = grid.getClientId(context);
boolean sorted = false;
- Map parameters = externalContext.getRequestParameterMap();
+ Map<String, String> parameters = externalContext.getRequestParameterMap();
String s_id = clientId + ":si";
grid.resetReqRowsCount();
Modified: trunk/ui/scrollableDataTable/src/main/java/org/richfaces/renderkit/html/ScrollableDataTableOptions.java
===================================================================
--- trunk/ui/scrollableDataTable/src/main/java/org/richfaces/renderkit/html/ScrollableDataTableOptions.java 2008-03-18 16:25:42 UTC (rev 6919)
+++ trunk/ui/scrollableDataTable/src/main/java/org/richfaces/renderkit/html/ScrollableDataTableOptions.java 2008-03-18 16:32:49 UTC (rev 6920)
@@ -75,9 +75,10 @@
JSReference sortStartRow = new JSReference("event.startRow");
JSReference sortIndex = new JSReference("event.index");
- Map options = AjaxRendererUtils.buildEventOptions(context, grid);
+ Map<String, Object> options = AjaxRendererUtils.buildEventOptions(context, grid);
- Map parametersMap = (Map)options.get("parameters");
+ @SuppressWarnings("unchecked")
+ Map<String, Object> parametersMap = (Map)options.get("parameters");
String id = grid.getClientId(context);
parametersMap.put(id + ":sortColumn", sortColumn);
parametersMap.put(id + ":sortOrder", sortOrder);
Modified: trunk/ui/scrollableDataTable/src/main/java/org/richfaces/renderkit/html/ScrollableDataTableRendererState.java
===================================================================
--- trunk/ui/scrollableDataTable/src/main/java/org/richfaces/renderkit/html/ScrollableDataTableRendererState.java 2008-03-18 16:25:42 UTC (rev 6919)
+++ trunk/ui/scrollableDataTable/src/main/java/org/richfaces/renderkit/html/ScrollableDataTableRendererState.java 2008-03-18 16:32:49 UTC (rev 6920)
@@ -3,8 +3,8 @@
*/
package org.richfaces.renderkit.html;
-import java.util.Collection;
import java.util.HashSet;
+import java.util.Set;
import javax.faces.FacesException;
import javax.faces.component.NamingContainer;
@@ -30,7 +30,7 @@
private boolean fake;
- private HashSet ids = new HashSet();
+ private Set<String> ids = new HashSet<String>();
private String rowClasses[];
@@ -46,8 +46,6 @@
private int _columns = 0;
- private Collection collection;
-
private Integer sepOffset;
private String _cell_id_prefix;
@@ -373,14 +371,7 @@
this.sepOffset = sepOffset;
}
- public Collection getCollection() {
- return collection;
- }
-
- public void setCollection(Collection collection) {
- this.collection = collection;
- }
-
+
public boolean isFake() {
return fake;
}
@@ -432,7 +423,7 @@
}
}
- public HashSet getIds() {
+ public Set<String> getIds() {
return ids;
}
Modified: trunk/ui/scrollableDataTable/src/main/java/org/richfaces/renderkit/html/SelectionRendererContributor.java
===================================================================
--- trunk/ui/scrollableDataTable/src/main/java/org/richfaces/renderkit/html/SelectionRendererContributor.java 2008-03-18 16:25:42 UTC (rev 6919)
+++ trunk/ui/scrollableDataTable/src/main/java/org/richfaces/renderkit/html/SelectionRendererContributor.java 2008-03-18 16:32:49 UTC (rev 6920)
@@ -6,6 +6,7 @@
import java.io.IOException;
import java.util.Map;
+import javax.el.ValueExpression;
import javax.faces.FacesException;
import javax.faces.application.Application;
import javax.faces.component.UIComponent;
@@ -13,7 +14,6 @@
import javax.faces.context.FacesContext;
import javax.faces.context.ResponseWriter;
import javax.faces.convert.Converter;
-import javax.faces.el.ValueBinding;
import org.ajax4jsf.context.AjaxContext;
import org.ajax4jsf.model.DataVisitor;
@@ -48,7 +48,7 @@
final UIScrollableDataTable grid = (UIScrollableDataTable) component;
ExternalContext externalContext = context.getExternalContext();
- Map requestParamMap = externalContext.getRequestParameterMap();
+ Map<String, String> requestParamMap = externalContext.getRequestParameterMap();
Application application = context.getApplication();
String id = getSelectionInputName(context, grid);
@@ -117,9 +117,9 @@
grid.setSelection(simpleSelection);
- ValueBinding selectionBinding = grid.getValueBinding("selection");
+ ValueExpression selectionBinding = grid.getValueExpression("selection");
if (selectionBinding != null) {
- selectionBinding.setValue(context, simpleSelection);
+ selectionBinding.setValue(context.getELContext(), simpleSelection);
}
ScrollableDataTableRendererState.restoreState(context);
@@ -130,7 +130,7 @@
*
* @see org.richfaces.renderkit.RendererContributor#getAcceptableClass()
*/
- public Class getAcceptableClass() {
+ public Class<?> getAcceptableClass() {
return UIScrollableDataTable.class;
}
@@ -168,7 +168,7 @@
ScriptOptions scriptOptions = new ScriptOptions(component);
scriptOptions.addOption("selectionInput", getSelectionInputName(
context, (UIScrollableDataTable) component));
- Map attributes = component.getAttributes();
+ Map<String, Object> attributes = component.getAttributes();
Object attribut = attributes.get("selectedClass");
if (attribut == null) {
attribut = "";
Modified: trunk/ui/scrollableDataTable/src/test/java/org/richfaces/renderkit/html/JSFComponentTest.java
===================================================================
--- trunk/ui/scrollableDataTable/src/test/java/org/richfaces/renderkit/html/JSFComponentTest.java 2008-03-18 16:25:42 UTC (rev 6919)
+++ trunk/ui/scrollableDataTable/src/test/java/org/richfaces/renderkit/html/JSFComponentTest.java 2008-03-18 16:32:49 UTC (rev 6920)
@@ -1,9 +1,6 @@
package org.richfaces.renderkit.html;
-import junit.framework.Test;
import junit.framework.TestCase;
-import junit.framework.TestSuite;
-import javax.faces.component.UIComponent;
/**
* Unit test for simple Component.
Modified: trunk/ui/scrollableDataTable/src/test/java/org/richfaces/renderkit/html/ScrollableDataTableRendererStateTest.java
===================================================================
--- trunk/ui/scrollableDataTable/src/test/java/org/richfaces/renderkit/html/ScrollableDataTableRendererStateTest.java 2008-03-18 16:25:42 UTC (rev 6919)
+++ trunk/ui/scrollableDataTable/src/test/java/org/richfaces/renderkit/html/ScrollableDataTableRendererStateTest.java 2008-03-18 16:32:49 UTC (rev 6920)
@@ -1,12 +1,7 @@
package org.richfaces.renderkit.html;
-import java.util.ArrayList;
-import java.util.Collection;
-
import javax.faces.context.ResponseWriter;
-import org.ajax4jsf.context.AjaxContext;
-import org.ajax4jsf.context.AjaxContextImpl;
import org.ajax4jsf.tests.AbstractAjax4JsfTestCase;
import org.richfaces.component.UIScrollableDataTable;
@@ -170,12 +165,6 @@
assertEquals(i, state.getSepOffset());
}
- public void testGetCollection() {
- Collection collection = new ArrayList();
- state.setCollection(collection);
- assertEquals(collection, state.getCollection());
- }
-
public void testIsFake() {
boolean fake = true;
state.setFake(fake);
16 years, 10 months
JBoss Rich Faces SVN: r6919 - in trunk/samples/richfaces-demo/src/main: webapp/WEB-INF and 1 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: ilya_shaikovsky
Date: 2008-03-18 12:25:42 -0400 (Tue, 18 Mar 2008)
New Revision: 6919
Added:
trunk/samples/richfaces-demo/src/main/java/org/richfaces/datatablescroller/SortOption.java
trunk/samples/richfaces-demo/src/main/java/org/richfaces/datatablescroller/SortingBean.java
Modified:
trunk/samples/richfaces-demo/src/main/webapp/WEB-INF/faces-config.xml
trunk/samples/richfaces-demo/src/main/webapp/richfaces/sortingFilteringFeatures/examples/externalMultipleSorting.xhtml
Log:
Added: trunk/samples/richfaces-demo/src/main/java/org/richfaces/datatablescroller/SortOption.java
===================================================================
--- trunk/samples/richfaces-demo/src/main/java/org/richfaces/datatablescroller/SortOption.java (rev 0)
+++ trunk/samples/richfaces-demo/src/main/java/org/richfaces/datatablescroller/SortOption.java 2008-03-18 16:25:42 UTC (rev 6919)
@@ -0,0 +1,38 @@
+/**
+ *
+ */
+package org.richfaces.datatablescroller;
+
+import org.richfaces.model.Ordering;
+
+/**
+ * @author Ilya Shaikovsky
+ *
+ */
+public class SortOption {
+ private int item;
+ private Ordering direction;
+
+ public SortOption(Integer item) {
+ setItem(item);
+ setDirection(Ordering.UNSORTED);
+ }
+
+ public Ordering getDirection() {
+ return direction;
+ }
+ public void setDirection(Ordering direction) {
+ this.direction = direction;
+ }
+
+
+ public int getItem() {
+ return item;
+ }
+
+
+ public void setItem(int item) {
+ this.item = item;
+ }
+
+}
Copied: trunk/samples/richfaces-demo/src/main/java/org/richfaces/datatablescroller/SortingBean.java (from rev 6889, trunk/samples/richfaces-demo/src/main/java/org/richfaces/demo/dataTableScroller/SortingBean.java)
===================================================================
--- trunk/samples/richfaces-demo/src/main/java/org/richfaces/datatablescroller/SortingBean.java (rev 0)
+++ trunk/samples/richfaces-demo/src/main/java/org/richfaces/datatablescroller/SortingBean.java 2008-03-18 16:25:42 UTC (rev 6919)
@@ -0,0 +1,198 @@
+/**
+ *
+ */
+package org.richfaces.datatablescroller;
+
+import java.util.ArrayList;
+
+import javax.faces.event.ValueChangeEvent;
+import javax.faces.model.SelectItem;
+
+import org.richfaces.model.Ordering;
+
+/**
+ * @author Ilya Shaikovsky
+ *
+ */
+public class SortingBean {
+
+ //Settings panel data bindings
+ ArrayList<SelectItem> firstSortItems = new ArrayList<SelectItem>();
+ ArrayList<SelectItem> secondSortItems = new ArrayList<SelectItem>();
+ ArrayList<SelectItem> thirdSortItems = new ArrayList<SelectItem>();
+ SelectItem[] sortDirectionItems = new SelectItem[3];
+ private SortOption firstSortOption= new SortOption(0);
+ private SortOption secondSortOption = new SortOption(0);
+ private SortOption thirdSortOption = new SortOption(0);
+
+ //Table Sort directions Binding
+ ArrayList<String> prioritList = new ArrayList<String>();
+
+ private String makeDirection = Ordering.UNSORTED.name();
+ private String modelDirection = Ordering.UNSORTED.name();
+ private String priceDirection = Ordering.UNSORTED.name();
+ private String mileageDirection = Ordering.UNSORTED.name();
+
+ public SortingBean() {
+ firstSortItems.add(new SelectItem(0,"None"));
+ firstSortItems.add(new SelectItem(1,"Model"));
+ firstSortItems.add(new SelectItem(2,"Price"));
+ firstSortItems.add(new SelectItem(3,"Make"));
+ firstSortItems.add(new SelectItem(4,"Mileage"));
+
+ sortDirectionItems[0] = new SelectItem(Ordering.UNSORTED, "Unsorted");
+ sortDirectionItems[1] = new SelectItem(Ordering.ASCENDING, "Ascending");
+ sortDirectionItems[2] = new SelectItem(Ordering.DESCENDING, "Descending");
+ }
+
+ public void firstSortOptionValueChanged(ValueChangeEvent valueChangeEvent) {
+ if (!(valueChangeEvent.getNewValue().equals(new Integer(0)))){
+ secondSortItems.clear();
+ thirdSortItems.clear();
+ for (SelectItem item : firstSortItems) {
+ if (!(item.getValue().equals(valueChangeEvent.getNewValue()))){
+ secondSortItems.add(item);
+ }
+ }
+ }
+ firstSortOption.setDirection(Ordering.UNSORTED);
+ secondSortOption.setItem(0);
+ secondSortOption.setDirection(Ordering.UNSORTED);
+ thirdSortOption.setItem(0);
+ thirdSortOption.setDirection(Ordering.UNSORTED);
+ }
+
+ public void secondSortOptionValueChanged(ValueChangeEvent valueChangeEvent) {
+ if (!(valueChangeEvent.getNewValue().equals(new Integer(0)))){
+ thirdSortItems.clear();
+ for (SelectItem item : secondSortItems) {
+ if (!(item.getValue().equals(valueChangeEvent.getNewValue()))){
+ thirdSortItems.add(item);
+ }
+ }
+ }
+ secondSortOption.setDirection(Ordering.UNSORTED);
+ thirdSortOption.setItem(0);
+ thirdSortOption.setDirection(Ordering.UNSORTED);
+ }
+
+ public void thirdSortOptionValueChanged(ValueChangeEvent valueChangeEvent) {
+ thirdSortOption.setDirection(Ordering.UNSORTED);
+ }
+
+ public void checkSort(SortOption value){
+ switch (value.getItem()) {
+ case 1:
+ prioritList.add("model");
+ setModelDirection(value.getDirection().name());
+ break;
+ case 2:
+ prioritList.add("price");
+ setPriceDirection(value.getDirection().name());
+ break;
+ case 3:
+ prioritList.add("make");
+ setMakeDirection(value.getDirection().name());
+ break;
+ case 4:
+ prioritList.add("mileage");
+ setMileageDirection(value.getDirection().name());
+ break;
+ }
+ }
+
+ public String sortTable() {
+ prioritList.clear();
+ setModelDirection(Ordering.UNSORTED.name());
+ setMakeDirection(Ordering.UNSORTED.name());
+ setPriceDirection(Ordering.UNSORTED.name());
+ setMileageDirection(Ordering.UNSORTED.name());
+ if (firstSortOption.getItem()!=0){
+ checkSort(firstSortOption);
+ if (secondSortOption.getItem()!=0){
+ checkSort(secondSortOption);
+ if (thirdSortOption.getItem()!=0) {
+ checkSort(thirdSortOption);
+ }
+ }
+ }
+ return null;
+ }
+
+ public SelectItem[] getSortDirectionItems() {
+ return sortDirectionItems;
+ }
+
+ public ArrayList<String> getPrioritList() {
+ return prioritList;
+ }
+
+ public SortOption getFirstSortOption() {
+ return firstSortOption;
+ }
+
+ public void setFirstSortOption(SortOption firstSortOption) {
+ this.firstSortOption = firstSortOption;
+ }
+
+ public SortOption getSecondSortOption() {
+ return secondSortOption;
+ }
+
+ public void setSecondSortOption(SortOption secondSortOption) {
+ this.secondSortOption = secondSortOption;
+ }
+
+ public SortOption getThirdSortOption() {
+ return thirdSortOption;
+ }
+
+ public void setThirdSortOption(SortOption thirdSortOption) {
+ this.thirdSortOption = thirdSortOption;
+ }
+
+ public ArrayList<SelectItem> getFirstSortItems() {
+ return firstSortItems;
+ }
+
+ public ArrayList<SelectItem> getSecondSortItems() {
+ return secondSortItems;
+ }
+
+ public ArrayList<SelectItem> getThirdSortItems() {
+ return thirdSortItems;
+ }
+
+ public String getMakeDirection() {
+ return makeDirection;
+ }
+
+ public void setMakeDirection(String makeDirection) {
+ this.makeDirection = makeDirection;
+ }
+
+ public String getModelDirection() {
+ return modelDirection;
+ }
+
+ public void setModelDirection(String modelDirection) {
+ this.modelDirection = modelDirection;
+ }
+
+ public String getPriceDirection() {
+ return priceDirection;
+ }
+
+ public void setPriceDirection(String priceDirection) {
+ this.priceDirection = priceDirection;
+ }
+
+ public String getMileageDirection() {
+ return mileageDirection;
+ }
+
+ public void setMileageDirection(String mileageDirection) {
+ this.mileageDirection = mileageDirection;
+ }
+
+}
Modified: trunk/samples/richfaces-demo/src/main/webapp/WEB-INF/faces-config.xml
===================================================================
--- trunk/samples/richfaces-demo/src/main/webapp/WEB-INF/faces-config.xml 2008-03-18 16:25:12 UTC (rev 6918)
+++ trunk/samples/richfaces-demo/src/main/webapp/WEB-INF/faces-config.xml 2008-03-18 16:25:42 UTC (rev 6919)
@@ -300,8 +300,8 @@
</managed-bean>
<managed-bean>
<managed-bean-name>sortingBean</managed-bean-name>
- <managed-bean-class>org.richfaces.demo.dataTableScroller.SortingBean</managed-bean-class>
- <managed-bean-scope>request</managed-bean-scope>
+ <managed-bean-class>org.richfaces.datatablescroller.SortingBean</managed-bean-class>
+ <managed-bean-scope>session</managed-bean-scope>
</managed-bean>
<navigation-rule>
<from-view-id>/richfaces/include/examples/wstep1.xhtml</from-view-id>
Modified: trunk/samples/richfaces-demo/src/main/webapp/richfaces/sortingFilteringFeatures/examples/externalMultipleSorting.xhtml
===================================================================
--- trunk/samples/richfaces-demo/src/main/webapp/richfaces/sortingFilteringFeatures/examples/externalMultipleSorting.xhtml 2008-03-18 16:25:12 UTC (rev 6918)
+++ trunk/samples/richfaces-demo/src/main/webapp/richfaces/sortingFilteringFeatures/examples/externalMultipleSorting.xhtml 2008-03-18 16:25:42 UTC (rev 6919)
@@ -1,67 +1,133 @@
<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>
- .top{
- vertical-align:top;
- }
- </style>
-
- <h:panelGrid columns="2" columnClasses="top">
- <rich:dataTable value="#{dataTableScrollerBean.allCars}" var="category" rows="30" id="table">
- <rich:column id="make" sortBy="#{category.make}" sortOrder="#{sortingBean.makeDirection}">
- <f:facet name="header"><h:outputText styleClass="headerText" value="Make" /></f:facet>
+ 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>
+.top {
+ vertical-align: top;
+}
+
+.equals {
+ width: 33%;
+}
+</style>
+
+ <h:panelGrid columns="2" columnClasses="top">
+ <h:form>
+ <rich:dataTable value="#{dataTableScrollerBean.allCars}"
+ var="category" rows="30" id="table"
+ sortPriorities="#{sortingBean.prioritList}">
+ <rich:column id="make" sortBy="#{category.make}"
+ sortOrder="#{sortingBean.makeDirection}" selfSorted="false">
+ <f:facet name="header">
+ <h:outputText styleClass="headerText" value="Make" />
+ </f:facet>
<h:outputText value="#{category.make}" />
</rich:column>
- <rich:column id="model" sortBy="#{category.model}" sortOrder="#{sortingBean.modelDirection}">
- <f:facet name="header"><h:outputText styleClass="headerText" value="Model" /></f:facet>
+ <rich:column id="model" sortBy="#{category.model}"
+ sortOrder="#{sortingBean.modelDirection}" selfSorted="false">
+ <f:facet name="header">
+ <h:outputText styleClass="headerText" value="Model" />
+ </f:facet>
<h:outputText value="#{category.model}" />
</rich:column>
- <rich:column id="price" sortBy="#{category.price}" sortOrder="#{sortingBean.priceDirection}">
- <f:facet name="header"><h:outputText styleClass="headerText" value="Price" /></f:facet>
+ <rich:column id="price" sortBy="#{category.price}"
+ sortOrder="#{sortingBean.priceDirection}" selfSorted="false">
+ <f:facet name="header">
+ <h:outputText styleClass="headerText" value="Price" />
+ </f:facet>
<h:outputText value="#{category.price}" />
</rich:column>
- <rich:column id="mileage" sortBy="#{category.mileage}" sortOrder="#{sortingBean.mileageDirection}">
- <f:facet name="header"><h:outputText styleClass="headerText" value="Mileage" /></f:facet>
+ <rich:column id="mileage" sortBy="#{category.mileage}"
+ sortOrder="#{sortingBean.mileageDirection}" selfSorted="false">
+ <f:facet name="header">
+ <h:outputText styleClass="headerText" value="Mileage" />
+ </f:facet>
<h:outputText value="#{category.mileage}" />
</rich:column>
<rich:column width="200px" id="vin">
- <f:facet name="header"><h:outputText styleClass="headerText" value="VIN" /></f:facet>
+ <f:facet name="header">
+ <h:outputText styleClass="headerText" value="VIN" />
+ </f:facet>
<h:outputText value="#{category.vin}" />
</rich:column>
<rich:column id="stock">
- <f:facet name="header"><h:outputText styleClass="headerText" value="Stock" /></f:facet>
+ <f:facet name="header">
+ <h:outputText styleClass="headerText" value="Stock" />
+ </f:facet>
<h:outputText value="#{category.stock}" />
</rich:column>
+ <f:facet name="footer">
+ <rich:datascroller />
+ </f:facet>
</rich:dataTable>
- <h:form>
- <rich:panel>
- <f:facet name="header">
- <h:outputText value="Specify Sorting Conditions:"/>
- </f:facet>
- <h:panelGrid columns="2">
- <h:outputText value="First Sort Property"/>
- <h:selectOneMenu value="#{sortingBean.firstSortOption}">
- <f:selectItems value="#{sortingBean.sortByItems}"/>
- </h:selectOneMenu>
- <h:outputText value="Second Sort Property"/>
- <h:selectOneMenu value="#{sortingBean.secondSortOption}">
- <f:selectItems value="#{sortingBean.sortByItems}"/>
- </h:selectOneMenu>
- <h:outputText value="Third Sort Property"/>
- <h:selectOneMenu value="#{sortingBean.thirdSortOption}">
- <f:selectItems value="#{sortingBean.sortByItems}"/>
- </h:selectOneMenu>
- <h:outputText value="Fourth Sort Property"/>
- <h:selectOneMenu value="#{sortingBean.fourthSortOption}">
- <f:selectItems value="#{sortingBean.sortByItems}"/>
- </h:selectOneMenu>
+ </h:form>
+ <h:form>
+ <rich:panel id="sortPanel">
+ <f:facet name="header">
+ <h:outputText value="Specify Sorting Conditions:" />
+ </f:facet>
+ <h:panelGrid columns="1">
+ <a4j:outputPanel>
+ <h:panelGrid columns="3" width="300px"
+ columnClasses="equals,equals,equals">
+ <h:outputText value="First sort by:" />
+ <h:selectOneMenu value="#{sortingBean.firstSortOption.item}"
+ valueChangeListener="#{sortingBean.firstSortOptionValueChanged}">
+ <a4j:support event="onchange" reRender="sortPanel"
+ ajaxSingle="true" />
+ <f:selectItems value="#{sortingBean.firstSortItems}" />
+ </h:selectOneMenu>
+ <h:selectOneMenu value="#{sortingBean.firstSortOption.direction}">
+ <a4j:support event="onchange" reRender="sortPanel" />
+ <f:selectItems value="#{sortingBean.sortDirectionItems}" />
+ </h:selectOneMenu>
+ </h:panelGrid>
+ </a4j:outputPanel>
+
+ <a4j:outputPanel
+ rendered="#{(!(sortingBean.firstSortOption.item == 0))and(!(sortingBean.firstSortOption.direction == 'UNSORTED'))}">
+ <h:panelGrid columns="3" width="300px"
+ columnClasses="equals,equals,equals">
+ <h:outputText value="Second sort by:" />
+ <h:selectOneMenu value="#{sortingBean.secondSortOption.item}"
+ valueChangeListener="#{sortingBean.secondSortOptionValueChanged}">
+ <a4j:support event="onchange" reRender="sortPanel"
+ ajaxSingle="true" />
+ <f:selectItems value="#{sortingBean.secondSortItems}" />
+ </h:selectOneMenu>
+ <h:selectOneMenu
+ value="#{sortingBean.secondSortOption.direction}">
+ <a4j:support event="onchange" reRender="sortPanel" />
+ <f:selectItems value="#{sortingBean.sortDirectionItems}" />
+ </h:selectOneMenu>
+ </h:panelGrid>
+ </a4j:outputPanel>
+
+ <a4j:outputPanel
+ rendered="#{(!(sortingBean.secondSortOption.item == 0))and(!(sortingBean.firstSortOption.item == 0))and(!(sortingBean.secondSortOption.direction == 'UNSORTED'))}">
+ <h:panelGrid columns="3" width="300px"
+ columnClasses="equals,equals,equals">
+ <h:outputText value="Third sort by:" />
+ <h:selectOneMenu value="#{sortingBean.thirdSortOption.item}"
+ valueChangeListener="#{sortingBean.thirdSortOptionValueChanged}">
+ <a4j:support event="onchange" reRender="sortPanel"
+ ajaxSingle="true" />
+ <f:selectItems value="#{sortingBean.thirdSortItems}" />
+ </h:selectOneMenu>
+ <h:selectOneMenu value="#{sortingBean.thirdSortOption.direction}">
+ <a4j:support event="onchange" reRender="sortPanel" />
+ <f:selectItems value="#{sortingBean.sortDirectionItems}" />
+ </h:selectOneMenu>
+ </h:panelGrid>
+ </a4j:outputPanel>
</h:panelGrid>
- <a4j:commandButton value="Sort Table" reRender="table" action="#{sortingBean.changeSorting}"/>
- </rich:panel>
- </h:form>
- </h:panelGrid>
+ <a4j:commandButton value="Sort Table"
+ action="#{sortingBean.sortTable}" reRender="table"
+ disabled="#{sortingBean.firstSortOption.direction=='UNSORTED'}" />
+ </rich:panel>
+ </h:form>
+ </h:panelGrid>
</ui:composition>
\ No newline at end of file
16 years, 10 months