JBoss Rich Faces SVN: r1279 - trunk/richfaces/tree/src/main/java/org/richfaces/renderkit.
by richfaces-svn-commits@lists.jboss.org
Author: sergeyhalipov
Date: 2007-06-22 13:07:10 -0400 (Fri, 22 Jun 2007)
New Revision: 1279
Modified:
trunk/richfaces/tree/src/main/java/org/richfaces/renderkit/TreeRendererBase.java
Log:
http://jira.jboss.com/jira/browse/RF-86
Modified: trunk/richfaces/tree/src/main/java/org/richfaces/renderkit/TreeRendererBase.java
===================================================================
--- trunk/richfaces/tree/src/main/java/org/richfaces/renderkit/TreeRendererBase.java 2007-06-22 16:52:30 UTC (rev 1278)
+++ trunk/richfaces/tree/src/main/java/org/richfaces/renderkit/TreeRendererBase.java 2007-06-22 17:07:10 UTC (rev 1279)
@@ -152,40 +152,26 @@
}
}
}
-
- MethodBinding adviseNodeOpened = tree.getAdviseNodeOpened();
- if (null != adviseNodeOpened) {
- Boolean nodeOpened = (Boolean) adviseNodeOpened.invoke(context, new Object[] {tree});
- if (null != nodeOpened) {
- if (nodeOpened.booleanValue()) {
- if (!componentState.isExpanded(rowKey)) {
- componentState.expandNode(rowKey);
+ else {
+ tree.setStateAdvisor(new TreeStateAdvisor() {
+ public Boolean adviseNodeOpened(UITree tree) {
+ MethodBinding adviseNodeOpened = tree.getAdviseNodeOpened();
+ if (null != adviseNodeOpened) {
+ return (Boolean) adviseNodeOpened.invoke(FacesContext.getCurrentInstance(), new Object[] {tree});
}
+ return null;
}
- else {
- if (componentState.isExpanded((TreeRowKey)rowKey)) {
- componentState.collapseNode(rowKey);
+
+ public Boolean adviseNodeSelected(UITree tree) {
+ MethodBinding adviseNodeSelected = tree.getAdviseNodeSelected();
+ if (null != adviseNodeSelected) {
+ return (Boolean) adviseNodeSelected.invoke(FacesContext.getCurrentInstance(), new Object [] {tree});
}
+ return null;
}
- }
+ });
+ processAdvisors(context, rowKey);
}
-
- MethodBinding adviseNodeSelected = tree.getAdviseNodeSelected();
- if (null != adviseNodeSelected) {
- Boolean nodeSelected = (Boolean) adviseNodeSelected.invoke(context, new Object [] {tree});
- if (null != nodeSelected) {
- if (nodeSelected.booleanValue()) {
- if (!componentState.isSelected(rowKey)) {
- componentState.setSelected(rowKey);
- }
- }
- else {
- if (componentState.isSelected(rowKey)) {
- componentState.setSelected(null);
- }
- }
- }
- }
}
}
18 years, 6 months
JBoss Rich Faces SVN: r1278 - in trunk/sandbox/scrollable-grid/src/main/javascript/ClientUI: controls/grid and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: dmorozov
Date: 2007-06-22 12:52:30 -0400 (Fri, 22 Jun 2007)
New Revision: 1278
Modified:
trunk/sandbox/scrollable-grid/src/main/javascript/ClientUI/common/utils/Utils.js
trunk/sandbox/scrollable-grid/src/main/javascript/ClientUI/controls/grid/ScrollableGrid.js
Log:
1. Create 2 custom events for grid: OnPostScroll & OnPostSort
2. Fix problem with selection manager state restoring - put it into correct place.
Modified: trunk/sandbox/scrollable-grid/src/main/javascript/ClientUI/common/utils/Utils.js
===================================================================
--- trunk/sandbox/scrollable-grid/src/main/javascript/ClientUI/common/utils/Utils.js 2007-06-22 15:52:41 UTC (rev 1277)
+++ trunk/sandbox/scrollable-grid/src/main/javascript/ClientUI/common/utils/Utils.js 2007-06-22 16:52:30 UTC (rev 1278)
@@ -188,7 +188,7 @@
},
AJAX : {
- updateRows: function(options,request,grid,clientid, callbacks){
+ updateRows: function(options,request,grid,clientid, callbacks, callbacksPost){
var localOptions = options;
var rowCount = grid.getBody().templFrozen.getElement().rows.length;
var startRow = localOptions.startRow;
@@ -227,7 +227,15 @@
callback.call(grid, rowsForUpdate[i][":n:"]);
}
);
- }
+ }
+
+ if(callbacksPost) {
+ callbacksPost.unbreakableEach(
+ function(callback) {
+ callback.call(grid);
+ }
+ );
+ }
}, 100);
}
Modified: trunk/sandbox/scrollable-grid/src/main/javascript/ClientUI/controls/grid/ScrollableGrid.js
===================================================================
--- trunk/sandbox/scrollable-grid/src/main/javascript/ClientUI/controls/grid/ScrollableGrid.js 2007-06-22 15:52:41 UTC (rev 1277)
+++ trunk/sandbox/scrollable-grid/src/main/javascript/ClientUI/controls/grid/ScrollableGrid.js 2007-06-22 16:52:30 UTC (rev 1278)
@@ -8,7 +8,16 @@
});
Object.extend(ClientUI.controls.grid.ScrollableGrid.prototype, {
+ /**
+ * Occured when scroll position adjusted
+ */
+ eventOnPostScroll: {},
+ /**
+ * Occured when sorting adjusted
+ */
+ eventOnPostSort: {},
+
initialize: function(options) {
this.options = options;
@@ -25,6 +34,9 @@
];
this.init2 = this.init.bindAsEventListener(this);
+ this.eventOnPostSort = new ClientUI.common.utils.CustomEvent('OnSort');
+ this.eventOnPostScroll = new ClientUI.common.utils.CustomEvent('OnScroll');
+
this.startUpTime = new Date().getTime();
this.rowCallbacks = [];
@@ -54,22 +66,25 @@
onSortComplete : function(request, event, data){
var options = request.getJSON("options");
- Utils.AJAX.updateRows(options,request,this,this.client_id, [this.updateSelectionCallBack]);
- if (this.selectionManager) {
- setTimeout(function(){
- this.selectionManager.restoreState();
- }.bind(this), 500);
- }
+ Utils.AJAX.updateRows(options,request,
+ this,this.client_id,
+ [this.updateSelectionCallBack],
+ [function(){
+ this.selectionManager.restoreState();
+ this.eventOnPostSort.fire(options.column, options.order);
+ }]);
},
onScrollComplete : function(request, event, data){
var options = this.dataModel.getCurrentOptions();
window.loadingServerTime = (new Date()).getTime();
- Utils.AJAX.updateRows(options,request,this,this.client_id, [this.updateSelectionCallBack]);
- if (this.selectionManager) {
- setTimeout(function(){
- this.selectionManager.restoreState();
- }.bind(this), 500);
- }
+ Utils.AJAX.updateRows(options,request,
+ this,this.client_id,
+ [this.updateSelectionCallBack],
+ [function(){
+ this.selectionManager.restoreState();
+ this.eventOnPostScroll.fire(this.getBody().currRange.start);
+ }]);
+
window.loadingEndTime = (new Date()).getTime();
// TODO: remove this time statistic logging
18 years, 6 months
JBoss Rich Faces SVN: r1277 - trunk/docs/userguide/en/src/main/docbook/modules.
by richfaces-svn-commits@lists.jboss.org
Author: vkorluzhenko
Date: 2007-06-22 11:52:41 -0400 (Fri, 22 Jun 2007)
New Revision: 1277
Modified:
trunk/docs/userguide/en/src/main/docbook/modules/RFCfaq.xml
Log:
added new questions
Modified: trunk/docs/userguide/en/src/main/docbook/modules/RFCfaq.xml
===================================================================
--- trunk/docs/userguide/en/src/main/docbook/modules/RFCfaq.xml 2007-06-22 14:24:08 UTC (rev 1276)
+++ trunk/docs/userguide/en/src/main/docbook/modules/RFCfaq.xml 2007-06-22 15:52:41 UTC (rev 1277)
@@ -138,5 +138,37 @@
]]></programlisting>
<para>In this case the popup suggestion list is above the modalPanel.</para>
</section>
-
+
+ <section>
+ <?dbhtml filename="DoesRichFacesworkwithfacelets"?>
+ <title>Does RichFaces work with facelets?</title>
+ <para>Main <ulink url="http://livedemo.exadel.com/richfaces-demo/"> demo</ulink>of RichFaces is a facelets based application. So, the answer is yes.</para>
+ </section>
+
+ <section>
+ <?dbhtml filename="RerenderingPartPage.html"?>
+ <title>How to reRender only particular row(s) of datatable?</title>
+ <para>
+ If you use "rich:dataTable" then you may use ajaxKeys attribute to bind the rowKeys to be reRendered there. After you need to point reRender on the whole table and only specified rows will be reRedered. Also you can see example about usage of "a4j:repeat" component
+ <ulink url="http://livedemo.exadel.com/a4j-repeat/">here</ulink>.</para>
+ </section>
+
+ <section>
+ <?dbhtml filename="Isitpossibletocreatedynamicmenu"?>
+ <title>Is it possible to create dynamic menu using rich:dropDownMenu component?</title>
+ <para>rich:dropDown menu is a standard JSF component. So, creation the menu dynamically from the Java Script code is the same as for any other jsf component.</para>
+ </section>
+
+ <section>
+ <?dbhtml filename="Isitpossibletocustomizelookofdatascroller"?>
+ <title>Is it possible to customize look of datascroller (the forward/back buttons) and replace them with images?</title>
+ <para>The answer is yes. Use facets: "first_disabled", "last_disabled", "next_disabled", "previous_disabled", "fastforward_disabled", "fastrewind_disabled".</para>
+ </section>
+
+ <section>
+ <?dbhtml filename="HowtocustomizesimpleTogglePanel"?>
+ <title>How to customize simpleTogglePanel? I need to change icon for toggler.</title>
+ <para>To customize icon for toggler use "openMarker" and "closeMarker" facets.</para>
+ </section>
+
</chapter>
18 years, 6 months
JBoss Rich Faces SVN: r1276 - in trunk/richfaces/tree/src/main: java/org/richfaces/component and 1 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: sergeyhalipov
Date: 2007-06-22 10:24:08 -0400 (Fri, 22 Jun 2007)
New Revision: 1276
Modified:
trunk/richfaces/tree/src/main/config/component/tree.xml
trunk/richfaces/tree/src/main/java/org/richfaces/component/UITree.java
trunk/richfaces/tree/src/main/java/org/richfaces/renderkit/TreeRendererBase.java
Log:
http://jira.jboss.com/jira/browse/RF-86
Modified: trunk/richfaces/tree/src/main/config/component/tree.xml
===================================================================
--- trunk/richfaces/tree/src/main/config/component/tree.xml 2007-06-22 14:15:23 UTC (rev 1275)
+++ trunk/richfaces/tree/src/main/config/component/tree.xml 2007-06-22 14:24:08 UTC (rev 1276)
@@ -213,6 +213,20 @@
<classname>java.lang.Object</classname>
<description>
</description>
+ </property>
+ <property>
+ <name>adviseNodeOpened</name>
+ <classname>javax.faces.el.MethodBinding</classname>
+ <description>
+ </description>
+ <methodargs>org.richfaces.component.UITree.class</methodargs>
+ </property>
+ <property>
+ <name>adviseNodeSelected</name>
+ <classname>javax.faces.el.MethodBinding</classname>
+ <description>
+ </description>
+ <methodargs>org.richfaces.component.UITree.class</methodargs>
</property>
</component>
Modified: trunk/richfaces/tree/src/main/java/org/richfaces/component/UITree.java
===================================================================
--- trunk/richfaces/tree/src/main/java/org/richfaces/component/UITree.java 2007-06-22 14:15:23 UTC (rev 1275)
+++ trunk/richfaces/tree/src/main/java/org/richfaces/component/UITree.java 2007-06-22 14:24:08 UTC (rev 1276)
@@ -30,6 +30,7 @@
import javax.faces.component.NamingContainer;
import javax.faces.component.UIOutput;
import javax.faces.context.FacesContext;
+import javax.faces.el.MethodBinding;
import javax.faces.event.AbortProcessingException;
import javax.faces.event.FacesEvent;
import javax.faces.event.FacesListener;
@@ -572,11 +573,24 @@
public abstract String getSelectedClass();
public abstract void setNodeFace(String nodeFace);
+
public abstract String getNodeFace();
public abstract void setToggleOnClick(boolean toggleOnClick);
public abstract boolean isToggleOnClick();
+
+ public abstract void setStateAdvisor(Object nodeFace);
+
+ public abstract Object getStateAdvisor();
+
+ public abstract MethodBinding getAdviseNodeOpened();
+
+ public abstract void setAdviseNodeOpened(MethodBinding adviseNodeOpened);
+
+ public abstract MethodBinding getAdviseNodeSelected();
+
+ public abstract void setAdviseNodeSelected(MethodBinding adviseNodeSelected);
public void addChangeExpandListener(NodeExpandedListener listener) {
addFacesListener(listener);
Modified: trunk/richfaces/tree/src/main/java/org/richfaces/renderkit/TreeRendererBase.java
===================================================================
--- trunk/richfaces/tree/src/main/java/org/richfaces/renderkit/TreeRendererBase.java 2007-06-22 14:15:23 UTC (rev 1275)
+++ trunk/richfaces/tree/src/main/java/org/richfaces/renderkit/TreeRendererBase.java 2007-06-22 14:24:08 UTC (rev 1276)
@@ -33,6 +33,7 @@
import javax.faces.component.UIComponent;
import javax.faces.context.FacesContext;
import javax.faces.context.ResponseWriter;
+import javax.faces.el.MethodBinding;
import org.ajax4jsf.ajax.repeat.DataVisitor;
import org.ajax4jsf.framework.renderer.AjaxRendererUtils;
@@ -82,22 +83,7 @@
navigator.followRowKey((TreeRowKey) rowKey);
- TreeState componentState = (TreeState) tree.getComponentState();
- TreeStateAdvisor stateAdvisor = (TreeStateAdvisor)tree.getAttributes().get("stateAdvisor");
- if (null != stateAdvisor) {
- Boolean adviseOpened = stateAdvisor.adviseNodeOpened(tree);
- if (null != adviseOpened)
- if (adviseOpened.booleanValue())
- componentState.expandNode((TreeRowKey)rowKey);
- else
- componentState.collapseNode((TreeRowKey)rowKey);
-
- Boolean adviseSelected = stateAdvisor.adviseNodeSelected(tree);
- if (null != adviseSelected)
- if (adviseSelected.booleanValue())
- componentState.setSelected((TreeRowKey)rowKey);
- }
-
+ processAdvisors(context, (TreeRowKey)rowKey);
if (tree.isSelected()) {
holder.setValue(tree.getNodeFacet().getClientId(context));
@@ -134,6 +120,73 @@
isLastElement = false;
navigator.resetLastElement();
}
+
+ public void processAdvisors(FacesContext context, TreeRowKey rowKey) throws IOException {
+ TreeState componentState = (TreeState) tree.getComponentState();
+ TreeStateAdvisor stateAdvisor = (TreeStateAdvisor)tree.getStateAdvisor();
+ if (null != stateAdvisor) {
+ Boolean adviseOpened = stateAdvisor.adviseNodeOpened(tree);
+ if (null != adviseOpened) {
+ if (adviseOpened.booleanValue()) {
+ if (!componentState.isExpanded(rowKey)) {
+ componentState.expandNode(rowKey);
+ }
+ }
+ else {
+ if (componentState.isExpanded(rowKey)) {
+ componentState.collapseNode(rowKey);
+ }
+ }
+ }
+ Boolean adviseSelected = stateAdvisor.adviseNodeSelected(tree);
+ if (null != adviseSelected) {
+ if (adviseSelected.booleanValue()) {
+ if (!componentState.isSelected(rowKey)) {
+ componentState.setSelected(rowKey);
+ }
+ }
+ else {
+ if (componentState.isSelected(rowKey)) {
+ componentState.setSelected(null);
+ }
+ }
+ }
+ }
+
+ MethodBinding adviseNodeOpened = tree.getAdviseNodeOpened();
+ if (null != adviseNodeOpened) {
+ Boolean nodeOpened = (Boolean) adviseNodeOpened.invoke(context, new Object[] {tree});
+ if (null != nodeOpened) {
+ if (nodeOpened.booleanValue()) {
+ if (!componentState.isExpanded(rowKey)) {
+ componentState.expandNode(rowKey);
+ }
+ }
+ else {
+ if (componentState.isExpanded((TreeRowKey)rowKey)) {
+ componentState.collapseNode(rowKey);
+ }
+ }
+ }
+ }
+
+ MethodBinding adviseNodeSelected = tree.getAdviseNodeSelected();
+ if (null != adviseNodeSelected) {
+ Boolean nodeSelected = (Boolean) adviseNodeSelected.invoke(context, new Object [] {tree});
+ if (null != nodeSelected) {
+ if (nodeSelected.booleanValue()) {
+ if (!componentState.isSelected(rowKey)) {
+ componentState.setSelected(rowKey);
+ }
+ }
+ else {
+ if (componentState.isSelected(rowKey)) {
+ componentState.setSelected(null);
+ }
+ }
+ }
+ }
+ }
}
public TreeRendererBase() {
18 years, 6 months
JBoss Rich Faces SVN: r1275 - in trunk/richfaces-samples/suggestionbox-sample/src/main: webapp/pages and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: A.Skokov
Date: 2007-06-22 10:15:23 -0400 (Fri, 22 Jun 2007)
New Revision: 1275
Modified:
trunk/richfaces-samples/suggestionbox-sample/src/main/java/org/richfaces/Data.java
trunk/richfaces-samples/suggestionbox-sample/src/main/java/org/richfaces/SuggestionBox.java
trunk/richfaces-samples/suggestionbox-sample/src/main/webapp/pages/index.jsp
Log:
http://jira.jboss.com/jira/browse/RF-60
Modified: trunk/richfaces-samples/suggestionbox-sample/src/main/java/org/richfaces/Data.java
===================================================================
--- trunk/richfaces-samples/suggestionbox-sample/src/main/java/org/richfaces/Data.java 2007-06-22 13:41:47 UTC (rev 1274)
+++ trunk/richfaces-samples/suggestionbox-sample/src/main/java/org/richfaces/Data.java 2007-06-22 14:15:23 UTC (rev 1275)
@@ -25,12 +25,13 @@
public class Data implements Serializable {
private String text;
-
private String label;
+ private double price;
- public Data(String text, String label) {
+ public Data(String text, String label, double price) {
this.text = text;
this.label = label;
+ this.price = price;
}
public String getLabel() {
@@ -48,4 +49,12 @@
public void setText(String text) {
this.text = text;
}
+
+ public double getPrice() {
+ return price;
+ }
+
+ public void setPrice(double price) {
+ this.price = price;
+ }
}
Modified: trunk/richfaces-samples/suggestionbox-sample/src/main/java/org/richfaces/SuggestionBox.java
===================================================================
--- trunk/richfaces-samples/suggestionbox-sample/src/main/java/org/richfaces/SuggestionBox.java 2007-06-22 13:41:47 UTC (rev 1274)
+++ trunk/richfaces-samples/suggestionbox-sample/src/main/java/org/richfaces/SuggestionBox.java 2007-06-22 14:15:23 UTC (rev 1275)
@@ -51,7 +51,8 @@
private String shadowOpacity = "4";
private String onsubmit = "true";
- private static final String [] cit = {"Abba", "Abbeville", "Acworth", "Adairsville", "Adel", "Adrian", "Ailey", "Alamo", "Alapaha", "Albany", "Allenhurst", "Alma", "Alpharetta", "Alston", "Amboy", "Ambrose", "Americus", "Appling", "Arlington", "Ashburn", "Athens", "Athens-Clarke County", "Atkinson", "Atlanta", "Attapulgus", "Auburn", "Augusta", "Augusta-Richmond County", "Austell", "Avondale Estates", "Axson"};
+ private static final String [] cit = {"Abba", "Abbeville", "Acworth", "Adairsville", "Adel", "Adrian", "Ailey", "Alamo", "Alapaha", "Albany", "Allenhurst", "Alma", "Alpharetta", "Alston", "Amboy", "Ambrose", "Americus", "Appling", "Arlington", "Ashburn", "Athens", "Athens-Clarke County", "Atkinson", "Atlanta", "Attapulgus", "Auburn", "Augusta", "Augusta-Richmond County", "Austell", "Avondale Estates", "Axson"};
+ private static final double [] prices = {0.9, 2.31, 5.707, 8.0, 10.01, 50.50, 99.99, 80.08, 101.01, 222.22, 200.0, 345.67, 456.78, 500.1, 999.99, 999.99, 999.99, 999.99, 999.99, 999.99, 999.99, 999.99, 999.99, 999.99, 999.99, 999.99, 999.99, 999.99, 999.99, 999.99, 999.99};
public SuggestionBox() {
this.rows = "0";
@@ -91,7 +92,7 @@
public ArrayList getAllData() {
ArrayList result = new ArrayList();
for (int i = 0; i < cit.length; i++) {
- Data data = new Data(cit[i], String.valueOf(i + 1));
+ Data data = new Data(cit[i], String.valueOf(i + 1), prices[i]);
result.add(data);
}
return result;
Modified: trunk/richfaces-samples/suggestionbox-sample/src/main/webapp/pages/index.jsp
===================================================================
--- trunk/richfaces-samples/suggestionbox-sample/src/main/webapp/pages/index.jsp 2007-06-22 13:41:47 UTC (rev 1274)
+++ trunk/richfaces-samples/suggestionbox-sample/src/main/webapp/pages/index.jsp 2007-06-22 14:15:23 UTC (rev 1275)
@@ -39,7 +39,7 @@
<rich:suggestionbox id="suggestionBoxId" for="text" tokens=",["
rules="#{suggestionBox.rules}"
suggestionAction="#{suggestionBox.autocomplete}" var="result"
- fetchValue="#{result.text}"
+ fetchValue="#{result.text}"
first="#{suggestionBox.intFirst}"
minChars="#{suggestionBox.minchars}"
shadowOpacity="#{suggestionBox.shadowOpacity}"
@@ -49,10 +49,15 @@
shadowDepth="#{suggestionBox.shadowDepth}"
cellpadding="#{suggestionBox.cellpadding}">
- <a4j:ajaxListener type="org.richfaces.AjaxListener"/>
+ <a4j:ajaxListener type="org.richfaces.AjaxListener"/>
<h:column>
<h:outputText value="#{result.text}"/>
</h:column>
+ <h:column>
+ <h:outputText value="#{result.price}">
+ <f:convertNumber pattern="#,##.00" type="currency"/>
+ </h:outputText>
+ </h:column>
</rich:suggestionbox>
</h:panelGrid>
18 years, 6 months
JBoss Rich Faces SVN: r1274 - trunk/sandbox/scrollable-grid/src/main/javascript/ClientUI/controls/grid.
by richfaces-svn-commits@lists.jboss.org
Author: dmorozov
Date: 2007-06-22 09:41:47 -0400 (Fri, 22 Jun 2007)
New Revision: 1274
Modified:
trunk/sandbox/scrollable-grid/src/main/javascript/ClientUI/controls/grid/Grid.js
Log:
Add converter from/to client table row index and to/from data index
Modified: trunk/sandbox/scrollable-grid/src/main/javascript/ClientUI/controls/grid/Grid.js
===================================================================
--- trunk/sandbox/scrollable-grid/src/main/javascript/ClientUI/controls/grid/Grid.js 2007-06-22 13:25:15 UTC (rev 1273)
+++ trunk/sandbox/scrollable-grid/src/main/javascript/ClientUI/controls/grid/Grid.js 2007-06-22 13:41:47 UTC (rev 1274)
@@ -197,8 +197,13 @@
},
getDataIndex: function(rowIndex) {
var body = this.getBody();
- return this.getBody().currRange.start+rowIndex;
+ return body.currRange.start+rowIndex;
},
+ getRowIndex: function(dataIndex) {
+ var body = this.getBody();
+ return (dataIndex>=body.currRange.start && dataIndex<body.currRange.start+body.rowsCount) ?
+ dataIndex - body.currRange.start : -1;
+ },
hideColumn: function(column) {
this.adjustColumnWidth(column, 0);
}
18 years, 6 months
JBoss Rich Faces SVN: r1273 - trunk/richfaces-samples/suggestionbox-sample/src/main/java/org/richfaces.
by richfaces-svn-commits@lists.jboss.org
Author: A.Skokov
Date: 2007-06-22 09:25:15 -0400 (Fri, 22 Jun 2007)
New Revision: 1273
Modified:
trunk/richfaces-samples/suggestionbox-sample/src/main/java/org/richfaces/SuggestionBox.java
Log:
minchars = "1"
Modified: trunk/richfaces-samples/suggestionbox-sample/src/main/java/org/richfaces/SuggestionBox.java
===================================================================
--- trunk/richfaces-samples/suggestionbox-sample/src/main/java/org/richfaces/SuggestionBox.java 2007-06-22 13:22:34 UTC (rev 1272)
+++ trunk/richfaces-samples/suggestionbox-sample/src/main/java/org/richfaces/SuggestionBox.java 2007-06-22 13:25:15 UTC (rev 1273)
@@ -58,7 +58,7 @@
this.first = "0";
this.cellspacing = "2";
this.cellpadding = "2";
- this.minchars = "2";
+ this.minchars = "1";
this.frequency = "0";
this.rules = "none";
18 years, 6 months
JBoss Rich Faces SVN: r1272 - trunk/sandbox/calendar/design/calendar-js.
by richfaces-svn-commits@lists.jboss.org
Author: pyaschenko
Date: 2007-06-22 09:22:34 -0400 (Fri, 22 Jun 2007)
New Revision: 1272
Modified:
trunk/sandbox/calendar/design/calendar-js/calendar-prototype.js
trunk/sandbox/calendar/design/calendar-js/calendar-xhtml.html
Log:
right weeknumber calculation added
Modified: trunk/sandbox/calendar/design/calendar-js/calendar-prototype.js
===================================================================
--- trunk/sandbox/calendar/design/calendar-js/calendar-prototype.js 2007-06-22 13:10:44 UTC (rev 1271)
+++ trunk/sandbox/calendar/design/calendar-js/calendar-prototype.js 2007-06-22 13:22:34 UTC (rev 1272)
@@ -50,21 +50,44 @@
return value;
}
+function getFirstWeek(year, mdifw, fdow) {
+ var date = new Date(year,0,1);
+ var firstday = getDay(date, fdow);
+
+ var weeknumber = (7-firstday<mdifw) ? 0 : 1;
+
+ return {date:date, firstDay:firstday, weekNumber:weeknumber, mdifw:mdifw, fdow:fdow};
+}
+
+function getLastWeekOfPrevYear(o) {
+ var year = o.date.getFullYear()-1;
+ var days = (isLeapYear(year) ? 366 : 365);
+ var obj = getFirstWeek(year, o.mdifw, o.fdow);
+ days = (days - 7 + o.firstDay);
+ var weeks = Math.floor(days/7)+1;
+
+ return weeks+obj.weekNumber;
+}
+
function weekNumber(year, month, mdifw, fdow) {
- var tfdow = fdow;
- var firstDay = new Date(year,0,1);
- var fDay = firstDay.getDay();
- var daynum = ((Date.UTC(year,month,1,0,0,0) - Date.UTC(year,0,1,0,0,0)) /86400000)+1 ;
- var weeknum = Math.round((daynum+7)/7);
- if(fDay == 0) fDay = 7;
- if(tfdow == 0) tfdow = 7;
- var delta = Math.abs(fDay-tfdow);
- if(delta == 0)return weeknum;
- if(tfdow < fDay) delta = 7 - delta;
- if(delta < mdifw) weeknum--;
- return weeknum;
+
+ var o = getFirstWeek(year, mdifw, fdow);
+
+ if (month==0)
+ {
+ if (o.weekNumber==1) return 1;
+ return getLastWeekOfPrevYear(o);
+ }
+ var oneweek = 604800000;
+ var d = new Date(year, month,1);
+ d.setDate( 1+o.firstDay + (getDay(d,fdow)==0?1:0));
+
+ weeknumber = o.weekNumber + Math.floor((d.getTime() - o.date.getTime()) / oneweek);
+
+ return weeknumber;
}
+
Calendar = Class.create();
Object.extend(Calendar.prototype, {
initialize: function(id,parameters) {
@@ -316,18 +339,26 @@
for (var k=1;k<7;k++)
{
//
+ dataobj = this.days[p];
+
var obj = $(this.params.weekNumberBarId+k).parentNode;
-
+
+ if (k!=1 && currentMonth==11 && dataobj && dataobj.day>27)
+ {
+ if (getFirstWeek(currentYear+1, this.params.minDaysInFirstWeek, this.params.firstWeekDay).weekNumber==1) wn=1;
+ }
+
element = obj.firstChild;
- element.innerHTML = (this.days[p]) ? this.params.weekNumberMarkup( {weekNumber: wn++} ) : "";
-
+ element.innerHTML = (dataobj) ? this.params.weekNumberMarkup( {weekNumber: wn++} ) : "";
+
+ if (k==1&&wn>52) wn=1;
+
while (element=element.nextSibling)
{
// TODO fix start/stop event's calls
this.stopCellEvents(element);
- if (this.days[p]) {
- dataobj = this.days[p];
+ if (dataobj) {
element.data=dataobj.day;
element.innerHTML = this.params.dayListMarkupArray[p]( dataobj );
element.className = dataobj._className + (todayflag /*&& dataobj._month==0 */&& dataobj.day==todaydate ? " Todayclass" : "");
@@ -338,6 +369,7 @@
//element.data="";
element.innerHTML = "";
}
+ dataobj = this.days[p];
}
}
},
Modified: trunk/sandbox/calendar/design/calendar-js/calendar-xhtml.html
===================================================================
--- trunk/sandbox/calendar/design/calendar-js/calendar-xhtml.html 2007-06-22 13:10:44 UTC (rev 1271)
+++ trunk/sandbox/calendar/design/calendar-js/calendar-xhtml.html 2007-06-22 13:22:34 UTC (rev 1272)
@@ -71,7 +71,7 @@
};
- window.testCalendar = new Calendar('calendar',{dayListTableId:'aaa',weekNumberBarId:'bbb',weekDayBarId:'ccc',dayListMarkupArray: m, weekDayMarkup: weekDayMarkup, weekNumberMarkup: weekNumberMarkup, currentDate: new Date(2007,6,1), selectedDate: new Date(2007,4,5), weekDayLabels:['Sun','Mon','Tue','Wen','Thu','Fri','Sat'], firstWeekDay: 1, minDaysInFirstWeek:4});
+ window.testCalendar = new Calendar('calendar',{dayListTableId:'aaa',weekNumberBarId:'bbb',weekDayBarId:'ccc',dayListMarkupArray: m, weekDayMarkup: weekDayMarkup, weekNumberMarkup: weekNumberMarkup, currentDate: new Date(2007,6,1), selectedDate: new Date(2007,4,5), weekDayLabels:['Sun','Mon','Tue','Wen','Thu','Fri','Sat'], firstWeekDay: 0, minDaysInFirstWeek:4});
loadDataSet1();
}
@@ -167,6 +167,7 @@
<input type="radio" name="dataSet" value="3" id="set3" onchange="selectDataSet(event)" onclick="selectDataSet(event)" /><label for="set3">Set 3</label><br />
-->
<button onclick="changeMonth(false)">prev month</button><button onclick="changeMonth(true)">next month</button><button onclick="today()">Today</button><br />
+<div id="x"></div>
<div id="calendar">Hello</div>
</body>
</html>
18 years, 6 months
JBoss Rich Faces SVN: r1271 - trunk/richfaces/dropdown-menu/src/main/java/org/richfaces/renderkit/html.
by richfaces-svn-commits@lists.jboss.org
Author: A.Skokov
Date: 2007-06-22 09:10:44 -0400 (Fri, 22 Jun 2007)
New Revision: 1271
Modified:
trunk/richfaces/dropdown-menu/src/main/java/org/richfaces/renderkit/html/DropDownMenuRendererBase.java
Log:
http://jira.jboss.com/jira/browse/RF-331
Modified: trunk/richfaces/dropdown-menu/src/main/java/org/richfaces/renderkit/html/DropDownMenuRendererBase.java
===================================================================
--- trunk/richfaces/dropdown-menu/src/main/java/org/richfaces/renderkit/html/DropDownMenuRendererBase.java 2007-06-21 19:44:42 UTC (rev 1270)
+++ trunk/richfaces/dropdown-menu/src/main/java/org/richfaces/renderkit/html/DropDownMenuRendererBase.java 2007-06-22 13:10:44 UTC (rev 1271)
@@ -99,7 +99,10 @@
writer.endElement("div");
writer.startElement("iframe", layer);
- writer.writeAttribute("id", clientId+"_menu_iframe", null);
+ writer.writeAttribute("src",
+ getResource("/org/richfaces/renderkit/html/images/spacer.gif")
+ .getUri(context, null), null);
+ writer.writeAttribute("id", clientId+"_menu_iframe", null);
writer.writeAttribute("class", "underneath_iframe", null);
writer.writeAttribute("style", "position:absolute", null);
writer.endElement("iframe");
18 years, 6 months
JBoss Rich Faces SVN: r1270 - in trunk/sandbox/tooltip/src/main: resources/org/richfaces/renderkit/html/scripts and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: dbiatenia
Date: 2007-06-21 15:44:42 -0400 (Thu, 21 Jun 2007)
New Revision: 1270
Modified:
trunk/sandbox/tooltip/src/main/config/component/toolTip.xml
trunk/sandbox/tooltip/src/main/resources/org/richfaces/renderkit/html/scripts/tooltip.js
Log:
Modified: trunk/sandbox/tooltip/src/main/config/component/toolTip.xml
===================================================================
--- trunk/sandbox/tooltip/src/main/config/component/toolTip.xml 2007-06-21 17:18:41 UTC (rev 1269)
+++ trunk/sandbox/tooltip/src/main/config/component/toolTip.xml 2007-06-21 19:44:42 UTC (rev 1270)
@@ -67,7 +67,7 @@
<name>direction</name>
<classname>java.lang.String</classname>
<description>Defines direction of the popup list to appear (top-right, top-left bottom-right, bottom-left, auto(default))</description>
- <defaultvalue><![CDATA["auto"]]></defaultvalue>
+ <defaultvalue><![CDATA["bottom-right"]]></defaultvalue>
</property>
<property>
<name>followmouse</name>
@@ -79,13 +79,13 @@
<name>horizontalOffset</name>
<classname>int</classname>
<description>Sets the horizontal offset between popup list and mouse pointer</description>
- <defaultvalue>0</defaultvalue>
+ <defaultvalue>10</defaultvalue>
</property>
<property>
<name>verticalOffset</name>
<classname>int</classname>
<description>Sets the vertical offset between popup list and mouse pointer</description>
- <defaultvalue>0</defaultvalue>
+ <defaultvalue>10</defaultvalue>
</property>
<property>
<name>style</name>
Modified: trunk/sandbox/tooltip/src/main/resources/org/richfaces/renderkit/html/scripts/tooltip.js
===================================================================
--- trunk/sandbox/tooltip/src/main/resources/org/richfaces/renderkit/html/scripts/tooltip.js 2007-06-21 17:18:41 UTC (rev 1269)
+++ trunk/sandbox/tooltip/src/main/resources/org/richfaces/renderkit/html/scripts/tooltip.js 2007-06-21 19:44:42 UTC (rev 1270)
@@ -24,8 +24,6 @@
if (cursorY < 0){cursorY = 0;}
// show the position values in the form named Show
// in the text fields named MouseX and MouseY
-$('mouseX').value = cursorX;
-$('mouseY').value = cursorY;
return true;
}
18 years, 6 months