JBoss Rich Faces SVN: r1604 - in branches/3.0.2: richfaces/tree/src/main/templates and 2 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: pyaschenko
Date: 2007-07-12 10:07:25 -0400 (Thu, 12 Jul 2007)
New Revision: 1604
Modified:
branches/3.0.2/richfaces/common/src/main/resources/org/richfaces/renderkit/html/scripts/utils.js
branches/3.0.2/richfaces/tree/src/main/templates/htmlTree.jspx
branches/3.0.2/sandbox/calendar/src/main/resources/org/richfaces/renderkit/html/scripts/calendar.js
branches/3.0.2/sandbox/calendar/src/main/templates/org/richfaces/htmlCalendar.jspx
Log:
New functions added.
Now header markup evaluales every update.
Date.format() function added.
Rich.eval() was deleted. Use Rich.evalMacro() instead one.
Some improvements and optimization.
Modified: branches/3.0.2/richfaces/common/src/main/resources/org/richfaces/renderkit/html/scripts/utils.js
===================================================================
--- branches/3.0.2/richfaces/common/src/main/resources/org/richfaces/renderkit/html/scripts/utils.js 2007-07-12 13:18:19 UTC (rev 1603)
+++ branches/3.0.2/richfaces/common/src/main/resources/org/richfaces/renderkit/html/scripts/utils.js 2007-07-12 14:07:25 UTC (rev 1604)
@@ -100,24 +100,8 @@
return null;
};
-Richfaces.eval = function(template, object) {
- var value = '';
-
- try {
- value = object.eval(template);
- if (typeof value == 'function') {
- value = value(object);
- }
- } catch (e) {
- LOG.warn('Exception: ' + e.message + '\n[' + template + ']');
- }
+Richfaces.VARIABLE_NAME_PATTERN = /^\s*[_,A-Z,a-z][\w,_\.]*\s*$/;
- return value;
-};
-
-Richfaces.VARIABLE_NAME_PATTERN = /^\s*[_,A-Z,a-z][\w,_]*\s*$/;
-Richfaces.VARIABLE_NAME_PATTERN2 = /^\s*[_,A-Z,a-z][\w,_,\.]*\s*$/;
-
Richfaces.getObjectValue = function (str, object) {
var a=str.split(".");
var value=object[a[0]];
@@ -132,18 +116,20 @@
// variable evaluation
if (Richfaces.VARIABLE_NAME_PATTERN.test(template))
{
- value = object[template];
- if (!value) {value=window[template]; if (!value) value="";}
+ if (template.indexOf('.')==-1) {
+ value = object[template];
+ if (!value) value=window[template];
+ }
+ // object's variable evaluation
+ else {
+ value = Richfaces.getObjectValue(template, object);
+ if (!value) value=Richfaces.getObjectValue(template, window);
+ }
+ if (value && typeof value=='function') value = value(object);
+ if (!value) value="";
}
- // variable in objects evaluation
- else if (Richfaces.VARIABLE_NAME_PATTERN2.test(template))
- {
- value = Richfaces.getObjectValue(template, object);
- if (!value) value=Richfaces.getObjectValue("window."+template, object);
- }
//js string evaluation
- else
- {
+ else {
try {
value=object.eval(template);
if (typeof value == 'function') {
@@ -159,3 +145,14 @@
if (!value) {value=window[template]; if (!value) value="";}
return value;
}
+
+Richfaces.invokeOnComponent = function(componentType, element, functionName)
+{
+ var attribute="richfacesComponent";
+ while (element.parentNode) {
+ if (element[attribute] && element[attribute]==componentType)
+ return element.component[functionName]();
+ else
+ element = element.parentNode;
+ }
+}
Modified: branches/3.0.2/richfaces/tree/src/main/templates/htmlTree.jspx
===================================================================
--- branches/3.0.2/richfaces/tree/src/main/templates/htmlTree.jspx 2007-07-12 13:18:19 UTC (rev 1603)
+++ branches/3.0.2/richfaces/tree/src/main/templates/htmlTree.jspx 2007-07-12 14:07:25 UTC (rev 1604)
@@ -44,11 +44,7 @@
<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" />
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-12 13:18:19 UTC (rev 1603)
+++ branches/3.0.2/sandbox/calendar/src/main/resources/org/richfaces/renderkit/html/scripts/calendar.js 2007-07-12 14:07:25 UTC (rev 1604)
@@ -25,6 +25,41 @@
}
});
+/* Year:
+ * yy - 00-99
+ * y,yyy+ - 1999
+ * Month:
+ * M - 1-12
+ * MM - 01-12
+ * MMM - short (Jul)
+ * MMMM+ - long (July)
+ * Date:
+ * d - 1-31
+ * dd+ - 01-31 */
+Object.extend(Date, {
+ format : function(pattern, monthNames, monthNamesShort) {
+ if (!monthNames) monthNames = ['January','February','March','April','May','June','July','August','September','October','November','December'];
+ if (!monthNamesShort) monthNamesShort = ['Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec'];
+ var d = this; var mm; var dd;
+ return pattern.replace(/(yy^y|y+|M^M|MM^M|MMM^M|M+|d^d|d+)/g,
+ function($1) {
+ switch ($1) {
+ case 'yy': return d.getYear().toString().substr(-2);
+ case 'M': return d.getMonth()+1;
+ case 'MM': return (mm = d.getMonth()+1)<10 ? '0'+mm : mm;
+ case 'MMM': return monthNamesShort[d.getMonth()];
+ case 'd': return d.getDate();
+ }
+ // y+,M+,d+
+ var ch = $1.charAt(0);
+ if (ch=='y') return d.getFullYear();
+ if (ch=='M') return monthNames[d.getMonth()];
+ if (ch=='d') return (dd = d.getDate())<10 ? '0'+dd : dd;
+ }
+ );
+ }
+})
+
function isLeapYear(year) {
return new Date(year, 1, 29).getDate()==29;
}
@@ -102,8 +137,9 @@
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]);
- this.currentDate = this.params.currentDate;
+ this.currentDate = this.params.currentDate ? this.params.currentDate : new Date();
this.selectedDate = this.params.selectedDate;
this.todayDate = new Date();
@@ -113,19 +149,24 @@
this.firstWeekendDayNumber = 6-this.params.firstWeekDay;
this.secondWeekendDayNumber = (this.params.firstWeekDay>0 ? 7-this.params.firstWeekDay : 0);
+ /*this.ids = {
+ currentYearMonthId: this.id+':currentyearmonth'
+ };*/
+
this.daysData = {startDate:null, days:[]};
this.days = [];
- var htmlTextHeader = '<div id="div_'+this.params.dayListTableId+'"></div><input id="'+this.params.dayListTableId+':input" type="hidden" value="'+this.getSelectedDate()+'"><table border="0" cellpadding="0" cellspacing="0" class="calendar_exterior" id="'+this.params.dayListTableId+'">\n';
+ var htmlTextHeader = '<input id="'+this.id+':input" type="hidden" value="'+this.getSelectedDate()+'"><table border="0" cellpadding="0" cellspacing="0" class="calendar_exterior">\n';
var controlsHeaderContext = {
- nextYearControl: Calendar.nextYearControl,
- previousYearControl: Calendar.previousYearControl,
- nextMonthControl: Calendar.nextMonthControl,
- previousMonthControl: Calendar.previousMonthControl,
- dateControl: Calendar.dateControl,
- componentId: id
+ /*nextYearControl: Calendar.getNextYearControl,
+ previousYearControl: Calendar.getPreviousYearControl,
+ nextMonthControl: Calendar.getNextMonthControl,
+ previousMonthControl: Calendar.getPreviousMonthControl,
+ dateControl: Calendar.getDateControl,
+ componentId: id,*/
+ calendar:this
};
- var htmlControlsHeader = '<thead><tr><th colspan="7">' + Calendar.header.getContent(controlsHeaderContext) + '</th></tr></thead>'
+ var htmlControlsHeader = '<thead><tr><th colspan="7" id="'+this.id+':header"></th></tr></thead>'
var htmlTextFooter = '</table><div id="div_'+this.params.dayListTableId+'_selected_date"></div>\n';
// days bar creation
@@ -159,7 +200,7 @@
}
for (var i=0;i<7;i++)
{
- htmlTextWeek+='<td id="'+this.params.dayListTableId+'_cell'+p+'" style="vertical-align:top"></td>';
+ htmlTextWeek+='<td id="'+this.params.dayListTableId+':cell'+p+'" style="vertical-align:top"></td>';
p++;
}
htmlTextWeek+='</tr>';
@@ -168,6 +209,7 @@
// set content
var obj=$(id);
obj.component = this;
+ obj.richfacesComponent="richfaces:calendar";
obj.innerHTML = htmlTextHeader+htmlControlsHeader+htmlTextWeekDayBar+htmlTextWeek+htmlTextFooter;
this.submitFunction = this.params.submitFunction.bind(this);
@@ -180,6 +222,41 @@
var date = this.selectedDate.getDate(); value += "/"+(date<10 ? "0"+date : date);
return value+"/"+this.selectedDate.getFullYear();
},
+
+ getPrevYear: function() {
+ var value = this.currentDate.getFullYear()-1;
+ if (value<0) value = 0;
+ return value;
+ },
+ getPrevMonth: function(asMonthLabel) {
+ var value = this.currentDate.getMonth()-1;
+ if (value < 0 ) value = 11;
+ if (asMonthLabel)
+ {
+ return this.params.monthLabels[value];
+ } else return value;
+ },
+ getCurrentYear: function() {
+ return this.currentDate.getFullYear();
+ },
+ getCurrentMonth: function(asMonthLabel) {
+ var value = this.currentDate.getMonth();
+ if (asMonthLabel)
+ {
+ return this.params.monthLabels[value];
+ } else return value;
+ },
+ getNextYear: function() {
+ return this.currentDate.getFullYear()+1;
+ },
+ getNextMonth: function(asMonthLabel) {
+ var value = this.currentDate.getMonth()+1;
+ if (value > 11 ) value = 0;
+ if (asMonthLabel)
+ {
+ return this.params.monthLabels[value];
+ } else return value;
+ },
isWeekend: function(weekday) {
return (weekday == this.firstWeekendDayNumber || weekday == this.secondWeekendDayNumber);
@@ -203,7 +280,7 @@
},
eventCellOnClick: function (e) {
- var idstr = this.params.dayListTableId+'_cell';
+ var idstr = this.params.dayListTableId+':cell';
var obj = Event.findElementByAttr(e, "TD", "id", idstr, true);
if (obj)
{
@@ -218,7 +295,7 @@
var selecteddate = this.getSelectedDate();
$('div_'+this.params.dayListTableId+'_selected_date').innerHTML=selecteddate;
- $(this.params.dayListTableId+':input').value=selecteddate;
+ $(this.id+':input').value=selecteddate;
} else {
if (daydata._month==-1) this.prevMonth(); else this.nextMonth();
}
@@ -226,7 +303,7 @@
},
eventCellOnMouseOver: function (e) {
- var idstr = this.params.dayListTableId+'_cell';
+ var idstr = this.params.dayListTableId+':cell';
var obj = Event.findElementByAttr(e, "TD", "id", idstr, true);
if (obj)
{
@@ -236,7 +313,7 @@
},
eventCellOnMouseOut: function (e) {
- var idstr = this.params.dayListTableId+'_cell';
+ var idstr = this.params.dayListTableId+':cell';
var obj = Event.findElementByAttr(e, "TD", "id", idstr, true);
if (obj)
{
@@ -287,8 +364,8 @@
update:function() {
this.todayDate = new Date();
- var currentYear = this.currentDate.getFullYear();
- var currentMonth = this.currentDate.getMonth();
+ var currentYear = this.getCurrentYear();
+ var currentMonth = this.getCurrentMonth();
var todayflag = (currentYear == this.todayDate.getFullYear() && currentMonth == this.todayDate.getMonth());
var todaydate = this.todayDate.getDate();
@@ -296,8 +373,8 @@
var selectedflag = (currentYear == this.selectedDate.getFullYear() && currentMonth == this.selectedDate.getMonth())
var selecteddate = this.selectedDate.getDate();
- var dateDiv = $("div_"+this.params.dayListTableId);
- dateDiv.innerHTML = currentYear + "/" + (currentMonth+1);
+ //var dateDiv = $(this.ids.currentYearMonthId);
+ //dateDiv.innerHTML = " " + currentYear + "/" + (currentMonth<9 ? "0" : "") + (currentMonth+1) + " ";
var wd = getDay(this.currentDate, this.params.firstWeekDay);
var currentMonthDays = daysInMonthByDate(this.currentDate);
@@ -359,6 +436,13 @@
}
// render
+ //header render
+ var header = $(this.id+":header");
+ if (header)
+ {
+ header.innerHTML = Calendar.header.getContent({calendar:this});
+ }
+ //days render
p=0;
var element;
var dataobj;
@@ -367,7 +451,7 @@
this.selectedDayElement=null;
var weekflag=true;
- var _d=new Date();
+ //var _d=new Date();
for (var k=1;k<7;k++)
{
@@ -408,7 +492,7 @@
element=element.nextSibling;
}
}
- alert(new Date().getTime()-_d.getTime());
+ //alert(new Date().getTime()-_d.getTime());
},
nextMonth: function() {
@@ -467,7 +551,7 @@
Calendar.getControl = function(context, attributes, text, functionName) {
var attr = {
- onclick: (functionName ? "$('"+context.componentId+"').component."+functionName+"();" : "") + "return false;"
+ onclick: (functionName ? "Richfaces.invokeOnComponent('richfaces:calendar',this,'"+functionName+"');" : "")+"return false;"
};
if (attributes) {
@@ -477,19 +561,20 @@
};
Calendar.nextYearControl = function(context) {
- return Calendar.getControl(context, null, ">>", "nextYear");
+ return Calendar.getControl(context, null, ">> "+context.calendar.getNextYear(), "nextYear");
};
Calendar.previousYearControl = function(context) {
- return Calendar.getControl(context, null, "<<", "prevYear");
+ return Calendar.getControl(context, null, context.calendar.getPrevYear()+" <<", "prevYear");
};
Calendar.nextMonthControl = function(context) {
- return Calendar.getControl(context, null, ">", "nextMonth");
+ return Calendar.getControl(context, null, "> "+context.calendar.getNextMonth(true), "nextMonth");
};
Calendar.previousMonthControl = function(context) {
- return Calendar.getControl(context, null, "<", "prevMonth");
+ return Calendar.getControl(context, null, context.calendar.getPrevMonth(true)+" <", "prevMonth");
};
Calendar.dateControl = function(context) {
- return Calendar.getControl(context, {style: 'width: 100%'}, "Date", "");
+ var value =" " + context.calendar.getCurrentYear() + ", " + context.calendar.getCurrentMonth(true) + " ";
+ return value;//new T('div',{id:context.calendar.id+":currentyearmonth"},null);//Calendar.getControl(context, {style: 'width: 100%'}, "Date", "");
};
Calendar.header =
@@ -501,23 +586,23 @@
[
new E('td',{'class': 'calendar_tool calendar_btn'},
[
- new ET(function (context) { return Richfaces.eval("previousYearControl", context)})
+ new ET(function (context) { return Richfaces.evalMacro("Calendar.previousYearControl", context)})
]),
new E('td',{'class': 'calendar_tool calendar_btn'},
[
- new ET(function (context) { return Richfaces.eval("previousMonthControl", context)})
+ new ET(function (context) { return Richfaces.evalMacro("Calendar.previousMonthControl", context)})
]),
- new E('td',{'class': 'calendar_month calendar_btn'},
+ new E('td',{'class': 'calendar_month'},
[
- new ET(function (context) { return Richfaces.eval("dateControl", context)})
+ new ET(function (context) { return Richfaces.evalMacro("Calendar.dateControl", context)})
]),
new E('td',{'class': 'calendar_tool calendar_btn'},
[
- new ET(function (context) { return Richfaces.eval("nextMonthControl", context)})
+ new ET(function (context) { return Richfaces.evalMacro("Calendar.nextMonthControl", context)})
]),
new E('td',{'class': 'calendar_tool calendar_btn'},
[
- new ET(function (context) { return Richfaces.eval("nextYearControl", context)})
+ new ET(function (context) { return Richfaces.evalMacro("Calendar.nextYearControl", context)})
])
])
])
Modified: branches/3.0.2/sandbox/calendar/src/main/templates/org/richfaces/htmlCalendar.jspx
===================================================================
--- branches/3.0.2/sandbox/calendar/src/main/templates/org/richfaces/htmlCalendar.jspx 2007-07-12 13:18:19 UTC (rev 1603)
+++ branches/3.0.2/sandbox/calendar/src/main/templates/org/richfaces/htmlCalendar.jspx 2007-07-12 14:07:25 UTC (rev 1604)
@@ -29,7 +29,8 @@
weekDayBarId: '#{clientId}WeekDay',
currentDate: new Date(2007,6,1),
selectedDate: new Date(2007,4,5),
- weekDayLabels: ['Sun','Mon','Tue','Wen','Thu','Fri','Sat'],
+ weekDayLabels: ['Sun','Mon','Tue','Wen','Thu','Fri','Sat'],
+ monthLabels: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'],
firstWeekDay: 0,
minDaysInFirstWeek: 4,
dayListMarkup:
17 years, 6 months
JBoss Rich Faces SVN: r1603 - trunk/docs/ajaxguide/en/src/main/docbook/modules.
by richfaces-svn-commits@lists.jboss.org
Author: afedosik
Date: 2007-07-12 09:18:19 -0400 (Thu, 12 Jul 2007)
New Revision: 1603
Modified:
trunk/docs/ajaxguide/en/src/main/docbook/modules/a4jUGstart.xml
Log:
"relevant" resources added
Modified: trunk/docs/ajaxguide/en/src/main/docbook/modules/a4jUGstart.xml
===================================================================
--- trunk/docs/ajaxguide/en/src/main/docbook/modules/a4jUGstart.xml 2007-07-12 12:31:52 UTC (rev 1602)
+++ trunk/docs/ajaxguide/en/src/main/docbook/modules/a4jUGstart.xml 2007-07-12 13:18:19 UTC (rev 1603)
@@ -255,4 +255,8 @@
<title>Other Relevant Resources</title>
<para><ulink url="http://jsf.javabeat.net/articles/2007/06/introduction-to-ajax4jsf/3">Introduction to Ajax4Jsf - Sample Application</ulink> by Shunmuga Raja</para>
</section>
+ <section id="Relevant_src">
+ <title>Other Relevant Resources</title>
+ <para><ulink url="http://jsf.javabeat.net/articles/2007/06/introduction-to-ajax4jsf/3">Introduction to Ajax4Jsf - Sample Application</ulink> by Shunmuga Raja</para>
+ </section>
</chapter>
17 years, 6 months
JBoss Rich Faces SVN: r1602 - in trunk/docs/ajaxguide/en/src/main/docbook: modules and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: afedosik
Date: 2007-07-12 08:31:52 -0400 (Thu, 12 Jul 2007)
New Revision: 1602
Added:
trunk/docs/ajaxguide/en/src/main/docbook/modules/a4jRelevantRsc.xml
Modified:
trunk/docs/ajaxguide/en/src/main/docbook/master.xml
Log:
"relevant" resources for Library chapter
Modified: trunk/docs/ajaxguide/en/src/main/docbook/master.xml
===================================================================
--- trunk/docs/ajaxguide/en/src/main/docbook/master.xml 2007-07-11 18:28:41 UTC (rev 1601)
+++ trunk/docs/ajaxguide/en/src/main/docbook/master.xml 2007-07-12 12:31:52 UTC (rev 1602)
@@ -7,6 +7,7 @@
<!ENTITY envSettings SYSTEM "modules/a4jUGenvsettings.xml">
<!ENTITY usingAJAX SYSTEM "modules/a4jUGusingAJAX.xml">
<!ENTITY componentDetails SYSTEM "../../../target/generated/a4j.xml">
+ <!ENTITY a4jRelevantRsc SYSTEM "modules/a4jRelevantRsc.xml">
<!ENTITY skinnability SYSTEM "modules/a4jUGskinnability.xml">
<!ENTITY IDEintegration SYSTEM "modules/a4jUGideintegration.xml">
<!ENTITY EVCP SYSTEM "modules/a4jUGevcp.xml">
@@ -34,6 +35,7 @@
<?dbhtml filename="AjaxComponentsLibrary.html"?>
<title>Ajax4jsf components</title>
&componentDetails;
+ &a4jRelevantRsc;
</chapter>
&skinnability;
&IDEintegration;
Added: trunk/docs/ajaxguide/en/src/main/docbook/modules/a4jRelevantRsc.xml
===================================================================
--- trunk/docs/ajaxguide/en/src/main/docbook/modules/a4jRelevantRsc.xml (rev 0)
+++ trunk/docs/ajaxguide/en/src/main/docbook/modules/a4jRelevantRsc.xml 2007-07-12 12:31:52 UTC (rev 1602)
@@ -0,0 +1,5 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<section id="Relevant_src_library">
+ <title>Other Relevant Resources</title>
+ <para><ulink url="http://jsf.javabeat.net/articles/2007/06/introduction-to-ajax4jsf/2">Introduction to Ajax4Jsf - Exploring the Ajax4Jsf Library</ulink> by Shunmuga Raja</para>
+</section>
17 years, 6 months
JBoss Rich Faces SVN: r1601 - in trunk: docs/docbook and 5 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2007-07-11 14:28:41 -0400 (Wed, 11 Jul 2007)
New Revision: 1601
Modified:
trunk/docs/ajaxguide/en/
trunk/docs/docbook/
trunk/docs/maven-docbook-plugin/
trunk/docs/xslt/
trunk/framework/impl/src/main/java/org/ajax4jsf/util/style/CSSFormat.java
trunk/framework/impl/src/main/java/org/ajax4jsf/util/style/CSSSelector.java
trunk/framework/impl/src/main/java/org/ajax4jsf/webapp/nekko/HtmlCorrectionFilter.java
trunk/framework/impl/src/main/java/org/ajax4jsf/webapp/nekko/HtmlCorrectionState.java
trunk/samples/
Log:
Invalid package declarations fixed
Property changes on: trunk/docs/ajaxguide/en
___________________________________________________________________
Name: svn:ignore
+ .classpath
.project
.settings
target
Property changes on: trunk/docs/docbook
___________________________________________________________________
Name: svn:ignore
+ .classpath
.project
.settings
target
Property changes on: trunk/docs/maven-docbook-plugin
___________________________________________________________________
Name: svn:ignore
+ .classpath
.project
.settings
target
Property changes on: trunk/docs/xslt
___________________________________________________________________
Name: svn:ignore
+ .classpath
.project
.settings
target
Modified: trunk/framework/impl/src/main/java/org/ajax4jsf/util/style/CSSFormat.java
===================================================================
--- trunk/framework/impl/src/main/java/org/ajax4jsf/util/style/CSSFormat.java 2007-07-11 17:53:57 UTC (rev 1600)
+++ trunk/framework/impl/src/main/java/org/ajax4jsf/util/style/CSSFormat.java 2007-07-11 18:28:41 UTC (rev 1601)
@@ -19,7 +19,7 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-package org.ajax4jsf.framework.util.style;
+package org.ajax4jsf.util.style;
import java.util.HashMap;
import java.util.Iterator;
Modified: trunk/framework/impl/src/main/java/org/ajax4jsf/util/style/CSSSelector.java
===================================================================
--- trunk/framework/impl/src/main/java/org/ajax4jsf/util/style/CSSSelector.java 2007-07-11 17:53:57 UTC (rev 1600)
+++ trunk/framework/impl/src/main/java/org/ajax4jsf/util/style/CSSSelector.java 2007-07-11 18:28:41 UTC (rev 1601)
@@ -19,7 +19,7 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-package org.ajax4jsf.framework.util.style;
+package org.ajax4jsf.util.style;
/**
* @author Maksim Kaszynski
Modified: trunk/framework/impl/src/main/java/org/ajax4jsf/webapp/nekko/HtmlCorrectionFilter.java
===================================================================
--- trunk/framework/impl/src/main/java/org/ajax4jsf/webapp/nekko/HtmlCorrectionFilter.java 2007-07-11 17:53:57 UTC (rev 1600)
+++ trunk/framework/impl/src/main/java/org/ajax4jsf/webapp/nekko/HtmlCorrectionFilter.java 2007-07-11 18:28:41 UTC (rev 1601)
@@ -19,7 +19,7 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-package org.ajax4jsf.framework.ajax.xmlfilter.nekko;
+package org.ajax4jsf.webapp.nekko;
import org.apache.xerces.util.XMLAttributesImpl;
import org.apache.xerces.xni.Augmentations;
Modified: trunk/framework/impl/src/main/java/org/ajax4jsf/webapp/nekko/HtmlCorrectionState.java
===================================================================
--- trunk/framework/impl/src/main/java/org/ajax4jsf/webapp/nekko/HtmlCorrectionState.java 2007-07-11 17:53:57 UTC (rev 1600)
+++ trunk/framework/impl/src/main/java/org/ajax4jsf/webapp/nekko/HtmlCorrectionState.java 2007-07-11 18:28:41 UTC (rev 1601)
@@ -19,7 +19,7 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-package org.ajax4jsf.framework.ajax.xmlfilter.nekko;
+package org.ajax4jsf.webapp.nekko;
import org.apache.xerces.xni.Augmentations;
import org.apache.xerces.xni.QName;
Property changes on: trunk/samples
___________________________________________________________________
Name: svn:ignore
+ target
17 years, 6 months
JBoss Rich Faces SVN: r1600 - in branches/3.0.2/richfaces/suggestionbox/src/main: java/org/richfaces/renderkit/html and 1 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: sergeyhalipov
Date: 2007-07-11 13:53:57 -0400 (Wed, 11 Jul 2007)
New Revision: 1600
Modified:
branches/3.0.2/richfaces/suggestionbox/src/main/config/component/suggestionbox.xml
branches/3.0.2/richfaces/suggestionbox/src/main/java/org/richfaces/renderkit/html/SuggestionBoxRenderer.java
branches/3.0.2/richfaces/suggestionbox/src/main/resources/org/richfaces/renderkit/html/scripts/suggestionbox.js
Log:
http://jira.jboss.com/jira/browse/RF-441
Modified: branches/3.0.2/richfaces/suggestionbox/src/main/config/component/suggestionbox.xml
===================================================================
--- branches/3.0.2/richfaces/suggestionbox/src/main/config/component/suggestionbox.xml 2007-07-11 15:12:41 UTC (rev 1599)
+++ branches/3.0.2/richfaces/suggestionbox/src/main/config/component/suggestionbox.xml 2007-07-11 17:53:57 UTC (rev 1600)
@@ -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: branches/3.0.2/richfaces/suggestionbox/src/main/java/org/richfaces/renderkit/html/SuggestionBoxRenderer.java
===================================================================
--- branches/3.0.2/richfaces/suggestionbox/src/main/java/org/richfaces/renderkit/html/SuggestionBoxRenderer.java 2007-07-11 15:12:41 UTC (rev 1599)
+++ branches/3.0.2/richfaces/suggestionbox/src/main/java/org/richfaces/renderkit/html/SuggestionBoxRenderer.java 2007-07-11 17:53:57 UTC (rev 1600)
@@ -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.
Modified: branches/3.0.2/richfaces/suggestionbox/src/main/resources/org/richfaces/renderkit/html/scripts/suggestionbox.js
===================================================================
--- branches/3.0.2/richfaces/suggestionbox/src/main/resources/org/richfaces/renderkit/html/scripts/suggestionbox.js 2007-07-11 15:12:41 UTC (rev 1599)
+++ branches/3.0.2/richfaces/suggestionbox/src/main/resources/org/richfaces/renderkit/html/scripts/suggestionbox.js 2007-07-11 17:53:57 UTC (rev 1600)
@@ -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;
@@ -427,6 +429,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 +457,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);
}
}
17 years, 6 months
JBoss Rich Faces SVN: r1599 - in trunk: ui/tree/src/main/config/component and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: vkukharchuk
Date: 2007-07-11 11:12:41 -0400 (Wed, 11 Jul 2007)
New Revision: 1599
Modified:
trunk/docs/userguide/en/src/main/docbook/included/modalPanel.desc.xml
trunk/docs/userguide/en/src/main/docbook/included/modalPanel.xml
trunk/ui/tree/src/main/config/component/tree.xml
Log:
http://jira.jboss.com/jira/browse/RF-428
http://jira.jboss.com/jira/browse/RF-426
Modified: trunk/docs/userguide/en/src/main/docbook/included/modalPanel.desc.xml
===================================================================
--- trunk/docs/userguide/en/src/main/docbook/included/modalPanel.desc.xml 2007-07-11 15:12:38 UTC (rev 1598)
+++ trunk/docs/userguide/en/src/main/docbook/included/modalPanel.desc.xml 2007-07-11 15:12:41 UTC (rev 1599)
@@ -29,11 +29,9 @@
<itemizedlist>
<listitem>Highly customizable look and feel</listitem>
-
- <listitem>Support of draggable operations and size changes by a
- user</listitem>
-
+ <listitem>Support of draggable operations and size changes by a user</listitem>
<listitem>Easy positioning for the modal dialog window</listitem>
+ <listitem>Possibility to restore of the previous component state on a page (including position on the screen) after submitting and reloading</listitem>
</itemizedlist>
</section>
</section>
\ No newline at end of file
Modified: trunk/docs/userguide/en/src/main/docbook/included/modalPanel.xml
===================================================================
--- trunk/docs/userguide/en/src/main/docbook/included/modalPanel.xml 2007-07-11 15:12:38 UTC (rev 1598)
+++ trunk/docs/userguide/en/src/main/docbook/included/modalPanel.xml 2007-07-11 15:12:41 UTC (rev 1599)
@@ -241,7 +241,30 @@
</para>
<programlisting role="JAVA">onshow="alert(event.parameters.param1)"</programlisting>
<para> Here, during modalPanel opening the value of a passing parameter is output. </para>
-
+ <para>
+ There is a possibility to restore of the previous component state on a page (including position on the screen) after submitting and reloading.
+ The modalPanel has some special attributes like 'showWhenRendered' and 'keepVisualState'.
+ </para>
+ <para>
+ showWhenRendered - This boolean attribute is used if modalPanel should be rendered after first page loading.
+ </para>
+ <para>
+ keepVisualState - Used if modalPanel should save state after submission.
+ If keepVisualState=true then parameters which modalPanel has during opening should be submitted and passed to new page.
+ </para>
+
+ <para>
+ <emphasis role="bold">Example:</emphasis>
+ </para>
+
+ <programlisting role="JAVA"><![CDATA[...
+<a href="javascript:Richfaces.showModalPanel('_panel', {top:'10px', left:'10px', height:'400'});">Show</a>
+...
+ ]]></programlisting>
+ <para>
+ Here, if user opens modal dialog window using current link and after submits data then modalPanel destination and height on new loaded page will be restored.
+ </para>
+
</section>
<section>
Modified: trunk/ui/tree/src/main/config/component/tree.xml
===================================================================
--- trunk/ui/tree/src/main/config/component/tree.xml 2007-07-11 15:12:38 UTC (rev 1598)
+++ trunk/ui/tree/src/main/config/component/tree.xml 2007-07-11 15:12:41 UTC (rev 1599)
@@ -211,20 +211,31 @@
<property>
<name>stateAdvisor</name>
<classname>java.lang.Object</classname>
- <description>
+ <description>
+ValueBinding pointing at instance of class implementing org.richfaces.component.state.TreeStateAdvisor interface.
</description>
</property>
<property>
<name>adviseNodeOpened</name>
<classname>javax.faces.el.MethodBinding</classname>
- <description>
+ <description>
+MethodBinding pointing at a method accepting an org.richfaces.component.UITree with return of java.lang.Boolean type.
+If returned value is:
+java.lang.Boolean. TRUE, a particular treeNode is expanded;
+java.lang.Boolean.FALSE, a particular treeNode is collapsed;
+null, a particular treeNode saves the current state
</description>
<methodargs>org.richfaces.component.UITree.class</methodargs>
</property>
<property>
<name>adviseNodeSelected</name>
<classname>javax.faces.el.MethodBinding</classname>
- <description>
+ <description>
+MethodBinding pointing at a method accepting an org.richfaces.component.UITree with return of java.lang.Boolean type.
+If returned value is:
+java.lang.Boolean. TRUE, a particular treeNode is selected;
+java.lang.Boolean.FALSE, a particular treeNode is unselected;
+null, a particular treeNode saves the current state
</description>
<methodargs>org.richfaces.component.UITree.class</methodargs>
</property>
17 years, 6 months
JBoss Rich Faces SVN: r1598 - trunk/docs/userguide/en/src/main/docbook/modules.
by richfaces-svn-commits@lists.jboss.org
Author: vkorluzhenko
Date: 2007-07-11 11:12:38 -0400 (Wed, 11 Jul 2007)
New Revision: 1598
Modified:
trunk/docs/userguide/en/src/main/docbook/modules/RFCfaq.xml
Log:
fixed error
Modified: trunk/docs/userguide/en/src/main/docbook/modules/RFCfaq.xml
===================================================================
--- trunk/docs/userguide/en/src/main/docbook/modules/RFCfaq.xml 2007-07-11 14:46:55 UTC (rev 1597)
+++ trunk/docs/userguide/en/src/main/docbook/modules/RFCfaq.xml 2007-07-11 15:12:38 UTC (rev 1598)
@@ -42,7 +42,7 @@
</section>
<section>
- <?dbhtml filename="HowtobuildRichFacessnapshotmanually"?>
+ <?dbhtml filename="HowtobuildRichFacessnapshotmanually.html"?>
<title>How to build RichFaces snapshot manually?</title>
<para>As it was mentioned <ulink url="index.html#Wherearethesnapshots">
before</ulink> you can download the snapshots or you can build them
@@ -52,7 +52,7 @@
</section>
<section>
- <?dbhtml filename="WhatstructureofRichFacesSVNrepositoryis"?>
+ <?dbhtml filename="WhatstructureofRichFacesSVNrepositoryis.html"?>
<title>What is the structure of RichFaces SVN repository?</title>
<para>RichFaces repository structure overview can be found <ulink
url="http://labs.jboss.com/wiki/RichFacesRepositoryStructureOverview"
@@ -60,7 +60,7 @@
</section>
<section>
- <?dbhtml filename="Howtobuildrichfaces-samplesapplications"?>
+ <?dbhtml filename="Howtobuildrichfaces-samplesapplications.html"?>
<title>How to build richfaces-samples applications?</title>
<para>How to build and how to use richfaces-samples applications in Eclipse is
described <ulink
@@ -69,7 +69,7 @@
</section>
<section>
- <?dbhtml filename="IstheredemoforRichFacescomponents"?>
+ <?dbhtml filename="IstheredemoforRichFacescomponents.html"?>
<title>Where could I find a demo for RichFaces 3.0.1 components?</title>
<para>Online demo Web applications that show the most important functionality of
RichFaces components are available <ulink
@@ -83,7 +83,7 @@
</section>
<section>
- <?dbhtml filename="HowtouseSkinnability"?>
+ <?dbhtml filename="HowtouseSkinnability.html"?>
<title>How to use Skinnability?</title>
<para><ulink
url="http://www.jboss.com/index.html?module=bb&op=viewtopic&t=111143"
@@ -97,7 +97,7 @@
</section>
<section>
- <?dbhtml filename="WhyRichFaceslibrarycondataTablecomp"?>
+ <?dbhtml filename="WhyRichFaceslibrarycondataTablecomp.html"?>
<title>Why RichFaces library contains <rich:dataTable> component,
though there is the standard <h:dataTable>?</title>
<para>The article about <emphasis role="bold"
@@ -113,7 +113,7 @@
</section>
<section id="Organizewizards">
- <?dbhtml filename="Organizewizards"?>
+ <?dbhtml filename="Organizewizards.html"?>
<title>How to organize wizards using the <rich:modalPanel> component?</title>
<para>It's necessary to put <emphasis role="bold"
><a4j:include></emphasis> inside the <emphasis
@@ -172,7 +172,7 @@
</section>
<section>
- <?dbhtml filename="Howtopreventmodalpanelfromclosure"?>
+ <?dbhtml filename="Howtopreventmodalpanelfromclosure.html"?>
<title>How to prevent modalPanel from closing when the validation inside fails?</title>
<para>Examples of validation in <emphasis role="bold"
><rich:modalPanel></emphasis> could be found in the
@@ -183,7 +183,7 @@
</section>
<section>
- <?dbhtml filename="HowtousesuggestionBox"?>
+ <?dbhtml filename="HowtousesuggestionBox.html"?>
<title>Why when I use suggestionBox inside the modalPanel content the popup
suggestion list doesn't show since it is behind the modalPanel.</title>
<para>To solve this problem you should use the latest versions of Ajax4JSF
@@ -196,7 +196,7 @@
</section>
<section>
- <?dbhtml filename="DoesRichFacesworkwithfacelets"?>
+ <?dbhtml filename="DoesRichFacesworkwithfacelets.html"?>
<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. Full Facelets support is one of
@@ -204,7 +204,7 @@
</section>
<section>
- <?dbhtml filename="Isitpossibletocreatedynamicmenu"?>
+ <?dbhtml filename="Isitpossibletocreatedynamicmenu.html"?>
<title>Is it possible to create dynamic menu using <rich:dropDownMenu>
component?</title>
<para><emphasis role="bold"><rich:dropDownMenu></emphasis> is a
@@ -213,7 +213,7 @@
</section>
<section>
- <?dbhtml filename="Isitpossibletocustomizelookofdatascroller"?>
+ <?dbhtml filename="Isitpossibletocustomizelookofdatascroller.html"?>
<title>Is it possible to customize the look of dataScroller (the forward/back
buttons) and replace them with an images?</title>
<para>The answer is yes. </para>
@@ -250,8 +250,8 @@
</section>
<section>
- <?dbhtml filename="Howtoredirecttoanotherpage"?>
- <title>How to place a simple links inside menu?</title>
+ <?dbhtml filename="Howtoredirecttoanotherpage.html"?>
+ <title>How to place simple links inside menu?</title>
<para>If you want to navigate outside, when application uses an external URL, you
should use the following approach:</para>
@@ -278,7 +278,7 @@
</section>
<section>
- <?dbhtml filename="CanthedropDownMenubeincludedintreenodes"?>
+ <?dbhtml filename="CanthedropDownMenubeincludedintreenodes.html"?>
<title>Can I use dropDownMenu as context menu?</title>
<para>The <emphasis role="bold"><rich:dropDownMenu></emphasis> is
designed keeping in mind that it should not be used for a contextMenu
@@ -288,7 +288,7 @@
</section>
<section>
- <?dbhtml filename="HowtocustomizesimpleTogglePanel"?>
+ <?dbhtml filename="HowtocustomizesimpleTogglePanel.html"?>
<title>How to pass own parameters during a modalPanel opening or closing?</title>
<para>The answer could be found in the "Details of usage" of <link
linkend="modalPanel"><rich:modalPanel>
@@ -296,7 +296,7 @@
</section>
<section>
- <?dbhtml filename="Howtoaddalinktothetreenode"?>
+ <?dbhtml filename="Howtoaddalinktothetreenode.html"?>
<title>How to add a simple link to the tree node?</title>
<para>Simple code is placed below:</para>
@@ -319,7 +319,7 @@
</section>
<section>
- <?dbhtml filename="Isitpossibletoplacetabsvertically"?>
+ <?dbhtml filename="Isitpossibletoplacetabsvertically.html"?>
<title>Is it possible to place tabs upright in the tabPanel?</title>
<para>It's not possible to place tabs upright in the tabPanel. For this
purporse use togglePanel. Toggle controls can be placed anywhere in the
@@ -327,7 +327,7 @@
</section>
<section>
- <?dbhtml filename="HowtogetaacommandButton"?>
+ <?dbhtml filename="HowtogetaacommandButton.html"?>
<title>How to get a commandButton working within the modalPanel?</title>
<para>Simple code is placed below:</para>
@@ -351,7 +351,7 @@
</section>
<section>
- <?dbhtml filename="Howtoremembercurrentselectedtab"?>
+ <?dbhtml filename="Howtoremembercurrentselectedtab.html"?>
<title>How to define the currently selected tab?</title>
<para> Simple code is placed below:</para>
@@ -375,7 +375,7 @@
</section>
<section>
- <?dbhtml filename="Howtoretrievethecurrentvalue"?>
+ <?dbhtml filename="Howtoretrievethecurrentvalue.html"?>
<title>How to retrieve the current value from the inputNumberSlider?</title>
<para>To catch the value of the inputNumberSlider from the JavaScrip, use the
following approach:</para>
@@ -403,7 +403,7 @@
</section>
<section>
- <?dbhtml filename="Howtoapplyskins"?>
+ <?dbhtml filename="Howtoapplyskins.html"?>
<title>How to apply skins to the standard input components?</title>
<para>The answer could be found <ulink
url="http://www.jboss.com/index.html?module=bb&op=viewtopic&t=103494"
@@ -411,7 +411,7 @@
</section>
<section>
- <?dbhtml filename="Isthereawaytocapturetherowdata"?>
+ <?dbhtml filename="Isthereawaytocapturetherowdata.html"?>
<title>Is there a way to capture the rowdata of dataTable and subTable?</title>
<para> For necessary information you can see discussion about this problem on the
<ulink
@@ -420,7 +420,7 @@
</section>
<section>
- <?dbhtml filename="Isitpossibletouse thedatascroller"?>
+ <?dbhtml filename="Isitpossibletouse thedatascroller.html"?>
<title>Is it possible to use datascroller without its table border and styles (to
show only links)?</title>
<para> It' necessary to redefine rich* classes for example like this:</para>
@@ -440,7 +440,7 @@
</section>
<section>
- <?dbhtml filename="subTableincombinationwithdataTable"?>
+ <?dbhtml filename="subTableincombinationwithdataTable.html"?>
<title>How to use subTable in combination with dataTable?</title>
<para>The answer could be found <ulink
url="http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4059044#..."
@@ -448,7 +448,7 @@
</section>
<section id="Truepagination">
- <?dbhtml filename="Howtodotruepagination"?>
+ <?dbhtml filename="Howtodotruepagination.html"?>
<title>How to do true pagination using datascroller (load a part of data from
database)?</title>
<para>The answer could be found on the <ulink
@@ -467,5 +467,13 @@
available <ulink url="http://livedemo.exadel.com/a4j-repeat/"
>here</ulink>.</para>
</section>
+
+ <section>
+ <?dbhtml filename="Howtomakehtmlscrollbars.html"?>
+ <title>How to make html scrollbars in modalPanel?</title>
+ <para>The answer could be found on the <ulink
+ url="http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4062877#..."
+ >RichFaces Users Forum</ulink>.</para>
+ </section>
</chapter>
17 years, 6 months
JBoss Rich Faces SVN: r1597 - in branches/3.0.2/sandbox/scrollable-grid/src/main: templates/org/richfaces and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: dmorozov
Date: 2007-07-11 10:46:55 -0400 (Wed, 11 Jul 2007)
New Revision: 1597
Modified:
branches/3.0.2/sandbox/scrollable-grid/src/main/java/org/richfaces/renderkit/html/ScrollableGridBaseRenderer.java
branches/3.0.2/sandbox/scrollable-grid/src/main/templates/org/richfaces/scrollable-grid-cell.jspx
Log:
1. Move columnClass attribute to COL tag
2. add style attribute for COL tag
Modified: branches/3.0.2/sandbox/scrollable-grid/src/main/java/org/richfaces/renderkit/html/ScrollableGridBaseRenderer.java
===================================================================
--- branches/3.0.2/sandbox/scrollable-grid/src/main/java/org/richfaces/renderkit/html/ScrollableGridBaseRenderer.java 2007-07-11 13:58:47 UTC (rev 1596)
+++ branches/3.0.2/sandbox/scrollable-grid/src/main/java/org/richfaces/renderkit/html/ScrollableGridBaseRenderer.java 2007-07-11 14:46:55 UTC (rev 1597)
@@ -85,6 +85,11 @@
public void renderContent(FacesContext context, UIScrollableGridColumn column, ResponseWriter writer, GridRendererState state) throws IOException {
writer.startElement("col", column);
getUtils().writeAttribute(writer, "width", column.getAttributes().get("width"));
+ getUtils().writeAttribute(writer, "style", column.getAttributes().get("style"));
+ int cell_index = state.getCellIndex();
+ Object columnClass = state.getColumnClass(cell_index);
+ if(columnClass!=null) getUtils().writeAttribute(writer, "class", columnClass);
+
writer.endElement("col");
}
};
Modified: branches/3.0.2/sandbox/scrollable-grid/src/main/templates/org/richfaces/scrollable-grid-cell.jspx
===================================================================
--- branches/3.0.2/sandbox/scrollable-grid/src/main/templates/org/richfaces/scrollable-grid-cell.jspx 2007-07-11 13:58:47 UTC (rev 1596)
+++ branches/3.0.2/sandbox/scrollable-grid/src/main/templates/org/richfaces/scrollable-grid-cell.jspx 2007-07-11 14:46:55 UTC (rev 1597)
@@ -11,7 +11,7 @@
component="javax.faces.component.UIComponent"
>
- <td class="ClientUI_Grid_BC Idg-column-cell #{columnClass} #{component.attributes['styleClass']}" id="#{client_id}:c_#{cell_id}">
+ <td class="ClientUI_Grid_BC Idg-column-cell #{component.attributes['styleClass']}" id="#{client_id}:c_#{cell_id}">
<div id="#{client_id}:bc_#{cell_id}" class="ClientUI_Grid_BCBody #{component.attributes['cellClass']}" style="#{component.attributes['cellStyle']}">
<vcp:body/>
</div>
17 years, 6 months
JBoss Rich Faces SVN: r1596 - branches/3.0.2/richfaces/tree/src/main/resources/org/richfaces/renderkit/html/scripts.
by richfaces-svn-commits@lists.jboss.org
Author: sergeyhalipov
Date: 2007-07-11 09:58:47 -0400 (Wed, 11 Jul 2007)
New Revision: 1596
Modified:
branches/3.0.2/richfaces/tree/src/main/resources/org/richfaces/renderkit/html/scripts/tree-item.js
branches/3.0.2/richfaces/tree/src/main/resources/org/richfaces/renderkit/html/scripts/tree.js
Log:
http://jira.jboss.com/jira/browse/RF-372
Modified: branches/3.0.2/richfaces/tree/src/main/resources/org/richfaces/renderkit/html/scripts/tree-item.js
===================================================================
--- branches/3.0.2/richfaces/tree/src/main/resources/org/richfaces/renderkit/html/scripts/tree-item.js 2007-07-11 12:00:11 UTC (rev 1595)
+++ branches/3.0.2/richfaces/tree/src/main/resources/org/richfaces/renderkit/html/scripts/tree-item.js 2007-07-11 13:58:47 UTC (rev 1596)
@@ -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: branches/3.0.2/richfaces/tree/src/main/resources/org/richfaces/renderkit/html/scripts/tree.js
===================================================================
--- branches/3.0.2/richfaces/tree/src/main/resources/org/richfaces/renderkit/html/scripts/tree.js 2007-07-11 12:00:11 UTC (rev 1595)
+++ branches/3.0.2/richfaces/tree/src/main/resources/org/richfaces/renderkit/html/scripts/tree.js 2007-07-11 13:58:47 UTC (rev 1596)
@@ -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);
17 years, 6 months