JBoss Rich Faces SVN: r1674 - trunk/docs/userguide/en/src/main/docbook/included.
by richfaces-svn-commits@lists.jboss.org
Author: vkorluzhenko
Date: 2007-07-18 09:38:28 -0400 (Wed, 18 Jul 2007)
New Revision: 1674
Modified:
trunk/docs/userguide/en/src/main/docbook/included/suggestionBox.desc.xml
Log:
http://jira.jboss.com/jira/browse/RF-451
Modified: trunk/docs/userguide/en/src/main/docbook/included/suggestionBox.desc.xml
===================================================================
--- trunk/docs/userguide/en/src/main/docbook/included/suggestionBox.desc.xml 2007-07-18 13:32:24 UTC (rev 1673)
+++ trunk/docs/userguide/en/src/main/docbook/included/suggestionBox.desc.xml 2007-07-18 13:38:28 UTC (rev 1674)
@@ -16,7 +16,7 @@
<title>SuggestionBox component</title>
<mediaobject>
<imageobject>
- <imagedata fileref="images/suggestionbox2.gif"/>
+ <imagedata fileref="images/suggestionbox1.gif"/>
</imageobject>
</mediaobject>
</figure>
17 years, 6 months
JBoss Rich Faces SVN: r1673 - branches/3.0.2/sandbox/calendar/src/main/resources/org/richfaces/renderkit/html/scripts.
by richfaces-svn-commits@lists.jboss.org
Author: pyaschenko
Date: 2007-07-18 09:32:24 -0400 (Wed, 18 Jul 2007)
New Revision: 1673
Modified:
branches/3.0.2/sandbox/calendar/src/main/resources/org/richfaces/renderkit/html/scripts/calendar.js
Log:
small changes
Modified: branches/3.0.2/sandbox/calendar/src/main/resources/org/richfaces/renderkit/html/scripts/calendar.js
===================================================================
--- branches/3.0.2/sandbox/calendar/src/main/resources/org/richfaces/renderkit/html/scripts/calendar.js 2007-07-18 13:18:52 UTC (rev 1672)
+++ branches/3.0.2/sandbox/calendar/src/main/resources/org/richfaces/renderkit/html/scripts/calendar.js 2007-07-18 13:32:24 UTC (rev 1673)
@@ -136,7 +136,8 @@
this.params = parameters;
if (!this.params.showWeekDaysBar) this.params.showWeekDaysBar = true;
if (!this.params.showWeeksBar) this.params.showWeeksBar = true;
- if (this.params.monthLabels) this.params.monthLabels.push(this.params.monthLabels[0]);
+ if (this.params.monthLabels) this.params.monthLabels.push(this.params.monthLabels[0]);
+ if (!this.params.datePattern) this.params.datePattern = "MMM d, y"
this.currentDate = this.params.currentDate ? this.params.currentDate : new Date();
this.selectedDate = this.params.selectedDate;
@@ -157,7 +158,7 @@
this.daysData = {startDate:null, days:[]};
this.days = [];
- var htmlTextHeader = '<input id="'+this.id+'InputSelectedDate" name="'+this.id+'InputSelectedDate" type="hidden" value="'+this.getSelectedDateString()+'"/>\n' +
+ var htmlTextHeader = '<input id="'+this.id+'InputSelectedDate" name="'+this.id+'InputSelectedDate" type="hidden" value="'+this.getSelectedDateString(this.params.datePattern)+'"/>\n' +
'<input id="'+this.id+'InputCurrentDate" name="'+this.id+'InputCurrentDate" type="hidden" value="'+this.getCurrentDate().format("MM/y")+'"/>\n' +
'<table border="0" cellpadding="0" cellspacing="0" class="calendar_exterior"><tbody>\n';
var htmlControlsHeader = '<tr><th colspan="8" id="'+this.id+':header"></th></tr>'
@@ -319,7 +320,7 @@
this.selectedDateElement = obj;
Element.addClassName(obj, "Selecteddayclass");
- $(this.id+'InputSelectedDate').value=this.getSelectedDateString();
+ $(this.id+'InputSelectedDate').value=this.getSelectedDateString(this.params.datePattern);
this.renderFooter();
} else {
if (daydata._month==-1) this.prevMonth(); else this.nextMonth();
@@ -653,7 +654,7 @@
return Calendar.getControl(context, null, "Today", "today");
};
Calendar.selectedDateControl = function(context) {
- var value =context.calendar.getSelectedDateString("dd/MM/y");
+ var value = context.calendar.getSelectedDateString(context.calendar.params.datePattern);
return value;
};
Calendar.helpControl = function(context)
@@ -703,7 +704,7 @@
[
new E('tr',{},
[
- new E('td',{'class': 'calendar_toolfooter'},
+ new E('td',{'class': 'calendar_toolfooter', 'style': 'white-space:nowrap'},
[
new ET(function (context) { return Richfaces.evalMacro("Calendar.selectedDateControl", context)})
]),
17 years, 6 months
JBoss Rich Faces SVN: r1672 - trunk/ui/tree/src/main/templates.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2007-07-18 09:18:52 -0400 (Wed, 18 Jul 2007)
New Revision: 1672
Modified:
trunk/ui/tree/src/main/templates/htmlTree.jspx
Log:
AjaxScript path updated to the right variant
Modified: trunk/ui/tree/src/main/templates/htmlTree.jspx
===================================================================
--- trunk/ui/tree/src/main/templates/htmlTree.jspx 2007-07-18 12:51:45 UTC (rev 1671)
+++ trunk/ui/tree/src/main/templates/htmlTree.jspx 2007-07-18 13:18:52 UTC (rev 1672)
@@ -15,6 +15,7 @@
<h:scripts>
new org.ajax4jsf.javascript.PrototypeScript(),
+ new org.ajax4jsf.javascript.AjaxScript(),
/org/ajax4jsf/framework/ajax/scripts/AJAX.js,
/org/richfaces/renderkit/html/scripts/utils.js,
/org/ajax4jsf/javascript/scripts/form.js,
17 years, 6 months
JBoss Rich Faces SVN: r1671 - in trunk: samples/datascroller-sample/src/main/webapp/pages and 25 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2007-07-18 08:51:45 -0400 (Wed, 18 Jul 2007)
New Revision: 1671
Modified:
trunk/samples/datascroller-sample/src/main/java/org/richfaces/TestBean.java
trunk/samples/datascroller-sample/src/main/webapp/pages/index.jsp
trunk/sandbox/api/
trunk/ui/dataTable/src/main/resources/org/richfaces/renderkit/html/css/table.xcss
trunk/ui/datascroller/src/main/java/org/richfaces/renderkit/html/DataScrollerRenderer.java
trunk/ui/drag-drop/src/main/java/org/richfaces/renderkit/DragIndicatorRendererBase.java
trunk/ui/drag-drop/src/main/java/org/richfaces/renderkit/DraggableRendererContributor.java
trunk/ui/drag-drop/src/main/java/org/richfaces/renderkit/DropzoneRendererContributor.java
trunk/ui/drag-drop/src/test/java/org/richfaces/component/DragDropTest.java
trunk/ui/inputnumber-slider/src/main/config/component/inputNumberSlider.xml
trunk/ui/inputnumber-slider/src/main/java/org/richfaces/renderkit/InputNumberSliderRendererBase.java
trunk/ui/inputnumber-slider/src/main/resources/org/richfaces/renderkit/html/script/SliderScript.js
trunk/ui/inputnumber-slider/src/main/templates/inputNumberSlider.jspx
trunk/ui/modal-panel/src/main/config/component/modalPanel.xml
trunk/ui/modal-panel/src/main/java/org/richfaces/component/UIModalPanel.java
trunk/ui/modal-panel/src/main/java/org/richfaces/renderkit/ModalPanelRendererBase.java
trunk/ui/modal-panel/src/main/resources/org/richfaces/renderkit/html/scripts/modalPanel.js
trunk/ui/modal-panel/src/main/templates/org/richfaces/htmlModalPanel.jspx
trunk/ui/panel/src/main/config/component/panel.xml
trunk/ui/panel/src/main/java/org/richfaces/component/UIPanel.java
trunk/ui/panel/src/main/templates/panel.jspx
trunk/ui/suggestionbox/src/main/config/component/suggestionbox.xml
trunk/ui/suggestionbox/src/main/java/org/richfaces/renderkit/html/SuggestionBoxRenderer.java
trunk/ui/suggestionbox/src/main/resources/org/richfaces/renderkit/html/scripts/suggestionbox.js
trunk/ui/suggestionbox/src/main/resources/org/richfaces/renderkit/html/templates/popup.jspx
trunk/ui/tree/src/main/java/org/richfaces/component/state/TreeState.java
trunk/ui/tree/src/main/resources/org/richfaces/renderkit/html/scripts/tree-item.js
trunk/ui/tree/src/main/resources/org/richfaces/renderkit/html/scripts/tree-selection.js
trunk/ui/tree/src/main/resources/org/richfaces/renderkit/html/scripts/tree.js
trunk/ui/tree/src/main/templates/htmlTree.jspx
trunk/ui/tree/src/test/java/org/richfaces/component/TreeComponentTest.java
Log:
Branch diff for r1383:1625 applied to trunk
Modified: trunk/samples/datascroller-sample/src/main/java/org/richfaces/TestBean.java
===================================================================
--- trunk/samples/datascroller-sample/src/main/java/org/richfaces/TestBean.java 2007-07-18 12:27:31 UTC (rev 1670)
+++ trunk/samples/datascroller-sample/src/main/java/org/richfaces/TestBean.java 2007-07-18 12:51:45 UTC (rev 1671)
@@ -27,7 +27,7 @@
import org.richfaces.event.DataScrollerEvent;
public class TestBean {
-
+
private ArrayList data;
private ArrayList data1;
private ArrayList data2;
@@ -38,9 +38,11 @@
public boolean renderIfSinglePage;
public int rows;
public int maxpage;
+ private int actionCount;
+ private int eventCount;
-
- public TestBean () {
+
+ public TestBean () {
renderIfSinglePage=true;
renderIfSinglePage=true;
@@ -48,31 +50,45 @@
maxpage=10;
data = new ArrayList();
- for (int i = 0; i < 10; i++) data.add(new Entry(null,i));
+ for (int i = 0; i < 10; i++) {
+ data.add(new Entry(null, i));
+ }
data1 = new ArrayList();
- for (int i = 0; i < 11; i++) data1.add(new Entry(null,i));
+ for (int i = 0; i < 11; i++) {
+ data1.add(new Entry(null, i));
+ }
data2 = new ArrayList();
- for (int i = 0; i < 12; i++) data2.add(new Entry(null,i));
+ for (int i = 0; i < 12; i++) {
+ data2.add(new Entry(null, i));
+ }
data3 = new ArrayList();
- for (int i = 0; i < 13; i++) data3.add(new Entry(null,i));
+ for (int i = 0; i < 13; i++) {
+ data3.add(new Entry(null, i));
+ }
data4 = new ArrayList();
- for (int i = 0; i < 14; i++) data4.add(new Entry(null,i));
+ for (int i = 0; i < 14; i++) {
+ data4.add(new Entry(null, i));
+ }
data5 = new ArrayList();
- for (int i = 0; i < 15; i++) data5.add(new Entry(null,i));
+ for (int i = 0; i < 15; i++) {
+ data5.add(new Entry(null, i));
+ }
data6 = new ArrayList();
- for (int i = 0; i < 16; i++) data6.add(new Entry(null,i));
+ for (int i = 0; i < 16; i++) {
+ data6.add(new Entry(null, i));
+ }
}
-
-
- public void setRenderIfSinglePage(boolean renderIfSinglePage){
+
+
+ public void setRenderIfSinglePage(boolean renderIfSinglePage){
this.renderIfSinglePage = renderIfSinglePage;
}
@@ -80,17 +96,17 @@
return this.renderIfSinglePage;
}
- public void setRows(int rows){
-
+ public void setRows(int rows){
+
this.rows = rows;
}
public int getRows() {
-
+
return this.rows;
}
- public void setMaxpage(int maxpage){
+ public void setMaxpage(int maxpage){
this.maxpage = maxpage;
}
@@ -101,15 +117,16 @@
public void onAction(ActionEvent actionEvent) {
System.out.println("TestBean.onAction() " + actionEvent);
+ actionCount++;
}
-
-
+
+
public void doScroll(DataScrollerEvent event) {
String oldScrolVal = event.getOldScrolVal();
String newScrolVal = event.getNewScrolVal();
System.out.println("Old Value = " + oldScrolVal + " " + "New Value = " + newScrolVal);
-
+ eventCount++;
}
@@ -174,10 +191,23 @@
return data6;
}
-
-
public void setData6(ArrayList data) {
this.data6 = data;
}
+ public int getActionCount() {
+ return actionCount;
+ }
+
+ public void setActionCount(int actionCount) {
+ this.actionCount = actionCount;
+ }
+
+ public int getEventCount() {
+ return eventCount;
+ }
+
+ public void setEventCount(int eventCount) {
+ this.eventCount = eventCount;
+ }
}
Modified: trunk/samples/datascroller-sample/src/main/webapp/pages/index.jsp
===================================================================
--- trunk/samples/datascroller-sample/src/main/webapp/pages/index.jsp 2007-07-18 12:27:31 UTC (rev 1670)
+++ trunk/samples/datascroller-sample/src/main/webapp/pages/index.jsp 2007-07-18 12:51:45 UTC (rev 1671)
@@ -13,13 +13,13 @@
<body>
<f:view>
<h:form>
-
+
<h:selectOneRadio binding="#{skinBean.component}" />
<h:commandLink action="#{skinBean.change}" value="set skin" />
<br/><br/>
-
+
<h:outputText value="Data Table test" />
<br />
@@ -37,7 +37,7 @@
<h:outputText value="#{data.number1}" />
<f:facet name="footer">
<h:outputText value="Number 1 end" />
- </f:facet>
+ </f:facet>
</h:column>
<h:column>
<f:facet name="header">
@@ -46,7 +46,7 @@
<h:outputText value="#{data.number2}" />
<f:facet name="footer">
<h:outputText value="Number 2 end" />
- </f:facet>
+ </f:facet>
</h:column>
<h:column>
<f:facet name="header">
@@ -55,28 +55,35 @@
<h:outputText value="#{data.number3}" />
<f:facet name="footer">
<h:outputText value="Number 3 end" />
- </f:facet>
+ </f:facet>
</h:column>
<f:facet name="footer">
- <ds:datascroller for="master" rendered="true" fastStep="2" actionListener="#{testBean.onAction}" renderIfSinglePage="#{testBean.renderIfSinglePage}" scrollerListener="#{testBean.doScroll}" maxPages="#{testBean.maxpage}"/>
+ <ds:datascroller 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>
- <br />
+ <br />
+ <h:outputText value="Actions:" style="font-weight: bold;" />
+ <h:outputText id="actionCount" value="#{testBean.actionCount}" />
+ <br />
+ <h:outputText value="Events:" style="font-weight: bold;" />
+ <h:outputText id="eventCount" value="#{testBean.eventCount}" />
+ <br />
- <h:panelGrid columns="2" border="0">
+ <h:panelGrid columns="2" border="0">
+
<h:outputText value="render if single page" style="font-weight: bold;" />
- <h:inputText value="#{testBean.renderIfSinglePage}"/>
-
+ <h:inputText value="#{testBean.renderIfSinglePage}"/>
+
<h:outputText value="Rows" style="font-weight: bold;" />
- <h:inputText value="#{testBean.rows}"/>
-
+ <h:inputText value="#{testBean.rows}"/>
+
<h:outputText value="Max page" style="font-weight: bold;" />
- <h:inputText value="#{testBean.maxpage}"/>
+ <h:inputText value="#{testBean.maxpage}"/>
- </h:panelGrid>
+ </h:panelGrid>
<h:commandLink value="apply" />
@@ -85,4 +92,4 @@
</h:form>
</f:view>
</body>
-</html>
\ No newline at end of file
+</html>
Property changes on: trunk/sandbox/api
___________________________________________________________________
Name: svn:ignore
- target
+ target
.classpath
.project
.settings
Modified: trunk/ui/dataTable/src/main/resources/org/richfaces/renderkit/html/css/table.xcss
===================================================================
--- trunk/ui/dataTable/src/main/resources/org/richfaces/renderkit/html/css/table.xcss 2007-07-18 12:27:31 UTC (rev 1670)
+++ trunk/ui/dataTable/src/main/resources/org/richfaces/renderkit/html/css/table.xcss 2007-07-18 12:51:45 UTC (rev 1671)
@@ -3,22 +3,26 @@
xmlns:u='http:/jsf.exadel.com/template/util'
xmlns="http://www.w3.org/1999/xhtml" >
<u:selector name=".dr-table" >
- <u:style name="border-top" value="1px solid"> <!--tableBorderColor-->
- <f:verbatim skin="tableBorderColor" />
+ <u:style name="border-top" value="solid"> <!--tableBorderColor-->
+ <f:verbatim skin="tableBorderWidth" />
+ <f:verbatim skin="tableBorderColor" />
</u:style>
- <u:style name="border-left" value="1px solid"> <!--tableBorderColor-->
- <f:verbatim skin="tableBorderColor" />
+ <u:style name="border-left" value="solid"> <!--tableBorderColor-->
+ <f:verbatim skin="tableBorderWidth" />
+ <f:verbatim skin="tableBorderColor" />
</u:style>
<u:style name="background-color" skin="tableBackgroundColor" /> <!--tableBackgroundColor-->
<u:style name="border-collapse" value="collapse" />
</u:selector>
<u:selector name=".dr-table-cell" >
- <u:style name="border-right" value="1px solid"> <!--tableBorderColor-->
- <f:verbatim skin="tableBorderColor" />
+ <u:style name="border-right" value="solid"> <!--tableBorderColor-->
+ <f:verbatim skin="tableBorderWidth" />
+ <f:verbatim skin="tableBorderColor" />
</u:style>
- <u:style name="border-bottom" value="1px solid"> <!--tableBorderColor-->
- <f:verbatim skin="tableBorderColor" />
+ <u:style name="border-bottom" value="solid"> <!--tableBorderColor-->
+ <f:verbatim skin="tableBorderWidth" />
+ <f:verbatim skin="tableBorderColor" />
</u:style>
<u:style name="padding" value="4px 4px 4px 4px"/>
<u:style name="font-size" skin="generalSizeFont"/> <!--generalSizeFont-->
@@ -28,11 +32,13 @@
</u:selector>
<u:selector name=".dr-subtable-cell" >
- <u:style name="border-right" value="1px solid"> <!--tableBorderColor-->
- <f:verbatim skin="tableBorderColor" />
+ <u:style name="border-right" value="solid"> <!--tableBorderColor-->
+ <f:verbatim skin="tableBorderWidth" />
+ <f:verbatim skin="tableBorderColor" />
</u:style>
- <u:style name="border-bottom" value="1px solid"> <!--tableBorderColor-->
- <f:verbatim skin="tableBorderColor" />
+ <u:style name="border-bottom" value="solid"> <!--tableBorderColor-->
+ <f:verbatim skin="tableBorderWidth" />
+ <f:verbatim skin="tableBorderColor" />
</u:style>
<u:style name="padding" value="4px 4px 4px 4px"/>
<u:style name="font-size" skin="generalSizeFont"/> <!--generalSizeFont-->
@@ -54,11 +60,13 @@
</u:selector>
<u:selector name=".dr-table-headercell" >
- <u:style name="border-right" value="1px solid"> <!--tableBorderColor-->
- <f:verbatim skin="tableBorderColor" />
+ <u:style name="border-right" value="solid"> <!--tableBorderColor-->
+ <f:verbatim skin="tableBorderWidth" />
+ <f:verbatim skin="tableBorderColor" />
</u:style>
- <u:style name="border-bottom" value="1px solid"> <!--tableBorderColor-->
- <f:verbatim skin="tableBorderColor" />
+ <u:style name="border-bottom" value="solid"> <!--tableBorderColor-->
+ <f:verbatim skin="tableBorderWidth" />
+ <f:verbatim skin="tableBorderColor" />
</u:style>
<u:style name="padding" value="4px 4px 4px 4px"/>
<u:style name="color" skin="headerTextColor"/> <!--headerTextColor-->
@@ -73,11 +81,13 @@
</u:selector>
<u:selector name=".dr-table-subheadercell" >
- <u:style name="border-right" value="1px solid"> <!--tableBorderColor-->
- <f:verbatim skin="tableBorderColor" />
+ <u:style name="border-right" value="solid"> <!--tableBorderColor-->
+ <f:verbatim skin="tableBorderWidth" />
+ <f:verbatim skin="tableBorderColor" />
</u:style>
- <u:style name="border-bottom" value="1px solid"> <!--tableBorderColor-->
- <f:verbatim skin="tableBorderColor" />
+ <u:style name="border-bottom" value="solid"> <!--tableBorderColor-->
+ <f:verbatim skin="tableBorderWidth" />
+ <f:verbatim skin="tableBorderColor" />
</u:style>
<u:style name="padding" value="4px 4px 4px 4px"/>
<u:style name="text-align" value="center"/>
@@ -96,11 +106,13 @@
</u:selector>
<u:selector name=".dr-table-footercell" >
- <u:style name="border-right" value="1px solid"> <!--tableBorderColor-->
- <f:verbatim skin="tableBorderColor" />
+ <u:style name="border-right" value="solid"> <!--tableBorderColor-->
+ <f:verbatim skin="tableBorderWidth" />
+ <f:verbatim skin="tableBorderColor" />
</u:style>
- <u:style name="border-bottom" value="1px solid"> <!--tableBorderColor-->
- <f:verbatim skin="tableBorderColor" />
+ <u:style name="border-bottom" value="solid"> <!--tableBorderColor-->
+ <f:verbatim skin="tableBorderWidth" />
+ <f:verbatim skin="tableBorderColor" />
</u:style>
<u:style name="padding" value="4px 4px 4px 4px"/>
<u:style name="color" skin="generalTextColor"/> <!--headerTextColor-->
@@ -115,11 +127,13 @@
</u:selector>
<u:selector name=".dr-table-subfootercell" >
- <u:style name="border-right" value="1px solid"> <!--tableBorderColor-->
- <f:verbatim skin="tableBorderColor" />
+ <u:style name="border-right" value="solid"> <!--tableBorderColor-->
+ <f:verbatim skin="tableBorderWidth" />
+ <f:verbatim skin="tableBorderColor" />
</u:style>
- <u:style name="border-bottom" value="1px solid"> <!--tableBorderColor-->
- <f:verbatim skin="tableBorderColor" />
+ <u:style name="border-bottom" value="solid"> <!--tableBorderColor-->
+ <f:verbatim skin="tableBorderWidth" />
+ <f:verbatim skin="tableBorderColor" />
</u:style>
<u:style name="padding" value="4px 4px 4px 4px"/>
<u:style name="text-align" value="left"/>
@@ -143,11 +157,13 @@
</u:selector>
<u:selector name=".dr-subtable-headercell" >
- <u:style name="border-right" value="1px solid"> <!--tableBorderColor-->
- <f:verbatim skin="tableBorderColor" />
+ <u:style name="border-right" value="solid"> <!--tableBorderColor-->
+ <f:verbatim skin="tableBorderWidth" />
+ <f:verbatim skin="tableBorderColor" />
</u:style>
- <u:style name="border-bottom" value="1px solid"> <!--tableBorderColor-->
- <f:verbatim skin="tableBorderColor" />
+ <u:style name="border-bottom" value="solid"> <!--tableBorderColor-->
+ <f:verbatim skin="tableBorderWidth" />
+ <f:verbatim skin="tableBorderColor" />
</u:style>
<u:style name="padding" value="4px 4px 4px 4px"/>
<u:style name="text-align" value="center"/>
@@ -162,14 +178,16 @@
</u:selector>
<u:selector name=".dr-subtable-footercell" >
- <u:style name="border-right" value="1px solid"> <!--tableBorderColor-->
- <f:verbatim skin="tableBorderColor" />
+ <u:style name="border-right" value="solid"> <!--tableBorderColor-->
+ <f:verbatim skin="tableBorderWidth" />
+ <f:verbatim skin="tableBorderColor" />
</u:style>
- <u:style name="border-bottom" value="1px solid"> <!--tableBorderColor-->
- <f:verbatim skin="tableBorderColor" />
+ <u:style name="border-bottom" value="solid"> <!--tableBorderColor-->
+ <f:verbatim skin="tableBorderWidth" />
+ <f:verbatim skin="tableBorderColor" />
</u:style>
<u:style name="padding" value="4px 4px 4px 4px"/>
<u:style name="text-align" value="left"/>
</u:selector>
-</f:template>
\ No newline at end of file
+</f:template>
Modified: trunk/ui/datascroller/src/main/java/org/richfaces/renderkit/html/DataScrollerRenderer.java
===================================================================
--- trunk/ui/datascroller/src/main/java/org/richfaces/renderkit/html/DataScrollerRenderer.java 2007-07-18 12:27:31 UTC (rev 1670)
+++ trunk/ui/datascroller/src/main/java/org/richfaces/renderkit/html/DataScrollerRenderer.java 2007-07-18 12:51:45 UTC (rev 1671)
@@ -21,14 +21,6 @@
package org.richfaces.renderkit.html;
-import java.io.IOException;
-import java.util.Map;
-
-import javax.faces.component.UIComponent;
-import javax.faces.component.UIData;
-import javax.faces.context.FacesContext;
-import javax.faces.context.ResponseWriter;
-
import org.ajax4jsf.javascript.JSFunction;
import org.ajax4jsf.renderkit.AjaxRendererUtils;
import org.ajax4jsf.renderkit.ComponentVariables;
@@ -37,253 +29,283 @@
import org.richfaces.component.UIDatascroller;
import org.richfaces.event.DataScrollerEvent;
+import javax.faces.component.UIComponent;
+import javax.faces.component.UIData;
+import javax.faces.context.FacesContext;
+import javax.faces.context.ResponseWriter;
+import javax.faces.event.PhaseId;
+import java.io.IOException;
+import java.util.Map;
+
public class DataScrollerRenderer extends HeaderResourcesRendererBase {
- protected Class getComponentClass() {
- return UIDatascroller.class;
- }
+ protected Class getComponentClass() {
+ return UIDatascroller.class;
+ }
- public void encodeBegin(FacesContext context, UIComponent component)
- throws IOException {
+ public void encodeBegin(FacesContext context, UIComponent component)
+ throws IOException {
- UIDatascroller scroller = (UIDatascroller) component;
+ UIDatascroller scroller = (UIDatascroller) component;
- UIData dataTable = scroller.getDataTable();
+ UIData dataTable = scroller.getDataTable();
- ComponentVariables variables = ComponentsVariableResolver.getVariables(this, component);
- variables.setVariable("dataTable", dataTable);
- if (!(scroller.getPageCount(dataTable) == 1) || (scroller.isRenderIfSinglePage()))
- {
- variables.setVariable("rendered", Boolean.TRUE);
- super.encodeBegin(context, component);
- }
- }
+ ComponentVariables variables = ComponentsVariableResolver.getVariables(
+ this, component);
+ variables.setVariable("dataTable", dataTable);
+ if (scroller.isRendered()) {
+ variables.setVariable("rendered", Boolean.TRUE);
+ super.encodeBegin(context, component);
+ }
+ }
- public void encodeEnd(FacesContext context, UIComponent component)
- throws IOException {
- ComponentVariables variables = ComponentsVariableResolver.getVariables(this, component);
+ public void encodeEnd(FacesContext context, UIComponent component)
+ throws IOException {
+ ComponentVariables variables = ComponentsVariableResolver.getVariables(
+ this, component);
- if (Boolean.TRUE.equals(variables.getVariable("rendered")))
- {
- super.encodeEnd(context, component);
- }
- }
+ if (Boolean.TRUE.equals(variables.getVariable("rendered"))) {
+ super.encodeEnd(context, component);
+ }
+ }
- public void decode(FacesContext context, UIComponent component) {
+ public void doDecode(FacesContext context, UIComponent component) {
- String param = (String) getParamMap(context).get(
- component.getClientId(context));
- UIDatascroller scroller = (UIDatascroller) component;
+ String param = (String) getParamMap(context).get(
+ component.getClientId(context));
+ UIDatascroller scroller = (UIDatascroller) component;
- if (param != null) {
- new DataScrollerEvent(scroller, String.valueOf(scroller.getPageIndex()), param).queue();
- }
- }
+ if (param != null) {
+ DataScrollerEvent event = new DataScrollerEvent(scroller,
+ String.valueOf(scroller.getPageIndex()), param);
+ if (scroller.isImmediate()) {
+ event.setPhaseId(PhaseId.APPLY_REQUEST_VALUES);
+ } else {
+ event.setPhaseId(PhaseId.INVOKE_APPLICATION);
+ }
- public ControlsState getControlsState(FacesContext context, UIDatascroller datascroller, UIData dataTable) {
- int pageIndex = datascroller.getPageIndex(dataTable);
- int pageCount = datascroller.getPageCount(dataTable);
- int minPageIdx = 1;
- int maxPageIdx = pageCount;
- int fastStep = datascroller.getFastStep();
- if (fastStep <= 1) {
- fastStep = 1;
- }
+ component.queueEvent(event);
+ }
+ }
- boolean useFirst = true;
- boolean useLast = true;
+ public ControlsState getControlsState(FacesContext context,
+ UIDatascroller datascroller, UIData dataTable) {
+ int pageIndex = datascroller.getPageIndex(dataTable);
+ int pageCount = datascroller.getPageCount(dataTable);
+ int minPageIdx = 1;
+ int maxPageIdx = pageCount;
+ int fastStep = datascroller.getFastStep();
+ if (fastStep <= 1) {
+ fastStep = 1;
+ }
- boolean useBackFast = true;
- boolean useForwFast = true;
+ boolean useFirst = true;
+ boolean useLast = true;
- ControlsState controlsState = new ControlsState();
-
- if (pageIndex <= minPageIdx) {
- useFirst = false;
- }
+ boolean useBackFast = true;
+ boolean useForwFast = true;
- if (pageIndex >= maxPageIdx) {
- useLast = false;
- }
+ ControlsState controlsState = new ControlsState();
- if (pageIndex - fastStep < minPageIdx) {
- useBackFast = false;
- }
+ if (pageIndex <= minPageIdx) {
+ useFirst = false;
+ }
- if (pageIndex + fastStep > maxPageIdx) {
- useForwFast = false;
- }
+ if (pageIndex >= maxPageIdx) {
+ useLast = false;
+ }
- boolean isAuto;
- String boundaryControls = datascroller.getBoundaryControls();
- String stepControls = datascroller.getStepControls();
- String fastControls = datascroller.getFastControls();
-
- if ((isAuto = "auto".equals(boundaryControls)) || "show".equals(boundaryControls)) {
- if (isAuto) {
- controlsState.setFirstRendered(useFirst);
- controlsState.setLastRendered(useLast);
- }
+ if (pageIndex - fastStep < minPageIdx) {
+ useBackFast = false;
+ }
- controlsState.setFirstEnabled(useFirst);
- controlsState.setLastEnabled(useLast);
- } else {
- controlsState.setFirstRendered(false);
- controlsState.setLastRendered(false);
- }
+ if (pageIndex + fastStep > maxPageIdx) {
+ useForwFast = false;
+ }
- if ((isAuto = "auto".equals(stepControls)) || "show".equals(stepControls)) {
- if (isAuto) {
- controlsState.setPreviousRendered(useFirst);
- controlsState.setNextRendered(useLast);
- }
+ boolean isAuto;
+ String boundaryControls = datascroller.getBoundaryControls();
+ String stepControls = datascroller.getStepControls();
+ String fastControls = datascroller.getFastControls();
- controlsState.setPreviousEnabled(useFirst);
- controlsState.setNextEnabled(useLast);
- } else {
- controlsState.setPreviousRendered(false);
- controlsState.setNextRendered(false);
- }
+ if ((isAuto = "auto".equals(boundaryControls)) || "show".equals(
+ boundaryControls)) {
+ if (isAuto) {
+ controlsState.setFirstRendered(useFirst);
+ controlsState.setLastRendered(useLast);
+ }
- if ((isAuto = "auto".equals(fastControls)) || "show".equals(fastControls)) {
- if (isAuto) {
- controlsState.setFastForwardRendered(useForwFast);
- controlsState.setFastRewindRendered(useBackFast);
- }
+ controlsState.setFirstEnabled(useFirst);
+ controlsState.setLastEnabled(useLast);
+ } else {
+ controlsState.setFirstRendered(false);
+ controlsState.setLastRendered(false);
+ }
- controlsState.setFastForwardEnabled(useForwFast);
- controlsState.setFastRewindEnabled(useBackFast);
- } else {
- controlsState.setFastForwardRendered(false);
- controlsState.setFastRewindRendered(false);
- }
-
- return controlsState;
- }
+ if ((isAuto = "auto".equals(stepControls)) || "show".equals(
+ stepControls)) {
+ if (isAuto) {
+ controlsState.setPreviousRendered(useFirst);
+ controlsState.setNextRendered(useLast);
+ }
- public void renderPager(FacesContext context, UIComponent component) throws IOException {
- ComponentVariables variables = ComponentsVariableResolver.getVariables(this, component);
- UIData data = (UIData) variables.getVariable("dataTable");
+ controlsState.setPreviousEnabled(useFirst);
+ controlsState.setNextEnabled(useLast);
+ } else {
+ controlsState.setPreviousRendered(false);
+ controlsState.setNextRendered(false);
+ }
- ResponseWriter out = context.getResponseWriter();
- UIDatascroller scroller = (UIDatascroller) component;
- int currentPage = scroller.getPageIndex(data);
+ if ((isAuto = "auto".equals(fastControls)) || "show".equals(
+ fastControls)) {
+ if (isAuto) {
+ controlsState.setFastForwardRendered(useForwFast);
+ controlsState.setFastRewindRendered(useBackFast);
+ }
- int maxPages = scroller.getMaxPages();
- if (maxPages <= 1) {
- maxPages = 1;
- }
- int pageCount = scroller.getPageCount(data);
- if (pageCount <= 1) {
- return;
- }
+ controlsState.setFastForwardEnabled(useForwFast);
+ controlsState.setFastRewindEnabled(useBackFast);
+ } else {
+ controlsState.setFastForwardRendered(false);
+ controlsState.setFastRewindRendered(false);
+ }
- int delta = maxPages / 2;
+ return controlsState;
+ }
- int pages;
- int start;
- if (pageCount > maxPages && currentPage > delta) {
- pages = maxPages;
- start = currentPage - pages / 2 - 1;
- if (start + pages > pageCount) {
- start = pageCount - pages;
- }
- } else {
- pages = pageCount < maxPages ? pageCount : maxPages;
- start = 0;
- }
+ public void renderPager(FacesContext context, UIComponent component)
+ throws IOException {
+ ComponentVariables variables = ComponentsVariableResolver.getVariables(
+ this, component);
+ UIData data = (UIData) variables.getVariable("dataTable");
- for (int i = start, size = start + pages; i < size; i++) {
- //String styleClass;
- //String style;
+ ResponseWriter out = context.getResponseWriter();
+ UIDatascroller scroller = (UIDatascroller) component;
+ int currentPage = scroller.getPageIndex(data);
- boolean isCurrentPage = (i + 1 == currentPage);
- /*
- if (isCurrentPage) {
- styleClass = scroller.getSelectedStyleClass();
- style = scroller.getSelectedStyle();
- }
- else {
- styleClass = scroller.getStyleClass();
- style = scroller.getStyle();
- }
+ int maxPages = scroller.getMaxPages();
+ if (maxPages <= 1) {
+ maxPages = 1;
+ }
+ int pageCount = scroller.getPageCount(data);
+ if (pageCount <= 1) {
+ return;
+ }
- if (style==null){
- style="";
- }
- if (styleClass==null){
- styleClass="";
- }
- */
+ int delta = maxPages / 2;
- out.startElement("td", component);
- if (isCurrentPage) {
- out.writeAttribute("align", "center", null);
- //out.writeAttribute("class", "dr-dscr-act rich-datascr-act "+scroller.getStyleClass(), null);
- out.writeAttribute("class", "dr-dscr-act rich-datascr-act", null);
- out.writeAttribute("style", "" + scroller.getSelectedStyle(), null);
- } else {
- out.writeAttribute("align", "center", null);
- //out.writeAttribute("class", "dr-dscr-inact rich-datascr-inact "+scroller.getStyleClass(), null);
- out.writeAttribute("class", "dr-dscr-inact rich-datascr-inact", null);
- //out.writeAttribute("style", ""+scroller.getStyle(), null);
- out.writeAttribute("onclick", getOnClick(context, component, Integer.toString(i + 1)), null);
- }
- out.writeText(Integer.toString(i + 1), null);
- //renderChild(context, link);
- out.endElement("td");
- }
+ int pages;
+ int start;
+ if (pageCount > maxPages && currentPage > delta) {
+ pages = maxPages;
+ start = currentPage - pages / 2 - 1;
+ if (start + pages > pageCount) {
+ start = pageCount - pages;
+ }
+ } else {
+ pages = pageCount < maxPages ? pageCount : maxPages;
+ start = 0;
+ }
- }
+ for (int i = start, size = start + pages; i < size; i++) {
+ //String styleClass;
+ //String style;
- public void renderPages(FacesContext context, UIComponent component) throws IOException {
- ComponentVariables variables = ComponentsVariableResolver.getVariables(this, component);
- UIData data = (UIData) variables.getVariable("dataTable");
+ boolean isCurrentPage = (i + 1 == currentPage);
+ /*
+ if (isCurrentPage) {
+ styleClass = scroller.getSelectedStyleClass();
+ style = scroller.getSelectedStyle();
+ }
+ else {
+ styleClass = scroller.getStyleClass();
+ style = scroller.getStyle();
+ }
- ResponseWriter out = context.getResponseWriter();
- UIDatascroller scroller = (UIDatascroller) component;
- int currentPage = scroller.getPageIndex(data);
+ if (style==null){
+ style="";
+ }
+ if (styleClass==null){
+ styleClass="";
+ }
+ */
- int pageCount = scroller.getPageCount(data);
- if (pageCount <= 1) {
- pageCount = 1;
- }
- String varName = (String)scroller.getAttributes().get("pageIndexVar");
- if (varName != null && varName.length()>0)
- context.getExternalContext()
- .getRequestMap().put(varName, new Integer(currentPage));
- varName = (String)scroller.getAttributes().get("pagesVar");
- if (varName != null && varName.length()>0)
- context.getExternalContext()
- .getRequestMap().put(varName, new Integer(pageCount));
- }
+ out.startElement("td", component);
+ if (isCurrentPage) {
+ out.writeAttribute("align", "center", null);
+ //out.writeAttribute("class", "dr-dscr-act rich-datascr-act "+scroller.getStyleClass(), null);
+ out.writeAttribute("class", "dr-dscr-act rich-datascr-act",
+ null);
+ out.writeAttribute("style", "" + scroller.getSelectedStyle(),
+ null);
+ } else {
+ out.writeAttribute("align", "center", null);
+ //out.writeAttribute("class", "dr-dscr-inact rich-datascr-inact "+scroller.getStyleClass(), null);
+ out.writeAttribute("class", "dr-dscr-inact rich-datascr-inact",
+ null);
+ //out.writeAttribute("style", ""+scroller.getStyle(), null);
+ out.writeAttribute("onclick", getOnClick(context, component,
+ Integer.toString(i + 1)), null);
+ }
+ out.writeText(Integer.toString(i + 1), null);
+ //renderChild(context, link);
+ out.endElement("td");
+ }
- private Map getParamMap(FacesContext context) {
- return context.getExternalContext().getRequestParameterMap();
- }
+ }
- public String getOnClick(FacesContext context, UIComponent component, String value) {
+ public void renderPages(FacesContext context, UIComponent component)
+ throws IOException {
+ ComponentVariables variables = ComponentsVariableResolver.getVariables(
+ this, component);
+ UIData data = (UIData) variables.getVariable("dataTable");
- JSFunction function = AjaxRendererUtils.buildAjaxFunction(component,
- context);
- UIDatascroller scroller = (UIDatascroller) component;
- Map eventOptions = AjaxRendererUtils.buildEventOptions(context, component);
- Map parameters = (Map) eventOptions.get("parameters");
- parameters.put(scroller.getClientId(context), value);
- function.addParameter(eventOptions);
- StringBuffer buffer = new StringBuffer();
- function.appendScript(buffer);
- buffer.append("; return false;");
- String script = buffer.toString();
- return script;
- }
+ ResponseWriter out = context.getResponseWriter();
+ UIDatascroller scroller = (UIDatascroller) component;
+ int currentPage = scroller.getPageIndex(data);
+ int pageCount = scroller.getPageCount(data);
+ if (pageCount <= 1) {
+ pageCount = 1;
+ }
+ String varName = (String) scroller.getAttributes().get("pageIndexVar");
+ if (varName != null && varName.length() > 0) {
+ context.getExternalContext()
+ .getRequestMap().put(varName, new Integer(currentPage));
+ }
+ varName = (String) scroller.getAttributes().get("pagesVar");
+ if (varName != null && varName.length() > 0) {
+ context.getExternalContext()
+ .getRequestMap().put(varName, new Integer(pageCount));
+ }
+ }
- /**
- * Creates HtmlAjaxCommandLink sets its id, value and reRender and UIParameter
- */
- public boolean getRendersChildren() {
- return true;
- }
+ private Map getParamMap(FacesContext context) {
+ return context.getExternalContext().getRequestParameterMap();
+ }
+
+ public String getOnClick(FacesContext context, UIComponent component,
+ String value) {
+
+ JSFunction function = AjaxRendererUtils.buildAjaxFunction(component,
+ context);
+ UIDatascroller scroller = (UIDatascroller) component;
+ Map eventOptions = AjaxRendererUtils.buildEventOptions(context,
+ component);
+ Map parameters = (Map) eventOptions.get("parameters");
+ parameters.put(scroller.getClientId(context), value);
+ function.addParameter(eventOptions);
+ StringBuffer buffer = new StringBuffer();
+ function.appendScript(buffer);
+ buffer.append("; return false;");
+ String script = buffer.toString();
+ return script;
+ }
+
+
+ /** Creates HtmlAjaxCommandLink sets its id, value and reRender and UIParameter */
+ public boolean getRendersChildren() {
+ return true;
+ }
}
Modified: trunk/ui/drag-drop/src/main/java/org/richfaces/renderkit/DragIndicatorRendererBase.java
===================================================================
--- trunk/ui/drag-drop/src/main/java/org/richfaces/renderkit/DragIndicatorRendererBase.java 2007-07-18 12:27:31 UTC (rev 1670)
+++ trunk/ui/drag-drop/src/main/java/org/richfaces/renderkit/DragIndicatorRendererBase.java 2007-07-18 12:51:45 UTC (rev 1671)
@@ -133,6 +133,7 @@
if (facet != null && facet.isRendered()) {
writeScriptBody(context, facet, false);
+ responseWriter.write(";\n");
} else {
responseWriter.write(" DefaultDragIndicatorView;");
}
Modified: trunk/ui/drag-drop/src/main/java/org/richfaces/renderkit/DraggableRendererContributor.java
===================================================================
--- trunk/ui/drag-drop/src/main/java/org/richfaces/renderkit/DraggableRendererContributor.java 2007-07-18 12:27:31 UTC (rev 1670)
+++ trunk/ui/drag-drop/src/main/java/org/richfaces/renderkit/DraggableRendererContributor.java 2007-07-18 12:51:45 UTC (rev 1671)
@@ -112,9 +112,10 @@
public String[] getScriptDependencies() {
return new String[] {
PrototypeScript.class.getName(),
- "/org/richfaces/renderkit/html/scripts/json/json.js",
+ "/org/richfaces/renderkit/html/scripts/json/json-mini.js",
DnDScript.class.getName(),
"/org/richfaces/renderkit/html/scripts/utils.js",
+ "/org/richfaces/renderkit/html/scripts/json/json-dom.js",
"/org/richfaces/renderkit/html/scripts/dnd/dnd-common.js",
"/org/richfaces/renderkit/html/scripts/dnd/dnd-draggable.js"
};
Modified: trunk/ui/drag-drop/src/main/java/org/richfaces/renderkit/DropzoneRendererContributor.java
===================================================================
--- trunk/ui/drag-drop/src/main/java/org/richfaces/renderkit/DropzoneRendererContributor.java 2007-07-18 12:27:31 UTC (rev 1670)
+++ trunk/ui/drag-drop/src/main/java/org/richfaces/renderkit/DropzoneRendererContributor.java 2007-07-18 12:51:45 UTC (rev 1671)
@@ -188,9 +188,10 @@
public String[] getScriptDependencies() {
return new String[] {
PrototypeScript.class.getName(),
- "/org/richfaces/renderkit/html/scripts/json/json.js",
+ "/org/richfaces/renderkit/html/scripts/json/json-mini.js",
DnDScript.class.getName(),
"/org/richfaces/renderkit/html/scripts/utils.js",
+ "/org/richfaces/renderkit/html/scripts/json/json-dom.js",
"/org/richfaces/renderkit/html/scripts/dnd/dnd-common.js",
"/org/richfaces/renderkit/html/scripts/dnd/dnd-dropzone.js"
};
Modified: trunk/ui/drag-drop/src/test/java/org/richfaces/component/DragDropTest.java
===================================================================
--- trunk/ui/drag-drop/src/test/java/org/richfaces/component/DragDropTest.java 2007-07-18 12:27:31 UTC (rev 1670)
+++ trunk/ui/drag-drop/src/test/java/org/richfaces/component/DragDropTest.java 2007-07-18 12:51:45 UTC (rev 1671)
@@ -50,7 +50,7 @@
.add("scripts/simple-draggable.js");
javaScripts
.add("scripts/simple-dropzone.js");
- javaScripts.add("scripts/json/json.js");
+ javaScripts.add("scripts/json/json-mini.js");
javaScripts
.add("scripts/dnd/dnd-common.js");
javaScripts
Modified: trunk/ui/inputnumber-slider/src/main/config/component/inputNumberSlider.xml
===================================================================
--- trunk/ui/inputnumber-slider/src/main/config/component/inputNumberSlider.xml 2007-07-18 12:27:31 UTC (rev 1670)
+++ trunk/ui/inputnumber-slider/src/main/config/component/inputNumberSlider.xml 2007-07-18 12:51:45 UTC (rev 1671)
@@ -241,7 +241,7 @@
</property>
<property hidden="true">
<name>valid</name>
- <classname>java.lang.String</classname>
+ <classname>boolean</classname>
</property>
</component>
-</components>
\ No newline at end of file
+</components>
Modified: trunk/ui/inputnumber-slider/src/main/java/org/richfaces/renderkit/InputNumberSliderRendererBase.java
===================================================================
--- trunk/ui/inputnumber-slider/src/main/java/org/richfaces/renderkit/InputNumberSliderRendererBase.java 2007-07-18 12:27:31 UTC (rev 1670)
+++ trunk/ui/inputnumber-slider/src/main/java/org/richfaces/renderkit/InputNumberSliderRendererBase.java 2007-07-18 12:51:45 UTC (rev 1671)
@@ -22,6 +22,7 @@
package org.richfaces.renderkit;
import javax.faces.component.UIComponent;
+import javax.faces.context.FacesContext;
import org.richfaces.component.UIInputNumberSlider;
@@ -39,5 +40,9 @@
protected boolean attributeToBoolean(UIComponent component, String attributeName) {
return getUtils().isBooleanAttribute(component, attributeName);
}
+
+ public String writeSpace() {
+ return " ";
+ }
-}
\ No newline at end of file
+}
Modified: trunk/ui/inputnumber-slider/src/main/resources/org/richfaces/renderkit/html/script/SliderScript.js
===================================================================
--- trunk/ui/inputnumber-slider/src/main/resources/org/richfaces/renderkit/html/script/SliderScript.js 2007-07-18 12:27:31 UTC (rev 1670)
+++ trunk/ui/inputnumber-slider/src/main/resources/org/richfaces/renderkit/html/script/SliderScript.js 2007-07-18 12:51:45 UTC (rev 1671)
@@ -86,9 +86,7 @@
Event.observe(this.input, "change", this.eventInputChange);
}
this.initialized = true;
- this.setInitialValue();
- if (RichFaces.navigatorType() == "MSIE")
- Event.observe(window, "load", this.setInitialValue.bindAsEventListener(this)); //FIX RFA-190
+ Event.observe(window, "load", this.setInitialValue.bindAsEventListener(this)); //FIX RFA-190
//Event.observe($(input), "propertychange", this.setInitialValue.bindAsEventListener(this));
},
@@ -144,6 +142,13 @@
getNearestValue: function(value){
var pos;
pos = this.binsearch(this.availableValues, value);
+ if (pos>0) {
+ var prevPos = pos-1;
+ if ( Math.abs(value-this.availableValues[prevPos])<
+ Math.abs(this.availableValues[pos]-value) ) {
+ pos = prevPos;
+ }
+ }
return this.roundFloat(this.availableValues[pos]);
},
@@ -357,4 +362,4 @@
return str.replace(/^\s+|\s+$/, '');
}
-}
\ No newline at end of file
+}
Modified: trunk/ui/inputnumber-slider/src/main/templates/inputNumberSlider.jspx
===================================================================
--- trunk/ui/inputnumber-slider/src/main/templates/inputNumberSlider.jspx 2007-07-18 12:27:31 UTC (rev 1670)
+++ trunk/ui/inputnumber-slider/src/main/templates/inputNumberSlider.jspx 2007-07-18 12:51:45 UTC (rev 1671)
@@ -68,8 +68,8 @@
style="#{component.attributes['inputStyle']}; #{color}"
readonly="#{inputReadOnly}"
disabled="#{disabled}"
- onselect="#{component.attributes['onselect']}"
- onfocus="#{component.attributes['onfocus']}"
+ onselect="#{component.attributes['onselect']}"
+ onfocus="#{component.attributes['onfocus']}"
onblur="#{component.attributes['onblur']}"
accesskey="#{component.attributes['accesskey']}"
size="#{inputSize}"
@@ -96,9 +96,9 @@
<td id="#{clientId}Track">
<div style="position : relative">
<div id="#{clientId}Tip" class="dr-insldr-tip rich-inslider-tip #{component.attributes['tipClass']}" style="display: none;#{component.attributes['tipStyle']}">
-  </div>
+ #{this:writeSpace()}</div>
<div class="dr-insldr-handler rich-inslider-handler #{component.attributes['handleClass']}" id="#{clientId}Handle">
-  </div>
+ #{this:writeSpace()}</div>
</div>
<div class="dr-insldr-track rich-inslider-track #{component.attributes['barClass']}" style="#{component.attributes['barStyle']}">
<table class="dr-insldr-track-decor-1" cellpadding="0" cellspacing="0">
Modified: trunk/ui/modal-panel/src/main/config/component/modalPanel.xml
===================================================================
--- trunk/ui/modal-panel/src/main/config/component/modalPanel.xml 2007-07-18 12:27:31 UTC (rev 1670)
+++ trunk/ui/modal-panel/src/main/config/component/modalPanel.xml 2007-07-18 12:51:45 UTC (rev 1671)
@@ -183,7 +183,21 @@
</description>
<defaultvalue><![CDATA[""]]></defaultvalue>
</property>
-
+ <property>
+ <name>showWhenRendered</name>
+ <classname>boolean</classname>
+ <description>
+ iA "true" value for this attribute makes a modal panel opened as default.
+ </description>
+ <defaultvalue>false</defaultvalue>
+ </property>
+ <property>
+ <name>keepVisualState</name>
+ <classname>boolean</classname>
+ <description>
+ </description>
+ <defaultvalue>false</defaultvalue>
+ </property>
</component>
</components>
Modified: trunk/ui/modal-panel/src/main/java/org/richfaces/component/UIModalPanel.java
===================================================================
--- trunk/ui/modal-panel/src/main/java/org/richfaces/component/UIModalPanel.java 2007-07-18 12:27:31 UTC (rev 1670)
+++ trunk/ui/modal-panel/src/main/java/org/richfaces/component/UIModalPanel.java 2007-07-18 12:51:45 UTC (rev 1671)
@@ -21,7 +21,10 @@
package org.richfaces.component;
-import javax.faces.component.UIComponentBase;
+import java.util.HashMap;
+import java.util.Map;
+
+import javax.faces.component.UIInput;
import javax.faces.context.FacesContext;
import org.richfaces.skin.Skin;
@@ -31,12 +34,14 @@
* JSF component class
*
*/
-public abstract class UIModalPanel extends UIComponentBase {
+public abstract class UIModalPanel extends UIInput {
public static final String COMPONENT_TYPE = "org.richfaces.ModalPanel";
private static final String COMPONENT_FAMILY = "org.richfaces.ModalPanel";
+ private Map visualOptions;
+
/**
* Shadow depth.
*/
@@ -68,6 +73,12 @@
public abstract int getZindex();
public abstract void setZindex(int zindex);
+
+ public abstract boolean isShowWhenRendered();
+ public abstract void setShowWhenRendered(boolean opened);
+
+ public abstract boolean isKeepVisualState();
+ public abstract void setKeepVisualState(boolean keepVisualState);
public boolean getRendersChildren() {
return true;
@@ -105,4 +116,13 @@
return shadowStyle;
}
+
+ public Map getVisualOptions() {
+ if (null == visualOptions)
+ visualOptions = new HashMap();
+ return visualOptions;
+ }
+ public void setVisualOptions(Map visualOptions) {
+ this.visualOptions = visualOptions;
+ }
}
Modified: trunk/ui/modal-panel/src/main/java/org/richfaces/renderkit/ModalPanelRendererBase.java
===================================================================
--- trunk/ui/modal-panel/src/main/java/org/richfaces/renderkit/ModalPanelRendererBase.java 2007-07-18 12:27:31 UTC (rev 1670)
+++ trunk/ui/modal-panel/src/main/java/org/richfaces/renderkit/ModalPanelRendererBase.java 2007-07-18 12:51:45 UTC (rev 1671)
@@ -22,7 +22,12 @@
package org.richfaces.renderkit;
import java.io.IOException;
+import java.util.Iterator;
+import java.util.Map;
+import java.util.Set;
+import javax.faces.component.UIComponent;
+import javax.faces.context.ExternalContext;
import javax.faces.context.FacesContext;
import javax.servlet.ServletContext;
@@ -31,24 +36,50 @@
import org.ajax4jsf.renderkit.ComponentVariables;
import org.ajax4jsf.renderkit.ComponentsVariableResolver;
import org.richfaces.component.UIModalPanel;
-import org.richfaces.component.util.ViewUtil;
/**
* @author Nick Belaevski - nbelaevski(a)exadel.com
* created 13.02.2007
*
*/
-public class ModalPanelRendererBase extends AjaxComponentRendererBase {
+public class ModalPanelRendererBase extends InputRendererBase {
//TODO nick - set sizeA to actual min value
private static final int sizeA = 10;
+ private static final String STATE_OPTION_SUFFIX = "StateOption_";
+
protected String[] RESIZERS = new String[] {
"NWU", "N", "NEU", "NEL", "E",
"SEU", "SEL", "S", "SWL",
"SWU", "W", "NWL"
};
+ protected void doDecode(FacesContext context, UIComponent component) {
+ super.doDecode(context, component);
+
+ UIModalPanel panel = (UIModalPanel)component;
+ ExternalContext exCtx = context.getExternalContext();
+ Map rqMap = exCtx.getRequestParameterMap();
+ Object clnId = rqMap.get(panel.getClientId(context) + "OpenedState");
+
+ if (panel.isKeepVisualState()) {
+ if (null != clnId) {
+ panel.setShowWhenRendered(new Boolean((String) clnId).booleanValue());
+
+ Iterator it = rqMap.entrySet().iterator();
+ while ( it.hasNext()) {
+ Map.Entry entry = (Map.Entry)it.next();
+ int suffixPos = entry.getKey().toString().indexOf(STATE_OPTION_SUFFIX);
+ if (-1 != suffixPos) {
+ String key = entry.getKey().toString().substring(suffixPos + STATE_OPTION_SUFFIX.length());
+ panel.getVisualOptions().put(key, entry.getValue());
+ }
+ }
+ }
+ }
+ }
+
protected Class getComponentClass() {
return UIModalPanel.class;
}
@@ -97,111 +128,24 @@
return true;
}
-// public static String getOptions(FacesContext context, UIComponent component, RendererUtils utils) {
-// Map options = new HashMap();
-//
-//
-// UIComponent nestingContainer = (UIComponent) AjaxRendererUtils.findAjaxContainer(context, component);
-// UIComponent nestingForm = AjaxRendererUtils.getNestingForm(component);
-// String formId = nestingForm != null ? nestingForm.getClientId(context) : "";
-// options.put("container", nestingContainer.getClientId(context));
-// options.put("form", formId);
-//
-// Object w = component.getAttributes().get("width");
-// if(w == null || w.toString().trim().length() == 0 || "auto".equals(w)) {
-// w = "-1";
-// } else {
-// w = strip(w);
-// }
-// options.put("width", w);
-//
-// Object h = component.getAttributes().get("height");
-// if(h == null || h.toString().trim().length() == 0 || "auto".equals(h)) {
-// h = "-1";
-// } else {
-// h = strip(h);
-// }
-// options.put("height", h);
-//
-// Object x = component.getAttributes().get("posx");
-// if(x == null) x = component.getAttributes().get("align");
-// if(x == null || x.toString().trim().length() == 0) {
-// x = "50%";
-// } else {
-// x = strip(x);
-// }
-// if(x.equals("left")) x = "0%";
-// else if(x.equals("center") || x.equals("middle")) x = "50%";
-// else if(x.equals("right")) x = "100%";
-// options.put("posx", x);
-//
-// Object y = component.getAttributes().get("posy");
-// if(y == null) y = component.getAttributes().get("valign");
-// if(y == null || y.toString().trim().length() == 0) {
-// y = "50%";
-// } else {
-// y = strip(y);
-// }
-// if(y.equals("top")) y = "0%";
-// else if(y.equals("middle") || y.equals("center")) y = "50%";
-// else if(y.equals("bottom")) y = "100%";
-// options.put("posy", y);
-//
-// w = component.getAttributes().get("maxWidth");
-// if(w == null || w.toString().trim().length() == 0) {
-// w = "-1";
-// } else {
-// w = strip(w);
-// }
-// options.put("maxWidth", w);
-//
-// h = component.getAttributes().get("maxHeight");
-// if(h == null || h.toString().trim().length() == 0) {
-// h = "-1";
-// } else {
-// h = strip(h);
-// }
-// options.put("maxHeight", h);
-//
-//// if(!UIDialogAction.isServerMode(component)
-//// && DialogWindowRenderer.isSubmitted(utils, context, component)
-//// && findAncestorForm(context, component) != null) {
-//// append(options, "ajax", "true");
-//// }
-//
-// Object c = component.getAttributes().get("resizable");
-// if(c == null) c = Boolean.TRUE;
-// options.put("resizable", c);
-//
-// c = component.getAttributes().get("float");
-// if(c == null) c = Boolean.TRUE;
-// options.put("_float", c);
-//
-// c = component.getAttributes().get("headerHeight");
-// if(c == null) c = "16px";
-// options.put("headerHeight", c);
-//
-// c = component.getAttributes().get("posFunction");
-// if(c != null) {
-// options.put("posFunction", c);
-// }
-//
-//// Object posReferenceId = ((UIDialogWindow)component).getExternalPosReferenceId();
-//// if(posReferenceId == null) posReferenceId = ((UIDialogWindow)component).getPosReferenceId();
-//// if(posReferenceId != null) {
-//// append(options, "posReferenceId", posReferenceId);
-//// }
-////
-// c = component.getAttributes().get("hideParentDialog");
-// if(c == null) c = Boolean.FALSE;
-// options.put("hideParentDialog", c);
-//
-// return ScriptUtils.toScript(options);
-// }
-//
-// static String strip(Object value) {
-// String v = value.toString().trim();
-// if(v.endsWith("px")) return v.substring(0, v.length() - 2);
-// return v;
-// }
+ public String getShowScript(FacesContext context, UIModalPanel panel) {
+ StringBuffer result = new StringBuffer();
+
+ if (panel.isKeepVisualState() && panel.isShowWhenRendered()) {
+ result.append("Richfaces.showModalPanel('" + panel.getClientId(context) + "', {");
+
+ Iterator it = panel.getVisualOptions().entrySet().iterator();
+ while (it.hasNext()) {
+ Map.Entry entry = (Map.Entry)it.next();
+
+ result.append(entry.getKey() + ": '" + entry.getValue() + "'");
+ if (it.hasNext()) {
+ result.append(", ");
+ }
+ }
+
+ result.append("});");
+ }
+ return result.toString();
+ }
}
Modified: trunk/ui/modal-panel/src/main/resources/org/richfaces/renderkit/html/scripts/modalPanel.js
===================================================================
--- trunk/ui/modal-panel/src/main/resources/org/richfaces/renderkit/html/scripts/modalPanel.js 2007-07-18 12:27:31 UTC (rev 1670)
+++ trunk/ui/modal-panel/src/main/resources/org/richfaces/renderkit/html/scripts/modalPanel.js 2007-07-18 12:51:45 UTC (rev 1671)
@@ -353,10 +353,19 @@
if (!this.floatedToBody) {
this.parent = this.id.parentNode;
- document.body.appendChild(this.id.parentNode.removeChild(this.id));
+ document.body.insertBefore(this.parent.removeChild(this.id), null);
this.floatedToBody = true;
}
+ var forms = this.cdiv.getElementsByTagName("form");
+
+ if (this.options.keepVisualState && forms) {
+ this.formOnsubmit = this.setStateInput.bindAsEventListener(this);
+ for (var i = 0; i < forms.length; i++) {
+ Event.observe(forms[i], "submit", this.formOnsubmit);
+ }
+ }
+
if (ModalPanel.disableSelects && !this.iframe) {
new Insertion.Top(this.cdiv,
"<iframe src=\"javascript:''\" frameborder=\"0\" scrolling=\"no\" id=\"" + this.markerId.id + "IFrame\"" +
@@ -371,6 +380,7 @@
}
var options = {};
+ this.userOptions = {};
if (!this.cdiv.mpSet) {
Object.extend(options, this.options);
@@ -378,6 +388,7 @@
if (opts) {
Object.extend(options, opts);
+ Object.extend(this.userOptions, opts);
}
if (options.width) {
@@ -386,10 +397,10 @@
}
if (this.iframe) {
- this.iframe.style.width = options.width + 'px';
+ this.iframe.style.width = options.width + (/px/.test(options.width) ? '' : 'px');
}
- this.contentDiv.style.width = options.width + 'px';
- this.shadowDiv.style.width = options.width + 'px';
+ this.contentDiv.style.width = options.width + (/px/.test(options.width) ? '' : 'px');
+ this.shadowDiv.style.width = options.width + (/px/.test(options.width) ? '' : 'px');
}
if (options.height) {
@@ -398,10 +409,10 @@
}
if (this.iframe) {
- this.iframe.style.height = options.height + 'px';
+ this.iframe.style.height = options.height + (/px/.test(options.height) ? '' : 'px');
}
- this.contentDiv.style.height = options.height + 'px';
- this.shadowDiv.style.height = options.height + 'px';
+ this.contentDiv.style.height = options.height + (/px/.test(options.height) ? '' : 'px');
+ this.shadowDiv.style.height = options.height + (/px/.test(options.height) ? '' : 'px');
}
if (options.left) {
@@ -502,6 +513,8 @@
if (this.eventOnShow) this.eventOnShow(event);
this.lastOnfocus();
+
+ this.shown = true;
},
startDrag: function(border) {
@@ -520,7 +533,7 @@
hide: function(opts) {
this.restoreFocus();
- this.traverseSelects(true);
+ this.traverseSelects(true);
if (this.div.style.removeExpression) {
this.div.style.removeExpression("width");
@@ -550,6 +563,15 @@
var event = {};
event.parameters = opts || {};
if (this.eventOnHide) this.eventOnHide(event);
+
+ var forms = this.cdiv.getElementsByTagName("form");
+ if (this.options.keepVisualState && forms) {
+ for (var i = 0; i < forms.length; i++) {
+ Event.stopObserving(forms[i], "submit", this.formOnsubmit);
+ }
+ }
+
+ this.shown = false;
},
doResizeOrMove: function(diff) {
@@ -596,6 +618,7 @@
newPos += diff.deltaX;
this.cdiv.mpLeft = newPos;
+ cssHash.left = newPos + 'px';
} else {
newPos = Richfaces.getComputedStyleSize(this.cdiv, "left");
newPos += diff.deltaX;
@@ -636,6 +659,7 @@
newPos += diff.deltaY;
this.cdiv.mpTop = newPos;
+ cssHash.top = newPos + 'px';
} else {
newPos = Richfaces.getComputedStyleSize(this.cdiv, "top");
newPos += diff.deltaY;
@@ -650,6 +674,9 @@
if (this.iframe) {
Element.setStyle(this.iframe, cssHashWH);
}
+
+ Object.extend(this.userOptions, cssHash);
+ Object.extend(this.userOptions, cssHashWH);
var w = this.context.width();
var h = this.context.height();
@@ -674,8 +701,34 @@
}
return vetoes;
+ },
+
+ setStateInput: function(e) {
+ var target = Event.element(e);
+ if (e && target) {
+ var input = document.createElement("input");
+ input.type = "hidden";
+ input.id = this.markerId.id + "OpenedState";
+ input.name = this.markerId.id + "OpenedState";
+ input.value = this.shown ? "true" : "false";
+ target.appendChild(input);
+
+ var keys = $H(this.userOptions).keys();
+ if (keys) {
+ for (var i = 0; i < keys.length; i++) {
+ input = document.createElement("input");
+ input.type = "hidden";
+ input.id = this.markerId.id + "StateOption_" + keys[i];
+ input.name = this.markerId.id + "StateOption_" + keys[i];
+ input.value = this.userOptions[keys[i]];
+ target.appendChild(input);
+
+ }
+ }
+
+ return true;
+ }
}
-
}
Richfaces.findModalPanel = function (id) {
Modified: trunk/ui/modal-panel/src/main/templates/org/richfaces/htmlModalPanel.jspx
===================================================================
--- trunk/ui/modal-panel/src/main/templates/org/richfaces/htmlModalPanel.jspx 2007-07-18 12:27:31 UTC (rev 1670)
+++ trunk/ui/modal-panel/src/main/templates/org/richfaces/htmlModalPanel.jspx 2007-07-18 12:51:45 UTC (rev 1671)
@@ -32,6 +32,8 @@
<f:call name="checkOptions" />
<f:call name="initializeResources" />
+ <input type="hidden" id="#{clientId}OpenedState" name="#{clientId}OpenedState" />
+
<div id="#{clientId}Container"
style="position: absolute; display: none; z-index: #{component.zindex}; background-color: inherit;"
class="rich-modalpanel"
@@ -72,8 +74,8 @@
</div>
<div style="position: absolute; overflow: hidden; z-index: 2;"
- class="dr-mpnl-pnl" id="#{clientId}ContentDiv">
-
+ class="dr-mpnl-pnl" id="#{clientId}ContentDiv">
+
<a href="#" style="position: absolute; left: -32000" id="#{clientId}FirstHref" >_</a>
<table style="height: 100%; width: 100%;" border="0" cellpadding="0" cellspacing="0">
<jsp:scriptlet>
@@ -103,8 +105,8 @@
<td class="dr-mpnl-pnl-b rich-mpnl-body" valign="top">
<vcp:body>
<f:call name="renderChildren" />
- </vcp:body>
- <f:clientid var="clientId"/>
+ </vcp:body>
+ <f:clientid var="clientId"/>
<a href="#" style="position: absolute; left: -32001" id="#{clientId}LastHref" >_</a>
</td>
</tr>
@@ -130,10 +132,15 @@
zindex: #{component.zindex},
onshow: #{onshow},
- onhide: #{onhide}
+ onhide: #{onhide},
+
+ keepVisualState: #{component.keepVisualState},
+ showWhenRendered: #{component.showWhenRendered}
});
</script>
</div>
</div>
-
-</f:template>
\ No newline at end of file
+ <script type="text/javascript" >
+ #{this:getShowScript(context, component)}
+ </script>
+</f:template>
Modified: trunk/ui/panel/src/main/config/component/panel.xml
===================================================================
--- trunk/ui/panel/src/main/config/component/panel.xml 2007-07-18 12:27:31 UTC (rev 1670)
+++ trunk/ui/panel/src/main/config/component/panel.xml 2007-07-18 12:51:45 UTC (rev 1671)
@@ -48,5 +48,9 @@
A class that defines a style for a panel content
</description>
</property>
+ <property>
+ <name>header</name>
+ <classname>java.lang.String</classname>
+ </property>
</component>
</components>
Modified: trunk/ui/panel/src/main/java/org/richfaces/component/UIPanel.java
===================================================================
--- trunk/ui/panel/src/main/java/org/richfaces/component/UIPanel.java 2007-07-18 12:27:31 UTC (rev 1670)
+++ trunk/ui/panel/src/main/java/org/richfaces/component/UIPanel.java 2007-07-18 12:51:45 UTC (rev 1671)
@@ -32,4 +32,7 @@
public boolean getRendersChildren() {
return true;
}
+
+ public abstract String getHeader();
+ public abstract void setHeader(String header);
}
Modified: trunk/ui/panel/src/main/templates/panel.jspx
===================================================================
--- trunk/ui/panel/src/main/templates/panel.jspx 2007-07-18 12:27:31 UTC (rev 1670)
+++ trunk/ui/panel/src/main/templates/panel.jspx 2007-07-18 12:51:45 UTC (rev 1671)
@@ -19,6 +19,12 @@
<u:insertFacet name="header" />
</div>
<jsp:scriptlet>
+ <![CDATA[} else if (null != component.getHeader() && !"".equals(component.getHeader())) { ]]>
+ </jsp:scriptlet>
+ <div id="#{clientId}_header" class="dr-pnl-h rich-panel-header #{component.attributes['headerClass']}">
+ #{component.attributes['header']}
+ </div>
+ <jsp:scriptlet>
<![CDATA[}]]>
</jsp:scriptlet>
<div id="#{clientId}_body" class="dr-pnl-b rich-panel-body #{component.attributes['bodyClass']}">
Modified: trunk/ui/suggestionbox/src/main/config/component/suggestionbox.xml
===================================================================
--- trunk/ui/suggestionbox/src/main/config/component/suggestionbox.xml 2007-07-18 12:27:31 UTC (rev 1670)
+++ trunk/ui/suggestionbox/src/main/config/component/suggestionbox.xml 2007-07-18 12:51:45 UTC (rev 1671)
@@ -68,7 +68,7 @@
<name>suggestionAction</name>
<classname>javax.faces.el.MethodBinding</classname>
<methodargs>
- java.lang.Object.class
+ java.lang.Object
</methodargs>
<description>
<![CDATA[Method calls an expression to get a collection of suggestion data on request. It must have one parameter with a type of Object with content of input component and must return any type allowed for <h:datatable> ]]>
Modified: trunk/ui/suggestionbox/src/main/java/org/richfaces/renderkit/html/SuggestionBoxRenderer.java
===================================================================
--- trunk/ui/suggestionbox/src/main/java/org/richfaces/renderkit/html/SuggestionBoxRenderer.java 2007-07-18 12:27:31 UTC (rev 1670)
+++ trunk/ui/suggestionbox/src/main/java/org/richfaces/renderkit/html/SuggestionBoxRenderer.java 2007-07-18 12:51:45 UTC (rev 1671)
@@ -63,7 +63,7 @@
*/
private static final String[] OPTIONS = {"popupClass", "popupStyle",
"width", "height", "entryClass", "selectedClass", "param",
- "frequency", "minChars", "tokens", "rows"};
+ "frequency", "minChars", "tokens", "rows", "selectValueClass" };
/**
* Shadow depth.
@@ -185,10 +185,6 @@
StringBuffer clazz = new StringBuffer(
"dr-sb-common-container rich-sb-common-container");
- Object popupClass = attributes.get("popupClass");
- if (null != popupClass) {
- clazz.append(" ").append(popupClass);
- }
writer.writeAttribute("class", clazz, "popupClass");
int zIndex = suggestionBox.getZindex();
Modified: trunk/ui/suggestionbox/src/main/resources/org/richfaces/renderkit/html/scripts/suggestionbox.js
===================================================================
--- trunk/ui/suggestionbox/src/main/resources/org/richfaces/renderkit/html/scripts/suggestionbox.js 2007-07-18 12:27:31 UTC (rev 1670)
+++ trunk/ui/suggestionbox/src/main/resources/org/richfaces/renderkit/html/scripts/suggestionbox.js 2007-07-18 12:51:45 UTC (rev 1671)
@@ -31,6 +31,8 @@
this.options.param = this.options.param || this.element.name;
this.options.selectedClass = this.options.selectedClass
|| "dr-sb-int-sel";
+ this.options.selectValueClass = this.options.selectValueClass
+ || " ";
this.options.tokens = $A(options.tokens) || [];
this.options.frequency = this.options.frequency || 0.4;
this.options.minChars = parseInt(this.options.minChars) || 1;
@@ -89,6 +91,10 @@
}
this.onScrollListener = this.onScroll.bindAsEventListener(this);
+
+ if (options.popupClass)
+ Element.addClassName(document.getElementsByClassName("dr-sb-ext-decor-3",
+ this.update)[0], options.popupClass);
},
onBoxKeyPress: function(event) {
@@ -427,6 +433,12 @@
if (this.prevIndex != this.index) {
var entry = this.getEntry(this.index);
Element.addClassName(entry, this.options.selectedClass);
+
+ var cells = document.getElementsByClassName("dr-sb-cell-padding" , entry);
+ for (var i = 0; i < cells.length; i++) {
+ Element.addClassName(cells[i], this.options.selectValueClass);
+ }
+
// Calc scroll position :
if (this.keyEvent) {
var scroll = document.getElementsByClassName("_suggestion_size_", this.update)[0]
@@ -449,6 +461,10 @@
if (this.prevIndex >= 0) {
var prevEntry = this.getEntry(this.prevIndex);
if (prevEntry) {
+ var prevCells = document.getElementsByClassName("dr-sb-cell-padding" , prevEntry);
+ for (var i = 0; i < prevCells.length; i++) {
+ Element.removeClassName(prevCells[i], this.options.selectValueClass);
+ }
Element.removeClassName(prevEntry, this.options.selectedClass);
}
}
Modified: trunk/ui/suggestionbox/src/main/resources/org/richfaces/renderkit/html/templates/popup.jspx
===================================================================
--- trunk/ui/suggestionbox/src/main/resources/org/richfaces/renderkit/html/templates/popup.jspx 2007-07-18 12:27:31 UTC (rev 1670)
+++ trunk/ui/suggestionbox/src/main/resources/org/richfaces/renderkit/html/templates/popup.jspx 2007-07-18 12:51:45 UTC (rev 1671)
@@ -1,7 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<f:template xmlns:f='http:/jsf.exadel.com/template'
xmlns:u='http:/jsf.exadel.com/template/util'
- xmlns="http://www.w3.org/1999/xhtml">
+ xmlns="http://www.w3.org/1999/xhtml"
+ component="org.richfaces.component.UISuggestionBox">
<div class="dr-sb-ext-decor-1 rich-sb-ext-decor-1">
<div class="dr-sb-ext-decor-2 rich-sb-ext-decor-2">
Modified: trunk/ui/tree/src/main/java/org/richfaces/component/state/TreeState.java
===================================================================
--- trunk/ui/tree/src/main/java/org/richfaces/component/state/TreeState.java 2007-07-18 12:27:31 UTC (rev 1670)
+++ trunk/ui/tree/src/main/java/org/richfaces/component/state/TreeState.java 2007-07-18 12:51:45 UTC (rev 1671)
@@ -117,6 +117,10 @@
return (selectedNode != null && selectedNode.equals(rowKey));
}
+ public TreeRowKey getSelectedNode() {
+ return selectedNode;
+ }
+
public boolean setSelected(TreeRowKey rowKey) {
if (selectedNode == null) {
if (rowKey != null) {
Modified: trunk/ui/tree/src/main/resources/org/richfaces/renderkit/html/scripts/tree-item.js
===================================================================
--- trunk/ui/tree/src/main/resources/org/richfaces/renderkit/html/scripts/tree-item.js 2007-07-18 12:27:31 UTC (rev 1670)
+++ trunk/ui/tree/src/main/resources/org/richfaces/renderkit/html/scripts/tree-item.js 2007-07-18 12:51:45 UTC (rev 1671)
@@ -7,7 +7,7 @@
this.switchType = switchType;
this.tree = $(tree);
this.elements = {};
- ($(id)).object = this;
+ //($(id)).object = this; //dublicate: see getElements()
this.toggleOnClick = toggleOnClick;
this.getElements();
@@ -48,7 +48,7 @@
},
getElements: function() {
- //($(this.id)).object = this; //dublicate: see initialize()
+ ($(this.id)).object = this;
this.nodeStateInput = $(this.id + "NodeExpanded");
this.childs = [];
var childsRowId = this.id + Tree.ID_DEVIDER + Tree.ID_CHILDS_ROW;
@@ -242,13 +242,9 @@
if (e && e.type == "mousedown" /* can be keydown */) {
if(Event.isLeftClick(e)) {
var src = Event.element(e);
- if(src.tagName && (
- src.tagName.toUpperCase() == 'INPUT' ||
- src.tagName.toUpperCase() == 'SELECT' ||
- src.tagName.toUpperCase() == 'OPTION' ||
- src.tagName.toUpperCase() == 'BUTTON' ||
- src.tagName.toUpperCase() == 'TEXTAREA'))
- return;
+ if(src.tagName &&
+ /^(input|select|option|button|textarea)$/i.test(src.tagName))
+ return;
Event.stop(e);
} else {
Modified: trunk/ui/tree/src/main/resources/org/richfaces/renderkit/html/scripts/tree-selection.js
===================================================================
--- trunk/ui/tree/src/main/resources/org/richfaces/renderkit/html/scripts/tree-selection.js 2007-07-18 12:27:31 UTC (rev 1670)
+++ trunk/ui/tree/src/main/resources/org/richfaces/renderkit/html/scripts/tree-selection.js 2007-07-18 12:51:45 UTC (rev 1671)
@@ -165,12 +165,17 @@
if (next != item) {
return next;
} else {
- var next = item.parent.next();
- if (next != item.parent) {
- return next;
- } else {
- return item;
+ var parentItem = item.parent;
+ while (parentItem && parentItem != this.tree) {
+ var next = parentItem.next();
+ if (next != parentItem) {
+ return next;
+ } else {
+ parentItem = parentItem.parent;
+ }
}
+
+ return item;
}
}
},
Modified: trunk/ui/tree/src/main/resources/org/richfaces/renderkit/html/scripts/tree.js
===================================================================
--- trunk/ui/tree/src/main/resources/org/richfaces/renderkit/html/scripts/tree.js 2007-07-18 12:27:31 UTC (rev 1670)
+++ trunk/ui/tree/src/main/resources/org/richfaces/renderkit/html/scripts/tree.js 2007-07-18 12:51:45 UTC (rev 1671)
@@ -57,21 +57,26 @@
var itemOnSelect = treeItem.getRichAttribute("onselected");
itemOnSelect = new Function('event', (itemOnSelect ? itemOnSelect : "") + "; return true;");
+
+ var prevSelection = this.selectionManager.activeItem;
+ treeItem.toggleSelection(event);
var selectResult = itemOnSelect(event);
if (!selectResult) {
event["cancelSelection"] = true;
+ event["treeItem"] = prevSelection;
+ prevSelection.toggleSelection(event);
return ;
}
selectResult = this.onselect(event);
if (!selectResult) {
event["cancelSelection"] = true;
+ event["treeItem"] = prevSelection;
+ prevSelection.toggleSelection(event);
return ;
}
- treeItem.toggleSelection(event);
-
var attr = Richfaces.getNSAttribute("ajaxselectedlistener", $(event.selectedNode + Tree.ID_DEVIDER + Tree.ID_ICON));
if (attr) {
this.onAjaxSelect(event);
@@ -214,3 +219,4 @@
}
}
+
Modified: trunk/ui/tree/src/main/templates/htmlTree.jspx
===================================================================
--- trunk/ui/tree/src/main/templates/htmlTree.jspx 2007-07-18 12:27:31 UTC (rev 1670)
+++ trunk/ui/tree/src/main/templates/htmlTree.jspx 2007-07-18 12:51:45 UTC (rev 1671)
@@ -38,17 +38,13 @@
<f:call name="encodeAttributeParameters" />
- <f:call name="writeNamespace" />
-
- <f:call name="utils.encodePassThruWithExclusions">
- <f:parameter value="id,style,class"/>
+ <f:call name="writeNamespace" />
+
+ <f:call name="utils.encodePassThruWithExclusions">
+ <f:parameter value="id,style,class"/>
</f:call>
- <table width="100%" cellpadding="0">
- <tbody>
- <vcp:body />
- </tbody>
- </table>
+ <vcp:body />
<f:call name="encodeSelectionStateInput" />
<f:clientId var="clientId" />
@@ -63,7 +59,7 @@
function(event) {
#{this:getAjaxScript(context, component)}
},
- "#{this:getDragIndicatorId(context, component)}",
+ "#{this:getDragIndicatorId(context, component)}",
#{component.toggleOnClick}
);
#{this:getScriptContributions(context, component)}
@@ -73,4 +69,4 @@
</script>
</div>
</div>
-</f:root>
\ No newline at end of file
+</f:root>
Modified: trunk/ui/tree/src/test/java/org/richfaces/component/TreeComponentTest.java
===================================================================
--- trunk/ui/tree/src/test/java/org/richfaces/component/TreeComponentTest.java 2007-07-18 12:27:31 UTC (rev 1670)
+++ trunk/ui/tree/src/test/java/org/richfaces/component/TreeComponentTest.java 2007-07-18 12:51:45 UTC (rev 1671)
@@ -71,7 +71,7 @@
private static Set javaScripts = new HashSet();
static {
- javaScripts.add("/org/richfaces/renderkit/html/scripts/json/json.js");
+ javaScripts.add("/org/richfaces/renderkit/html/scripts/json/json-mini.js");
javaScripts.add("org.ajax4jsf.javascript.PrototypeScript");
javaScripts.add("scripts/AJAX.js");
@@ -766,3 +766,4 @@
}
}
+
17 years, 6 months
JBoss Rich Faces SVN: r1670 - trunk/sandbox/ui.
by richfaces-svn-commits@lists.jboss.org
Author: abelevich
Date: 2007-07-18 08:27:31 -0400 (Wed, 18 Jul 2007)
New Revision: 1670
Modified:
trunk/sandbox/ui/pom.xml
Log:
add message module
Modified: trunk/sandbox/ui/pom.xml
===================================================================
--- trunk/sandbox/ui/pom.xml 2007-07-18 12:23:17 UTC (rev 1669)
+++ trunk/sandbox/ui/pom.xml 2007-07-18 12:27:31 UTC (rev 1670)
@@ -18,5 +18,6 @@
<module>tooltip</module>
<!--module>scrollable-grid</module-->
<module>simpleTogglePanel2</module>
+ <module>message</module>
</modules>
</project>
\ No newline at end of file
17 years, 6 months
JBoss Rich Faces SVN: r1669 - in trunk/sandbox/samples: rich-message-demo and 6 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: abelevich
Date: 2007-07-18 08:23:17 -0400 (Wed, 18 Jul 2007)
New Revision: 1669
Added:
trunk/sandbox/samples/rich-message-demo/
trunk/sandbox/samples/rich-message-demo/pom.xml
trunk/sandbox/samples/rich-message-demo/src/
trunk/sandbox/samples/rich-message-demo/src/main/
trunk/sandbox/samples/rich-message-demo/src/main/webapp/
trunk/sandbox/samples/rich-message-demo/src/main/webapp/META-INF/
trunk/sandbox/samples/rich-message-demo/src/main/webapp/META-INF/MANIFEST.MF
trunk/sandbox/samples/rich-message-demo/src/main/webapp/WEB-INF/
trunk/sandbox/samples/rich-message-demo/src/main/webapp/WEB-INF/faces-config.xml
trunk/sandbox/samples/rich-message-demo/src/main/webapp/WEB-INF/web.xml
trunk/sandbox/samples/rich-message-demo/src/main/webapp/index.jsp
trunk/sandbox/samples/rich-message-demo/src/main/webapp/pages/
trunk/sandbox/samples/rich-message-demo/src/main/webapp/pages/message-demo.xhtml
Log:
message component demo skeleton
Added: trunk/sandbox/samples/rich-message-demo/pom.xml
===================================================================
--- trunk/sandbox/samples/rich-message-demo/pom.xml (rev 0)
+++ trunk/sandbox/samples/rich-message-demo/pom.xml 2007-07-18 12:23:17 UTC (rev 1669)
@@ -0,0 +1,40 @@
+<?xml version="1.0"?><project>
+ <parent>
+ <artifactId>samples</artifactId>
+ <groupId>org.richfaces.sandbox</groupId>
+ <version>3.1.0-SNAPSHOT</version>
+ </parent>
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>org.richfaces.demo</groupId>
+ <artifactId>rich-message-demo</artifactId>
+ <packaging>war</packaging>
+ <name>rich-message-demo</name>
+ <dependencies>
+ <dependency>
+ <groupId>org.richfaces.sandbox.ui</groupId>
+ <artifactId>message</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.richfaces</groupId>
+ <artifactId>skins</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ </dependencies>
+
+ <build>
+
+ <finalName>rich-message-demo</finalName>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-compiler-plugin</artifactId>
+ <configuration>
+ <source>1.5</source>
+ <target>1.5</target>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+
+</project>
\ No newline at end of file
Added: trunk/sandbox/samples/rich-message-demo/src/main/webapp/META-INF/MANIFEST.MF
===================================================================
--- trunk/sandbox/samples/rich-message-demo/src/main/webapp/META-INF/MANIFEST.MF (rev 0)
+++ trunk/sandbox/samples/rich-message-demo/src/main/webapp/META-INF/MANIFEST.MF 2007-07-18 12:23:17 UTC (rev 1669)
@@ -0,0 +1,2 @@
+Manifest-Version: 1.0
+
Added: trunk/sandbox/samples/rich-message-demo/src/main/webapp/WEB-INF/faces-config.xml
===================================================================
--- trunk/sandbox/samples/rich-message-demo/src/main/webapp/WEB-INF/faces-config.xml (rev 0)
+++ trunk/sandbox/samples/rich-message-demo/src/main/webapp/WEB-INF/faces-config.xml 2007-07-18 12:23:17 UTC (rev 1669)
@@ -0,0 +1,6 @@
+<?xml version="1.0"?>
+<!DOCTYPE faces-config PUBLIC "-//Sun Microsystems, Inc.//DTD JavaServer Faces Config 1.0//EN"
+ "http://java.sun.com/dtd/web-facesconfig_1_0.dtd">
+<faces-config>
+</faces-config>
+
Added: trunk/sandbox/samples/rich-message-demo/src/main/webapp/WEB-INF/web.xml
===================================================================
--- trunk/sandbox/samples/rich-message-demo/src/main/webapp/WEB-INF/web.xml (rev 0)
+++ trunk/sandbox/samples/rich-message-demo/src/main/webapp/WEB-INF/web.xml 2007-07-18 12:23:17 UTC (rev 1669)
@@ -0,0 +1,70 @@
+<web-app version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
+
+ <display-name>Richfaces message component application</display-name>
+ <!--
+ <context-param>
+ <param-name>org.ajax4jsf.SKIN</param-name>
+ <param-value>#{skinBean.skin}</param-value>
+ </context-param>
+ -->
+
+ <context-param>
+ <param-name>org.ajax4jsf.VIEW_HANDLERS</param-name>
+ <param-value>com.sun.facelets.FaceletViewHandler</param-value>
+ </context-param>
+ <context-param>
+ <param-name>javax.faces.DEFAULT_SUFFIX</param-name>
+ <param-value>.xhtml</param-value>
+ </context-param>
+ <context-param>
+ <param-name>javax.faces.CONFIG_FILES</param-name>
+ <param-value>/WEB-INF/faces-config.xml</param-value>
+ </context-param>
+ <context-param>
+ <param-name>javax.faces.STATE_SAVING_METHOD</param-name>
+ <param-value>server</param-value>
+ </context-param>
+ <context-param>
+ <param-name>org.ajax4jsf.COMPRESS_SCRIPT</param-name>
+ <param-value>false</param-value>
+ </context-param>
+ <filter>
+ <display-name>Ajax4jsf Filter</display-name>
+ <filter-name>ajax4jsf</filter-name>
+ <filter-class>org.ajax4jsf.Filter</filter-class>
+ <init-param>
+ <param-name>forceparser</param-name>
+ <param-value>false</param-value>
+ </init-param>
+ </filter>
+
+ <filter-mapping>
+ <filter-name>ajax4jsf</filter-name>
+ <servlet-name>Faces Servlet</servlet-name>
+ <dispatcher>REQUEST</dispatcher>
+ <dispatcher>FORWARD</dispatcher>
+ <dispatcher>INCLUDE</dispatcher>
+ </filter-mapping>
+
+ <servlet>
+ <servlet-name>Faces Servlet</servlet-name>
+ <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
+ <load-on-startup>1</load-on-startup>
+ </servlet>
+
+ <servlet-mapping>
+ <servlet-name>Faces Servlet</servlet-name>
+ <url-pattern>/faces/*</url-pattern>
+ </servlet-mapping>
+
+ <servlet-mapping>
+ <servlet-name>Faces Servlet</servlet-name>
+ <url-pattern>*.jsf</url-pattern>
+ </servlet-mapping>
+ <login-config>
+ <auth-method>BASIC</auth-method>
+ </login-config>
+</web-app>
+
+
Added: trunk/sandbox/samples/rich-message-demo/src/main/webapp/index.jsp
===================================================================
--- trunk/sandbox/samples/rich-message-demo/src/main/webapp/index.jsp (rev 0)
+++ trunk/sandbox/samples/rich-message-demo/src/main/webapp/index.jsp 2007-07-18 12:23:17 UTC (rev 1669)
@@ -0,0 +1,7 @@
+<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
+<html>
+ <head></head>
+ <body>
+ <jsp:forward page="/pages/message-demo.jsf" />
+ </body>
+</html>
Added: trunk/sandbox/samples/rich-message-demo/src/main/webapp/pages/message-demo.xhtml
===================================================================
--- trunk/sandbox/samples/rich-message-demo/src/main/webapp/pages/message-demo.xhtml (rev 0)
+++ trunk/sandbox/samples/rich-message-demo/src/main/webapp/pages/message-demo.xhtml 2007-07-18 12:23:17 UTC (rev 1669)
@@ -0,0 +1,10 @@
+<!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:f="http://java.sun.com/jsf/core"
+ xmlns:h="http://java.sun.com/jsf/html"
+ xmlns:ui="http://java.sun.com/jsf/facelets"
+ xmlns:msg="http://labs.jboss.com/jbossrichfaces/ui/ui/message"
+ xmlns:a4j="https://ajax4jsf.dev.java.net/ajax">
+
+ <h:outputText value="hello!!"></h:outputText>
+ </html>
\ No newline at end of file
17 years, 6 months
JBoss Rich Faces SVN: r1668 - trunk/sandbox/samples.
by richfaces-svn-commits@lists.jboss.org
Author: abelevich
Date: 2007-07-18 08:21:13 -0400 (Wed, 18 Jul 2007)
New Revision: 1668
Modified:
trunk/sandbox/samples/pom.xml
Log:
add rich-message-demo module
Modified: trunk/sandbox/samples/pom.xml
===================================================================
--- trunk/sandbox/samples/pom.xml 2007-07-18 10:47:34 UTC (rev 1667)
+++ trunk/sandbox/samples/pom.xml 2007-07-18 12:21:13 UTC (rev 1668)
@@ -20,5 +20,6 @@
<module>panelmenu-sample</module>
<module>tooltip-sample</module>
+ <module>rich-message-demo </module>
</modules>
</project>
\ No newline at end of file
17 years, 6 months
JBoss Rich Faces SVN: r1666 - branches/3.0.2/sandbox/calendar/src/main/java/org/richfaces/component.
by richfaces-svn-commits@lists.jboss.org
Author: akushunin
Date: 2007-07-18 04:53:52 -0400 (Wed, 18 Jul 2007)
New Revision: 1666
Modified:
branches/3.0.2/sandbox/calendar/src/main/java/org/richfaces/component/UICalendar.java
Log:
Modified: branches/3.0.2/sandbox/calendar/src/main/java/org/richfaces/component/UICalendar.java
===================================================================
--- branches/3.0.2/sandbox/calendar/src/main/java/org/richfaces/component/UICalendar.java 2007-07-17 18:12:51 UTC (rev 1665)
+++ branches/3.0.2/sandbox/calendar/src/main/java/org/richfaces/component/UICalendar.java 2007-07-18 08:53:52 UTC (rev 1666)
@@ -119,8 +119,8 @@
ValueBinding vb = getValueBinding("currentDate");
if (vb != null) {
vb.setValue(context, getLocalCurrentDate());
- setValue(null);
- setLocalValueSet(false);
+ //setValue(null);
+ //setLocalValueSet(false);
return;
}
}
@@ -151,6 +151,8 @@
currentDate = (Date) restoreAttachedState(context, values[1]);
}
+
+
// --------------------------------------------------------
private int getLastDayOfWeek(Calendar calendar) {
17 years, 6 months