JBoss Rich Faces SVN: r11813 - trunk/ui/message/src/main/config/component.
by richfaces-svn-commits@lists.jboss.org
Author: smukhina
Date: 2008-12-16 09:25:20 -0500 (Tue, 16 Dec 2008)
New Revision: 11813
Modified:
trunk/ui/message/src/main/config/component/message.xml
Log:
https://jira.jboss.org/jira/browse/RF-5282
showdetail is corrected
Modified: trunk/ui/message/src/main/config/component/message.xml
===================================================================
--- trunk/ui/message/src/main/config/component/message.xml 2008-12-16 14:16:06 UTC (rev 11812)
+++ trunk/ui/message/src/main/config/component/message.xml 2008-12-16 14:25:20 UTC (rev 11813)
@@ -68,18 +68,18 @@
<property>
<name>showDetail</name>
<classname>boolean</classname>
- <defaultvalue>false</defaultvalue>
+ <defaultvalue>true</defaultvalue>
<description>
- Flag indicating whether the summary portion of displayed messages should be included. Default value is "false".
+ Flag indicating whether detailed information of a displayed messages should be included. Default value is "true".
</description>
</property>
<property>
<name>showSummary</name>
<classname>boolean</classname>
- <defaultvalue>true</defaultvalue>
+ <defaultvalue>false</defaultvalue>
<description>
- Flag indicating whether the summary portion of displayed messages should be included. Default value is "true".
+ Flag indicating whether the summary portion of displayed messages should be included. Default value is "false".
</description>
</property>
@@ -347,7 +347,7 @@
<classname>boolean</classname>
<defaultvalue>false</defaultvalue>
<description>
- Flag indicating whether the summary portion of displayed messages should be included. Default value is "false"
+ Flag indicating whether the detailed information of displayed messages should be included. Default value is "false"
</description>
</property>
17 years, 7 months
JBoss Rich Faces SVN: r11812 - management/design/message/funcspec.
by richfaces-svn-commits@lists.jboss.org
Author: smukhina
Date: 2008-12-16 09:16:06 -0500 (Tue, 16 Dec 2008)
New Revision: 11812
Modified:
management/design/message/funcspec/FuncSpec - RF Message Component.doc
management/design/message/funcspec/FuncSpec - RF Messages Component.doc
Log:
https://jira.jboss.org/jira/browse/RF-5282
description of showsummary and showdetail is corrected
Modified: management/design/message/funcspec/FuncSpec - RF Message Component.doc
===================================================================
(Binary files differ)
Modified: management/design/message/funcspec/FuncSpec - RF Messages Component.doc
===================================================================
(Binary files differ)
17 years, 7 months
JBoss Rich Faces SVN: r11811 - in trunk/samples/richfaces-demo/src/main/webapp: richfaces/queue and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: ilya_shaikovsky
Date: 2008-12-16 08:56:27 -0500 (Tue, 16 Dec 2008)
New Revision: 11811
Added:
trunk/samples/richfaces-demo/src/main/webapp/images/cn_Editor.gif
trunk/samples/richfaces-demo/src/main/webapp/images/cn_Queue.gif
trunk/samples/richfaces-demo/src/main/webapp/images/ico_Editor.gif
Modified:
trunk/samples/richfaces-demo/src/main/webapp/richfaces/queue/customization.xhtml
Log:
Added: trunk/samples/richfaces-demo/src/main/webapp/images/cn_Editor.gif
===================================================================
(Binary files differ)
Property changes on: trunk/samples/richfaces-demo/src/main/webapp/images/cn_Editor.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/samples/richfaces-demo/src/main/webapp/images/cn_Queue.gif
===================================================================
(Binary files differ)
Property changes on: trunk/samples/richfaces-demo/src/main/webapp/images/cn_Queue.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/samples/richfaces-demo/src/main/webapp/images/ico_Editor.gif
===================================================================
(Binary files differ)
Property changes on: trunk/samples/richfaces-demo/src/main/webapp/images/ico_Editor.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Modified: trunk/samples/richfaces-demo/src/main/webapp/richfaces/queue/customization.xhtml
===================================================================
--- trunk/samples/richfaces-demo/src/main/webapp/richfaces/queue/customization.xhtml 2008-12-16 13:53:24 UTC (rev 11810)
+++ trunk/samples/richfaces-demo/src/main/webapp/richfaces/queue/customization.xhtml 2008-12-16 13:56:27 UTC (rev 11811)
@@ -88,6 +88,10 @@
to all the requests from the particular queue.
</li>
</ul>
+ <p>
+ Full attributes table and usage ways you could explore at our
+ queue documentation.
+ </p>
<p><i>
Also pay your attention to the queue definition. As it mentioned in
17 years, 7 months
JBoss Rich Faces SVN: r11810 - in trunk/samples/richfaces-demo/src/main: resources/org/richfaces/demo/common and 4 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: ilya_shaikovsky
Date: 2008-12-16 08:53:24 -0500 (Tue, 16 Dec 2008)
New Revision: 11810
Modified:
trunk/samples/richfaces-demo/src/main/java/org/richfaces/demo/queue/QueueBean.java
trunk/samples/richfaces-demo/src/main/resources/org/richfaces/demo/common/components.properties
trunk/samples/richfaces-demo/src/main/webapp/WEB-INF/faces-config.xml
trunk/samples/richfaces-demo/src/main/webapp/richfaces/queue/customization.xhtml
trunk/samples/richfaces-demo/src/main/webapp/richfaces/queue/examples/queue.xhtml
trunk/samples/richfaces-demo/src/main/webapp/richfaces/queue/examples/repeater.xhtml
trunk/samples/richfaces-demo/src/main/webapp/scripts/queueUi.js
Log:
Modified: trunk/samples/richfaces-demo/src/main/java/org/richfaces/demo/queue/QueueBean.java
===================================================================
--- trunk/samples/richfaces-demo/src/main/java/org/richfaces/demo/queue/QueueBean.java 2008-12-16 13:41:37 UTC (rev 11809)
+++ trunk/samples/richfaces-demo/src/main/java/org/richfaces/demo/queue/QueueBean.java 2008-12-16 13:53:24 UTC (rev 11810)
@@ -2,14 +2,9 @@
import java.util.ArrayList;
import java.util.List;
-import java.util.Map;
-import javax.faces.context.ExternalContext;
-import javax.faces.context.FacesContext;
import javax.faces.model.SelectItem;
-import org.ajax4jsf.event.AjaxEvent;
-
public class QueueBean {
public int requestDelay = 500;
public boolean ignoreDupResponces = false;
@@ -19,7 +14,6 @@
public String text="";
public int requests=0;
public int events=0;
- private static final String AJAX_REQUESTS_COUNT_ATTRIBUTE = "ajaxRequestsCount";
public List<SelectItem> strategies = new ArrayList<SelectItem>();
@@ -35,21 +29,13 @@
}
public void waitDelay() throws InterruptedException {
- System.out.println("QueueBean.waitDelay()");
Thread.sleep(1000);
}
- public void processAjax(AjaxEvent event) {
- ExternalContext externalContext = FacesContext.getCurrentInstance().getExternalContext();
- Map<String, Object> sessionMap = externalContext.getSessionMap();
- Long count = (Long) sessionMap.get(AJAX_REQUESTS_COUNT_ATTRIBUTE);
- if (count == null) {
- count = Long.valueOf(0);
- }
- sessionMap.put(AJAX_REQUESTS_COUNT_ATTRIBUTE, ++count);
+ public void resetText() {
+ setText("");
}
-
public int getRequestDelay() {
return requestDelay;
}
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-12-16 13:41:37 UTC (rev 11809)
+++ trunk/samples/richfaces-demo/src/main/resources/org/richfaces/demo/common/components.properties 2008-12-16 13:53:24 UTC (rev 11810)
@@ -90,4 +90,4 @@
stateAPI=richMisc, \t State Manager API, \t\t/images/ico_StateManagerAPI.gif, \t\t/images/cn_StateManagerAPI.gif, ArchitectureOverview.html\#statemanagerapi, jbossrichfaces/freezone/docs/tlddoc/rich/graphValidator.html, jbossrichfaces/freezone/docs/apidoc/org/richfaces/component/UIhotkey.html, \t\t\t\t\t/richfaces/stateAPI.jsf
extendedDataTable= richDataIterators, Extended Data Table, /images/ico_ExtendedDataTable.gif, /images/cn_ExtendedDataTable.gif, extendedDataTable.html, jbossrichfaces/freezone/docs/tlddoc/rich/dataTable.html, jbossrichfaces/freezone/docs/apidoc/org/richfaces/component/UIDataTable.html, /richfaces/extendedDataTable.jsf
editor= richInputs, Editor, /images/ico_Editor.gif, /images/cn_Editor.gif, editor.html, jbossrichfaces/freezone/docs/tlddoc/rich/editor.html, jbossrichfaces/freezone/docs/apidoc/org/richfaces/component/UIEditor.html, /richfaces/editor.jsf
-queue= ajaxSupport, Queue, /images/ico_Queue.gif, /images/cn_Queue.gif, Queue.html, jbossrichfaces/freezone/docs/tlddoc/rich/queue.html, jbossrichfaces/freezone/docs/apidoc/org/richfaces/component/UIQueue.html, /richfaces/queue.jsf
+queue= ajaxSupport, Queue, /images/ico_common.gif, /images/cn_Queue.gif, Queue.html, jbossrichfaces/freezone/docs/tlddoc/rich/queue.html, jbossrichfaces/freezone/docs/apidoc/org/richfaces/component/UIQueue.html, /richfaces/queue.jsf
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-12-16 13:41:37 UTC (rev 11809)
+++ trunk/samples/richfaces-demo/src/main/webapp/WEB-INF/faces-config.xml 2008-12-16 13:53:24 UTC (rev 11810)
@@ -481,6 +481,14 @@
<to-view-id>/richfaces/stateAPI/examples/simple.xhtml</to-view-id>
</navigation-case>
</navigation-rule>
+ <navigation-rule>
+ <display-name>ajaxOptimization</display-name>
+ <from-view-id>/richfaces/queue.xhtml</from-view-id>
+ <navigation-case>
+ <from-outcome>ajaxOptimization</from-outcome>
+ <to-view-id>/richfaces/ajaxAttributes.xhtml</to-view-id>
+ </navigation-case>
+ </navigation-rule>
<application>
<navigation-handler>org.richfaces.ui.application.StateNavigationHandler</navigation-handler>
<el-resolver>org.richfaces.el.StateELResolver</el-resolver>
Modified: trunk/samples/richfaces-demo/src/main/webapp/richfaces/queue/customization.xhtml
===================================================================
--- trunk/samples/richfaces-demo/src/main/webapp/richfaces/queue/customization.xhtml 2008-12-16 13:41:37 UTC (rev 11809)
+++ trunk/samples/richfaces-demo/src/main/webapp/richfaces/queue/customization.xhtml 2008-12-16 13:53:24 UTC (rev 11810)
@@ -8,8 +8,35 @@
<ui:composition template="/templates/component-sample.xhtml">
<ui:define name="sample">
<p>
- Description
+ There you could explore <b>optimization </b>parameters of the <b>queue
+ </b>and learn how them influence the <b>Ajax requests</b>. This example
+ is a good start to learn about Ajax requests flood protection.
</p>
+
+ <p>
+ Pay attention to some points in the example:
+ </p>
+ <ul>
+ <li>
+ Setting ignoreDupResponces to true - will reduce the count of DOM updates on typing inside input.
+ (in initial state - count of updates will be equals to count of requests)
+ </li>
+ <li>
+ Disabling the queue will causes fully asynchronous updates. Note
+ that updates could appears not in the right order and you could get
+ wrong string in the result.
+ </li>
+ <li>
+ Setting request delay to greater value will reduce the requests count
+ on fast typing. (More similar requests will be combined in the result)
+ </li>
+ </ul>
+ <p><i>
+
+ Also pay your attention to the queue definition. As it mentioned in
+ our documentation such definition (inside some form without name)
+ means that the queue becomes global for the form.
+ </i></p>
<fieldset class="demo_fieldset">
<legend class="demo_legend">Queue demo</legend>
<div class="sample-container">
@@ -18,8 +45,64 @@
<ui:param name="sourcepath" value="/richfaces/queue/examples/repeater.xhtml"/>
<ui:param name="openlabel" value="View Source" />
</ui:include>
+ <ui:include src="/templates/include/sourceview.xhtml">
+ <ui:param name="sourcepath" value="/WEB-INF/src/org/richfaces/demo/queue/QueueBean.java"/>
+ <ui:param name="openlabel" value="View QueueBean.java code" />
+ <ui:param name="sourcetype" value="java" />
+ </ui:include>
</div>
</fieldset>
+ <h:form>
+ <p>
+ <b>Queue</b> provides subset of common <b>Ajax requests optimization attributes</b>
+ (<i>requestDelay, ignoreDupResponse and timeout</i>)
+ which you could explore at <h:commandLink value="Queue and Traffic Flood Protection" immediate="true" action="ajaxOptimization"/> section.
+ These attributes defined within the queue will be used for all the request
+ in case concrete components do not override them.
+ </p>
+ </h:form>
+ <p>The queue component also provides some additional attributes in order to
+ control queue itself:
+ </p>
+ <ul>
+ <li>
+ <b>name</b> attribute which defines name for the queue.
+ </li>
+ <li>
+ <b>disabled</b> - attribute which allows to disable the queue.
+ Could be used in order to disable the global queue for particular
+ views or in order to switch between same named queues with different
+ parameters.
+ </li>
+ <li>
+ <b>size</b> - Defines the count of requests which could be queued
+ at the moment. -1 value means that queue has no size limit.
+ </li>
+ <li>
+ <b>sizeExceededBehavior</b> - defines the behavior for the queue
+ if size already exceeded and new request tried to be added to
+ the queue. (dropNew, dropNext, fireNew, fireNext values allowed)
+ </li>
+ <li>
+ <b>status</b> - attribute which allows to point status component
+ to all the requests from the particular queue.
+ </li>
+ </ul>
+ <p><i>
+
+ Also pay your attention to the queue definition. As it mentioned in
+ our documentation such definition (inside some form without name)
+ means that the queue becomes global for the form.
+ </i></p>
+ <p class="note">
+ <i><b>Note:</b></i> queue component could get its parameters from
+ EL bindings. But the component isn't designed to be updated via
+ ajax requests. (There are no useful cases where the developers
+ need to change the timeouts or request delays on the fly). So
+ as you could see the example below uses <b>h:commandButton</b> in order to
+ reebuild all the view and reinitialize the queue with new parameter
+ values.
+ </p>
</ui:define>
</ui:composition>
Modified: trunk/samples/richfaces-demo/src/main/webapp/richfaces/queue/examples/queue.xhtml
===================================================================
--- trunk/samples/richfaces-demo/src/main/webapp/richfaces/queue/examples/queue.xhtml 2008-12-16 13:41:37 UTC (rev 11809)
+++ trunk/samples/richfaces-demo/src/main/webapp/richfaces/queue/examples/queue.xhtml 2008-12-16 13:53:24 UTC (rev 11810)
@@ -10,7 +10,7 @@
<h:form id="form1" prependId="false">
<a4j:queue requestDelay="1000" ignoreDupResponce="true"/>
- <h:panelGrid columns="2" cellspacing="5">
+ <h:panelGrid columns="1" cellspacing="5">
<h:panelGrid id="board1" columns="6" border="1">
<f:facet name="header">
<h:outputText value="Ajax Requests" styleClass="keytitle" />
Modified: trunk/samples/richfaces-demo/src/main/webapp/richfaces/queue/examples/repeater.xhtml
===================================================================
--- trunk/samples/richfaces-demo/src/main/webapp/richfaces/queue/examples/repeater.xhtml 2008-12-16 13:41:37 UTC (rev 11809)
+++ trunk/samples/richfaces-demo/src/main/webapp/richfaces/queue/examples/repeater.xhtml 2008-12-16 13:53:24 UTC (rev 11810)
@@ -15,7 +15,7 @@
<h:panelGrid columns="2">
<h:outputText value="Type here:" />
<h:inputText id="myinput" value="#{queueBean.text}">
- <a4j:support event="onkeyup" reRender="outtext,reqs"
+ <a4j:support event="onkeyup" reRender="outtext"
onsubmit="addEvent();" ajaxSingle="true"
oncomplete="printCounts()"
onbeforedomupdate="addUpdate()" action="#{queueBean.waitDelay}"/>
@@ -54,15 +54,11 @@
<h:outputText value="Disable Queue" />
<h:selectBooleanCheckbox value="#{queueBean.disabled}" />
<f:facet name="footer">
- <h:panelGroup>
- <h:commandButton value="Apply"/>
- <h:commandButton value="Reset"/>
- </h:panelGroup>
+ <h:commandButton value="Apply" action="#{queueBean.resetText}"/>
</f:facet>
</h:panelGrid>
</rich:panel>
</h:panelGrid>
- <a4j:log popup="false" style="width:800px; height:400px; overflow:auto;"/>
</h:form>
<script type="text/javascript">
var events=0;
Modified: trunk/samples/richfaces-demo/src/main/webapp/scripts/queueUi.js
===================================================================
--- trunk/samples/richfaces-demo/src/main/webapp/scripts/queueUi.js 2008-12-16 13:41:37 UTC (rev 11809)
+++ trunk/samples/richfaces-demo/src/main/webapp/scripts/queueUi.js 2008-12-16 13:53:24 UTC (rev 11810)
@@ -41,19 +41,27 @@
function removeCell(cellData) {
var row = document.getElementById("tr1");
var cells = row.getElementsByTagName("td");
+ var deletedCellIndex=-1;
if (cells.length==1) {
lastButtonActivated=undefined;
lastButtonCounter=undefined;
}
if (typeof cells != 'undefined' || cells != null) {
- for (var i=0; i<cells.length; i++) {
+ for (var i=cells.length-1; i>=0; i--) {
if (cells[i].firstChild.nodeValue.indexOf(cellData.nodeValue)==0) {
- row.deleteCell(i);
+ if (deletedCellIndex==-1){
+ deletedCellIndex=i;
+ row.deleteCell(i);
+ }else{
+ deletedCellIndex=-1;
+ break;
+ }
+ }
+ }
+ if (deletedCellIndex!=-1){
var button = document.getElementById(cellData.nodeValue);
button.value = 'submit';
button.src = enabledImage;
- break;
- }
}
}
}
17 years, 7 months
JBoss Rich Faces SVN: r11809 - in trunk/test-applications/seleniumTest/richfaces/src: main/webapp/pages/calendar and 1 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: dsvyatobatsko
Date: 2008-12-16 08:41:37 -0500 (Tue, 16 Dec 2008)
New Revision: 11809
Modified:
trunk/test-applications/seleniumTest/richfaces/src/main/java/org/ajax4jsf/bean/CalendarTestBean.java
trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/calendar/showAttributesTest.xhtml
trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/CalendarTest.java
Log:
https://jira.jboss.org/jira/browse/RF-5352
Modified: trunk/test-applications/seleniumTest/richfaces/src/main/java/org/ajax4jsf/bean/CalendarTestBean.java
===================================================================
--- trunk/test-applications/seleniumTest/richfaces/src/main/java/org/ajax4jsf/bean/CalendarTestBean.java 2008-12-16 13:30:13 UTC (rev 11808)
+++ trunk/test-applications/seleniumTest/richfaces/src/main/java/org/ajax4jsf/bean/CalendarTestBean.java 2008-12-16 13:41:37 UTC (rev 11809)
@@ -234,6 +234,7 @@
required = false;
enableManualInput = false;
NULLModel = false;
+ firstWeekDay = 0;
}
public String resetAction() {
@@ -452,6 +453,7 @@
showInput = true;
showWeekDaysBar = true;
showWeeksBar = true;
+ firstWeekDay = 0;
}
private String todayControlMode = "select";
@@ -532,4 +534,22 @@
this.enableManualInput = enableManualInput;
}
+ private int firstWeekDay = 0;
+
+ /**
+ * Gets value of firstWeekDay field.
+ * @return value of firstWeekDay field
+ */
+ public int getFirstWeekDay() {
+ return firstWeekDay;
+ }
+
+ /**
+ * Set a new value for firstWeekDay field.
+ * @param firstWeekDay a new value for firstWeekDay field
+ */
+ public void setFirstWeekDay(int firstWeekDay) {
+ this.firstWeekDay = firstWeekDay;
+ }
+
}
Modified: trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/calendar/showAttributesTest.xhtml
===================================================================
(Binary files differ)
Modified: trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/CalendarTest.java
===================================================================
--- trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/CalendarTest.java 2008-12-16 13:30:13 UTC (rev 11808)
+++ trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/CalendarTest.java 2008-12-16 13:41:37 UTC (rev 11809)
@@ -166,6 +166,8 @@
String calendarMessageId;
+ String firstWeekDayId;
+
void initIds(String parentId) {
calendarId = parentId + FORM_ID + "calendar";
calendarHeaderId = calendarId + "Header";
@@ -207,6 +209,7 @@
applyButtonXpath = "//td[@id='" + calendarFooterId + "']/table/tbody/tr/td[6]";
cleanButtonXPath = "//td[@id='"+calendarFooterId+"']/table/tbody/tr/td[2]";
calendarMessageId = parentId + FORM_ID + "calendarMsg";
+ firstWeekDayId =parentId + FORM_ID + "firstWeekDay";
}
String getStatus() {
@@ -1146,6 +1149,34 @@
}
@Test
+ public void testFirstWeekDay(Template template) {
+ renderPage(SHOW_ATTRIBURES_TEST_URL, template, INIT_SHOW_ATTRIBUTES_TEST);
+ initIds(getParentId());
+
+ String firstWeekDayCellId = calendarId + "WeekDayCell0";
+ Locale locale = new Locale(selenium.getText(getParentId() + FORM_ID + "locale"));
+ DateFormatSymbols symbols = new DateFormatSymbols(locale);
+ Calendar cal = Calendar.getInstance(locale);
+
+ writeStatus("Check 'firstWeekDay' attribute");
+ writeStatus("Set first firstWeekDay to 5 day. 'FirstWeekDay' ranges from 0 to 6 for instance it is Friday in USA and Saturday (samedi) in France");
+ selenium.type(firstWeekDayId, "5");
+
+ int weekday = Integer.parseInt(selenium.getValue(firstWeekDayId));
+ String weekDayShortName = symbols.getShortWeekdays()[weekday + cal.getFirstDayOfWeek()];
+
+ writeStatus("Non-popup mode");
+ check(showPopupId, false);
+ AssertTextEquals(firstWeekDayCellId, weekDayShortName, "It looks as if 'firstWeekDay' attribute doesn't work");
+
+ writeStatus("Popup mode");
+ check(showPopupId, true);
+ showPopup();
+
+ AssertTextEquals(firstWeekDayCellId, weekDayShortName, "It looks as if 'firstWeekDay' attribute doesn't work");
+ }
+
+ @Test
public void testTodayControlMode(Template template) {
renderPage(TODAY_CONTROL_MODE_URL, template, null);
initIds(getParentId());
17 years, 7 months
JBoss Rich Faces SVN: r11808 - trunk/ui/scrollableDataTable/src/main/config/component.
by richfaces-svn-commits@lists.jboss.org
Author: konstantin.mishin
Date: 2008-12-16 08:30:13 -0500 (Tue, 16 Dec 2008)
New Revision: 11808
Modified:
trunk/ui/scrollableDataTable/src/main/config/component/scrollable-data-table.xml
Log:
RF-4515
Modified: trunk/ui/scrollableDataTable/src/main/config/component/scrollable-data-table.xml
===================================================================
--- trunk/ui/scrollableDataTable/src/main/config/component/scrollable-data-table.xml 2008-12-16 13:28:07 UTC (rev 11807)
+++ trunk/ui/scrollableDataTable/src/main/config/component/scrollable-data-table.xml 2008-12-16 13:30:13 UTC (rev 11808)
@@ -292,6 +292,10 @@
id of the element to set focus after request completed on client side
</description>
</property>
+
+ <property hidden="true">
+ <name>process</name>
+ </property>
</component>
<renderer generate="true">
17 years, 7 months
JBoss Rich Faces SVN: r11807 - in trunk: framework/api/src/main/java/org/richfaces/model and 3 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: konstantin.mishin
Date: 2008-12-16 08:28:07 -0500 (Tue, 16 Dec 2008)
New Revision: 11807
Modified:
trunk/framework/api/src/main/java/org/ajax4jsf/model/SequenceRange.java
trunk/framework/api/src/main/java/org/richfaces/model/ScrollableTableDataModel.java
trunk/framework/api/src/main/java/org/richfaces/model/ScrollableTableDataRange.java
trunk/ui/scrollableDataTable/src/main/java/org/richfaces/component/UIScrollableDataTable.java
trunk/ui/scrollableDataTable/src/main/java/org/richfaces/convert/rowkey/ScrollableDataTableRowKeyConverter.java
trunk/ui/scrollableDataTable/src/test/java/org/richfaces/component/AbstractScrollableDataTableTestCase.java
Log:
RF-2644
Modified: trunk/framework/api/src/main/java/org/ajax4jsf/model/SequenceRange.java
===================================================================
--- trunk/framework/api/src/main/java/org/ajax4jsf/model/SequenceRange.java 2008-12-16 13:25:24 UTC (rev 11806)
+++ trunk/framework/api/src/main/java/org/ajax4jsf/model/SequenceRange.java 2008-12-16 13:28:07 UTC (rev 11807)
@@ -55,4 +55,12 @@
this.rows = rows;
}
+ protected void setFirstRow(int firstRow) {
+ this.firstRow = firstRow;
+ }
+
+ protected void setRows(int rows) {
+ this.rows = rows;
+ }
+
}
Modified: trunk/framework/api/src/main/java/org/richfaces/model/ScrollableTableDataModel.java
===================================================================
--- trunk/framework/api/src/main/java/org/richfaces/model/ScrollableTableDataModel.java 2008-12-16 13:25:24 UTC (rev 11806)
+++ trunk/framework/api/src/main/java/org/richfaces/model/ScrollableTableDataModel.java 2008-12-16 13:28:07 UTC (rev 11807)
@@ -54,6 +54,8 @@
public static class SimpleRowKey extends Number implements Serializable{
private static final long serialVersionUID = 1L;
+
+ public static final String PREFIX = "srk";
private int i;
public SimpleRowKey(int i) {
@@ -66,7 +68,7 @@
}
public String toString() {
- return String.valueOf(i);
+ return PREFIX + String.valueOf(i);
}
public int hashCode() {
Modified: trunk/framework/api/src/main/java/org/richfaces/model/ScrollableTableDataRange.java
===================================================================
--- trunk/framework/api/src/main/java/org/richfaces/model/ScrollableTableDataRange.java 2008-12-16 13:25:24 UTC (rev 11806)
+++ trunk/framework/api/src/main/java/org/richfaces/model/ScrollableTableDataRange.java 2008-12-16 13:28:07 UTC (rev 11807)
@@ -12,25 +12,21 @@
import java.io.Serializable;
-import org.ajax4jsf.model.Range;
+import org.ajax4jsf.model.SequenceRange;
/**
* Iteration range for Scrollable Grid
* @author Maksim Kaszynski
* @modified by Anton Belevich
*/
-public class ScrollableTableDataRange implements Range, Serializable{
+public class ScrollableTableDataRange extends SequenceRange implements Serializable{
private static final long serialVersionUID = -6675002421400464892L;
- private int first = 0;
- private int last = 0;
private SortOrder sortOrder;
public ScrollableTableDataRange(int first, int last, SortOrder sortOrder) {
- super();
- this.first = first;
- this.last = last;
+ super(first, last > 0 ? last - first : -1);
this.sortOrder = sortOrder;
}
@@ -38,25 +34,25 @@
* @return the bufferSize
*/
public int getLast() {
- return last;
+ return getFirstRow() + getRows();
}
/**
* @param bufferSize the bufferSize to set
*/
public void setLast(int lastRow) {
- this.last = lastRow;
+ setRows(lastRow > 0 ? lastRow - getFirstRow() : -1);
}
/**
* @return the first
*/
public int getFirst() {
- return first;
+ return getFirstRow();
}
/**
* @param first the first to set
*/
public void setFirst(int first) {
- this.first = first;
+ setFirstRow(first);
}
public SortOrder getSortOrder() {
@@ -66,27 +62,36 @@
public void setSortOrder(SortOrder sortOrder) {
this.sortOrder = sortOrder;
}
-
+
+ @Override
+ public int hashCode() {
+ final int prime = 31;
+ int result = 1;
+ result = prime * result + getFirstRow();
+ result = prime * result + getRows();
+ result = prime * result
+ + ((sortOrder == null) ? 0 : sortOrder.hashCode());
+ return result;
+ }
+
+ @Override
public boolean equals(Object obj) {
-
- if(!(obj instanceof ScrollableTableDataRange)){
- return super.equals(obj);
- }
-
- ScrollableTableDataRange ref = (ScrollableTableDataRange)obj;
-
- boolean ret = (this.first == ref.first)&&(this.last == ref.last );
-
- if(this.sortOrder != null){
- ret = ret && this.sortOrder.equals(ref.sortOrder);
- } else {
- ret = (ret && (ref.sortOrder == null));
- }
-
- return ret;
+ if (this == obj)
+ return true;
+ if (obj == null)
+ return false;
+ if (getClass() != obj.getClass())
+ return false;
+ ScrollableTableDataRange other = (ScrollableTableDataRange) obj;
+ if (getFirstRow() != other.getFirstRow())
+ return false;
+ if (getRows() != other.getRows())
+ return false;
+ if (sortOrder == null) {
+ if (other.sortOrder != null)
+ return false;
+ } else if (!sortOrder.equals(other.sortOrder))
+ return false;
+ return true;
}
-
- public int hashCode() {
- return super.hashCode();
- }
}
Modified: trunk/ui/scrollableDataTable/src/main/java/org/richfaces/component/UIScrollableDataTable.java
===================================================================
--- trunk/ui/scrollableDataTable/src/main/java/org/richfaces/component/UIScrollableDataTable.java 2008-12-16 13:25:24 UTC (rev 11806)
+++ trunk/ui/scrollableDataTable/src/main/java/org/richfaces/component/UIScrollableDataTable.java 2008-12-16 13:28:07 UTC (rev 11807)
@@ -24,10 +24,15 @@
import java.util.ArrayList;
import java.util.Collection;
import java.util.Iterator;
+import java.util.LinkedList;
import java.util.List;
+import javax.el.ELContext;
+import javax.el.ExpressionFactory;
+import javax.el.ValueExpression;
import javax.faces.component.UIColumn;
import javax.faces.component.UIComponent;
+import javax.faces.component.UIViewRoot;
import javax.faces.context.FacesContext;
import javax.faces.convert.Converter;
import javax.faces.event.AbortProcessingException;
@@ -35,13 +40,14 @@
import javax.faces.event.PhaseId;
import org.ajax4jsf.component.AjaxComponent;
-import org.ajax4jsf.component.UIDataAdaptor;
+import org.ajax4jsf.component.SequenceDataAdaptor;
import org.ajax4jsf.context.AjaxContext;
import org.ajax4jsf.event.AjaxEvent;
import org.ajax4jsf.model.DataComponentState;
import org.ajax4jsf.model.DataVisitor;
import org.ajax4jsf.model.ExtendedDataModel;
import org.ajax4jsf.model.Range;
+import org.ajax4jsf.util.ELUtils;
import org.apache.commons.collections.iterators.IteratorChain;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
@@ -53,10 +59,14 @@
import org.richfaces.event.sort.SortEvent;
import org.richfaces.event.sort.SortListener;
import org.richfaces.model.DataModelCache;
+import org.richfaces.model.Modifiable;
+import org.richfaces.model.ModifiableModel;
+import org.richfaces.model.Ordering;
import org.richfaces.model.ScrollableTableDataModel;
import org.richfaces.model.ScrollableTableDataRange;
+import org.richfaces.model.SortField;
+import org.richfaces.model.SortField2;
import org.richfaces.model.SortOrder;
-import org.richfaces.model.internal.ComponentSortableDataModel;
import org.richfaces.renderkit.html.ScrollableDataTableUtils;
@@ -65,7 +75,7 @@
*
*/
-public abstract class UIScrollableDataTable extends UIDataAdaptor implements AjaxComponent, Sortable, Selectable, ScriptExportable{
+public abstract class UIScrollableDataTable extends SequenceDataAdaptor implements AjaxComponent, Sortable, Selectable, ScriptExportable{
public static final String COMPONENT_TYPE = "org.richfaces.component.ScrollableDataTable";
@@ -189,29 +199,29 @@
}
protected ExtendedDataModel createDataModel() {
-
- Object value = getValue();
-
- ScrollableTableDataModel<?> model = null;
-
- if (value instanceof ScrollableTableDataModel) {
-
- if (log.isDebugEnabled()) {
- log.debug("Found instanceof " + value.getClass() + " will use it unwrapped");
+ ExtendedDataModel model = super.createDataModel();
+ if (model instanceof ScrollableTableDataModel) {
+ if (isCacheable()) {
+ if (log.isDebugEnabled()) {
+ log.debug("Initializing cache of type "
+ + DataModelCache.class);
+ }
+ model = new DataModelCache((ScrollableTableDataModel<?>) model);
}
- model = (ScrollableTableDataModel<?>) value;
-
} else {
- model = new ComponentSortableDataModel(getVar(), value, this.getSortOrder());
- }
-
- if (isCacheable()) {
-
- if (log.isDebugEnabled()) {
- log.debug("Initializing cache of type " + DataModelCache.class);
+ List<SortField2> sortFields = getSortFields();
+ if (sortFields != null && !sortFields.isEmpty()) {
+ Modifiable modifiable = null;
+ if (model instanceof Modifiable) {
+ modifiable = (Modifiable) model;
+ } else {
+ ModifiableModel modifiableModel = new ModifiableModel(
+ model, getVar());
+ model = modifiableModel;
+ modifiable = modifiableModel;
+ }
+ modifiable.modify(null, sortFields);
}
-
- model = new DataModelCache(model);
}
/*
* TODO: Verify - do we really need it
@@ -220,7 +230,45 @@
return model;
}
-
+ private List<SortField2> getSortFields() {
+ FacesContext context = FacesContext.getCurrentInstance();
+ ELContext eLContext= context.getELContext();
+ ExpressionFactory expressionFactory = context.getApplication().getExpressionFactory();
+ String var = getVar();
+ SortOrder sortOrder = getSortOrder();
+ List<SortField2> sortFields2 = null;
+ if (sortOrder != null) {
+ SortField[] sortFields = sortOrder.getFields();
+ sortFields2 = new LinkedList<SortField2>();
+ for (SortField sortField : sortFields) {
+ ValueExpression valueExpression = null;
+ String name = sortField.getName();
+ if (ELUtils.isValueReference(name)) {
+ valueExpression = expressionFactory.createValueExpression(
+ eLContext, name, Object.class);
+ } else if (!name.startsWith(UIViewRoot.UNIQUE_ID_PREFIX)) {
+ valueExpression = expressionFactory.createValueExpression(
+ eLContext, "#{" + var + "." + name + "}",
+ Object.class);
+ }
+ Ordering ordering = Ordering.UNSORTED;
+ Boolean ascending = sortField.getAscending();
+ if (ascending != null) {
+ if (ascending) {
+ ordering = Ordering.ASCENDING;
+ } else {
+ ordering = Ordering.DESCENDING;
+ }
+ }
+ if (valueExpression != null
+ && !Ordering.UNSORTED.equals(ordering)) {
+ sortFields2.add(new SortField2(valueExpression, ordering));
+ }
+ }
+ }
+ return sortFields2;
+ }
+
public Object saveState(FacesContext context) {
Object values[] = new Object[4];
Modified: trunk/ui/scrollableDataTable/src/main/java/org/richfaces/convert/rowkey/ScrollableDataTableRowKeyConverter.java
===================================================================
--- trunk/ui/scrollableDataTable/src/main/java/org/richfaces/convert/rowkey/ScrollableDataTableRowKeyConverter.java 2008-12-16 13:25:24 UTC (rev 11806)
+++ trunk/ui/scrollableDataTable/src/main/java/org/richfaces/convert/rowkey/ScrollableDataTableRowKeyConverter.java 2008-12-16 13:28:07 UTC (rev 11807)
@@ -43,8 +43,12 @@
public Object getAsObject(FacesContext context, UIComponent component,
String value) {
try {
- int i = Integer.parseInt(value);
- return new SimpleRowKey(i);
+ String prefix = SimpleRowKey.PREFIX;
+ if (value != null && value.startsWith(prefix)) {
+ int i = Integer.parseInt(value.substring(prefix.length()));
+ return new SimpleRowKey(i);
+ }
+ return new Integer(value);
} catch(Exception e) {
throw new ConverterException("Unable to convert value " + value + "to " + SimpleRowKey.class, e);
}
@@ -55,9 +59,8 @@
*/
public String getAsString(FacesContext context, UIComponent component,
Object value) {
- if (value instanceof SimpleRowKey) {
- SimpleRowKey key = (SimpleRowKey) value;
- return key.toString();
+ if (value instanceof SimpleRowKey || value instanceof Integer) {
+ return value.toString();
}
throw new ConverterException("Value " + value + " is not supported by this converter");
}
Modified: trunk/ui/scrollableDataTable/src/test/java/org/richfaces/component/AbstractScrollableDataTableTestCase.java
===================================================================
--- trunk/ui/scrollableDataTable/src/test/java/org/richfaces/component/AbstractScrollableDataTableTestCase.java 2008-12-16 13:25:24 UTC (rev 11806)
+++ trunk/ui/scrollableDataTable/src/test/java/org/richfaces/component/AbstractScrollableDataTableTestCase.java 2008-12-16 13:28:07 UTC (rev 11807)
@@ -43,6 +43,7 @@
import org.richfaces.model.DataModelCache;
import org.richfaces.model.SortField;
import org.richfaces.model.SortOrder;
+import org.richfaces.model.impl.ListDataModel;
import org.richfaces.model.selection.Selection;
import org.richfaces.model.selection.SimpleSelection;
@@ -202,7 +203,7 @@
- List l = Collections.singletonList("aaaa");
+ ListDataModel l = new ListDataModel(Collections.singletonList("aaaa"));
table.setValue(l);
ExtendedDataModel model = table.createDataModel();
@@ -216,7 +217,7 @@
table.setValue(null);
model = table.createDataModel();
- assertTrue(model instanceof DataModelCache);
+ assertTrue(model instanceof ExtendedDataModel);
assertEquals(0, model.getRowCount());
17 years, 7 months
JBoss Rich Faces SVN: r11806 - trunk/docs/userguide/en/src/main/resources/images.
by richfaces-svn-commits@lists.jboss.org
Author: atsebro
Date: 2008-12-16 08:25:24 -0500 (Tue, 16 Dec 2008)
New Revision: 11806
Modified:
trunk/docs/userguide/en/src/main/resources/images/inputNumberSlider_init.png
Log:
RF-5287: describeInputNumberSlider 2 new features
Modified: trunk/docs/userguide/en/src/main/resources/images/inputNumberSlider_init.png
===================================================================
(Binary files differ)
17 years, 7 months
JBoss Rich Faces SVN: r11805 - trunk/ui/combobox/src/main/resources/org/richfaces/renderkit/html/scripts.
by richfaces-svn-commits@lists.jboss.org
Author: abelevich
Date: 2008-12-16 07:58:48 -0500 (Tue, 16 Dec 2008)
New Revision: 11805
Modified:
trunk/ui/combobox/src/main/resources/org/richfaces/renderkit/html/scripts/comboboxUtils.js
Log:
https://jira.jboss.org/jira/browse/RF-5398
Modified: trunk/ui/combobox/src/main/resources/org/richfaces/renderkit/html/scripts/comboboxUtils.js
===================================================================
--- trunk/ui/combobox/src/main/resources/org/richfaces/renderkit/html/scripts/comboboxUtils.js 2008-12-16 12:41:52 UTC (rev 11804)
+++ trunk/ui/combobox/src/main/resources/org/richfaces/renderkit/html/scripts/comboboxUtils.js 2008-12-16 12:58:48 UTC (rev 11805)
@@ -60,7 +60,15 @@
// older versions of IE
viewportheight = document.getElementsByTagName('body')[0].clientHeight;
}*/
- return (document.viewport.getDimensions().height + document.viewport.getScrollOffsets().top);
+
+ if( typeof document.documentElement != 'undefined' && typeof document.documentElement.clientWidth != 'undefined' && document.documentElement.clientWidth != 0 ) {
+ return document.viewport.getDimensions().height + document.viewport.getScrollOffsets().top;
+ } else {
+ var scrollOffsets = window.pageYOffset || document.documentElement.scrollTop || document.body.scrollTop || 0;
+ var innerHeight = self.innerHeight || document.documentElement.clientHeight || document.body.clientHeight || 0;
+ return innerHeight + scrollOffsets;
+ }
+
//return viewportheight;
}
17 years, 7 months
JBoss Rich Faces SVN: r11804 - trunk/ui/calendar/src/main/resources/org/richfaces/renderkit/html/scripts.
by richfaces-svn-commits@lists.jboss.org
Author: pyaschenko
Date: 2008-12-16 07:41:52 -0500 (Tue, 16 Dec 2008)
New Revision: 11804
Modified:
trunk/ui/calendar/src/main/resources/org/richfaces/renderkit/html/scripts/calendar.js
Log:
https://jira.jboss.org/jira/browse/RF-2835
Modified: trunk/ui/calendar/src/main/resources/org/richfaces/renderkit/html/scripts/calendar.js
===================================================================
--- trunk/ui/calendar/src/main/resources/org/richfaces/renderkit/html/scripts/calendar.js 2008-12-16 12:30:50 UTC (rev 11803)
+++ trunk/ui/calendar/src/main/resources/org/richfaces/renderkit/html/scripts/calendar.js 2008-12-16 12:41:52 UTC (rev 11804)
@@ -2096,11 +2096,11 @@
{
this.selectedDate = date;
this.renderHF();
- if (!this.params.popup) this.setInputField(this.getSelectedDateString(this.params.datePattern), null);
+ if (!this.params.popup || !this.showApplyButton) this.setInputField(this.getSelectedDateString(this.params.datePattern), null);
this.invokeEvent("timeselected",null, null, this.selectedDate);
}
}
- if (this.params.popup && !this.showApplyButton && updateTime) this.close(true);
+ if (this.params.popup && !this.showApplyButton) this.close(false);
},
showDateEditor: function()
17 years, 7 months