JBoss Rich Faces SVN: r1665 - in branches/3.0.2/sandbox/scrollable-grid/src/main: resources/org/richfaces/renderkit/html/css and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: dmorozov
Date: 2007-07-17 14:12:51 -0400 (Tue, 17 Jul 2007)
New Revision: 1665
Modified:
branches/3.0.2/sandbox/scrollable-grid/src/main/javascript/ClientUI/controls/grid/GridBody.js
branches/3.0.2/sandbox/scrollable-grid/src/main/resources/org/richfaces/renderkit/html/css/grid.xcss
Log:
Add elipses for cutted by cell container text.
Modified: branches/3.0.2/sandbox/scrollable-grid/src/main/javascript/ClientUI/controls/grid/GridBody.js
===================================================================
--- branches/3.0.2/sandbox/scrollable-grid/src/main/javascript/ClientUI/controls/grid/GridBody.js 2007-07-17 17:53:32 UTC (rev 1664)
+++ branches/3.0.2/sandbox/scrollable-grid/src/main/javascript/ClientUI/controls/grid/GridBody.js 2007-07-17 18:12:51 UTC (rev 1665)
@@ -183,9 +183,9 @@
this.rowsCount = Math.min(templNormal.rows.length, this.grid.dataModel.getCount());
var cell = templNormal.rows[0].cells[0];
this.defaultRowHeight = cell!=null ? Element.getHeight(cell) : 0;
- if(ClientUILib.isGecko) {
- this.defaultRowHeight -= this.getBorderWidth("tb") + this.getPadding("tb");
- }
+ //if(ClientUILib.isGecko) {
+ // this.defaultRowHeight -= this.getBorderWidth("tb") + this.getPadding("tb");
+ //}
this.helpObj = new ClientUI.common.box.Box(templFrozen, null, true);
this.countToLoad = 0;
this.startRow = 0;
@@ -204,9 +204,9 @@
},
updateSize: function() {
this.defaultRowHeight = Element.getHeight(this.templNormal.getElement().rows[0].cells[0]);
- if(ClientUILib.isGecko) {
- this.defaultRowHeight -= this.getBorderWidth("tb") + this.getPadding("tb");
- }
+ //if(ClientUILib.isGecko) {
+ // this.defaultRowHeight -= this.getBorderWidth("tb") + this.getPadding("tb");
+ //}
},
updateLayout: function() {
if(!this.controlCreated || !this.grid.controlCreated) {
Modified: branches/3.0.2/sandbox/scrollable-grid/src/main/resources/org/richfaces/renderkit/html/css/grid.xcss
===================================================================
--- branches/3.0.2/sandbox/scrollable-grid/src/main/resources/org/richfaces/renderkit/html/css/grid.xcss 2007-07-17 17:53:32 UTC (rev 1664)
+++ branches/3.0.2/sandbox/scrollable-grid/src/main/resources/org/richfaces/renderkit/html/css/grid.xcss 2007-07-17 18:12:51 UTC (rev 1665)
@@ -297,6 +297,10 @@
position: relative;
display: block;
overflow: hidden;
+ -o-text-overflow: ellipsis;
+ text-overflow: ellipsis;
+ -moz-box-sizing: border-box;
+ -moz-outline: none;
width: 100%;
height: 20px;
}
17 years, 6 months
JBoss Rich Faces SVN: r1663 - in trunk/sandbox/ui: message and 19 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: abelevich
Date: 2007-07-17 13:27:07 -0400 (Tue, 17 Jul 2007)
New Revision: 1663
Added:
trunk/sandbox/ui/message/
trunk/sandbox/ui/message/pom.xml
trunk/sandbox/ui/message/src/
trunk/sandbox/ui/message/src/main/
trunk/sandbox/ui/message/src/main/config/
trunk/sandbox/ui/message/src/main/config/component/
trunk/sandbox/ui/message/src/main/config/component/message.xml
trunk/sandbox/ui/message/src/main/java/
trunk/sandbox/ui/message/src/main/java/org/
trunk/sandbox/ui/message/src/main/java/org/richfaces/
trunk/sandbox/ui/message/src/main/java/org/richfaces/component/
trunk/sandbox/ui/message/src/main/java/org/richfaces/component/UIRichMessage.java
trunk/sandbox/ui/message/src/main/java/org/richfaces/renderkit/
trunk/sandbox/ui/message/src/main/java/org/richfaces/renderkit/html/
trunk/sandbox/ui/message/src/main/java/org/richfaces/renderkit/html/RichMessageBaseRenderer.java
trunk/sandbox/ui/message/src/main/templates/
trunk/sandbox/ui/message/src/main/templates/org/
trunk/sandbox/ui/message/src/main/templates/org/richfaces/
trunk/sandbox/ui/message/src/main/templates/org/richfaces/message.jspx
trunk/sandbox/ui/message/src/test/
trunk/sandbox/ui/message/src/test/java/
trunk/sandbox/ui/message/src/test/java/org/
trunk/sandbox/ui/message/src/test/java/org/richfaces/
trunk/sandbox/ui/message/src/test/java/org/richfaces/sandbox/
trunk/sandbox/ui/message/src/test/java/org/richfaces/sandbox/component/
trunk/sandbox/ui/message/src/test/java/org/richfaces/sandbox/component/JSFComponentTest.java
Log:
richfaces message component skeleton without markup
Added: trunk/sandbox/ui/message/pom.xml
===================================================================
--- trunk/sandbox/ui/message/pom.xml (rev 0)
+++ trunk/sandbox/ui/message/pom.xml 2007-07-17 17:27:07 UTC (rev 1663)
@@ -0,0 +1,50 @@
+<?xml version="1.0"?><project>
+ <parent>
+ <artifactId>ui</artifactId>
+ <groupId>org.richfaces.sandbox</groupId>
+ <version>3.1.0-SNAPSHOT</version>
+ </parent>
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>org.richfaces.sandbox.ui</groupId>
+ <artifactId>message</artifactId>
+ <name>Message</name>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.richfaces.cdk</groupId>
+ <artifactId>maven-cdk-plugin</artifactId>
+ <version>3.1.0-SNAPSHOT</version>
+ <executions>
+ <execution>
+ <phase>generate-sources</phase>
+ <goals>
+ <goal>generate</goal>
+ </goals>
+ </execution>
+ <execution>
+ <id>generate-test-sources</id>
+ <phase>generate-test-sources</phase>
+ <goals>
+ <goal>generate-tests</goal>
+ </goals>
+ </execution>
+ </executions>
+ <configuration>
+ <library>
+ <prefix>org.richfaces</prefix>
+ <taglib>
+ <shortName>message</shortName>
+ </taglib>
+ </library>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+ <dependencies>
+ <dependency>
+ <groupId>org.richfaces.framework</groupId>
+ <artifactId>impl</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ </dependencies>
+</project>
\ No newline at end of file
Added: trunk/sandbox/ui/message/src/main/config/component/message.xml
===================================================================
--- trunk/sandbox/ui/message/src/main/config/component/message.xml (rev 0)
+++ trunk/sandbox/ui/message/src/main/config/component/message.xml 2007-07-17 17:27:07 UTC (rev 1663)
@@ -0,0 +1,173 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE components PUBLIC "-//AJAX4JSF//CDK Generator config/EN" "https://ajax4jsf.dev.java.net/nonav/dtds/component-config.dtd" >
+<components>
+ <component>
+ <name>org.richfaces.component.RichMessage</name>
+ <family>org.richfaces.component.RichMessage</family>
+ <classname>
+ org.richfaces.component.html.HtmlRichMessage
+ </classname>
+ <superclass>org.richfaces.component.UIRichMessage</superclass>
+
+ <test>
+ <classname>org.richfaces.component.html.HtmlRichMessageTest</classname>
+ <superclassname>org.ajax4jsf.tests.AbstractAjax4JsfTestCase</superclassname>
+ </test>
+
+ <description>
+ <![CDATA[ richfaces Message Component ]]>
+ </description>
+
+ <renderer generate="true" override="true">
+ <name>org.richfaces.renderkit.html.RichMessageRenderer</name>
+ <template>org/richfaces/message.jspx</template>
+ </renderer>
+ <tag>
+ <name>message</name>
+ <classname>org.richfaces.taglib.RichMessageTag</classname>
+ <superclass>
+ org.ajax4jsf.webapp.taglib.HtmlComponentTagBase
+ </superclass>
+
+ <test>
+ <classname>org.richfaces.taglib.RichMessageTagTest</classname>
+ <superclassname>org.ajax4jsf.tests.AbstractAjax4JsfTestCase</superclassname>
+ </test>
+
+ </tag>
+
+ <property>
+ <name>passedLabel</name>
+ <classname>java.lang.String</classname>
+ <description>
+ Attribute should define the label to be displayed when no message appears
+ </description>
+ </property>
+
+ <property>
+ <name>markerLocation</name>
+ <classname>java.lang.String</classname>
+ <description>
+ marker location relatively to informational part. Possible values are left(default) and right
+ </description>
+ <defaultvalue>"left"</defaultvalue>
+ </property>
+
+ <property>
+ <name>for</name>
+ <classname>java.lang.String</classname>
+ <description>
+ Client identifier of the component for which to display messages
+ </description>
+ </property>
+
+ <property>
+ <name>showDetail</name>
+ <classname>boolean</classname>
+ <defaultvalue>true</defaultvalue>
+ </property>
+
+ <property>
+ <name>showSummary</name>
+ <classname>boolean</classname>
+ <defaultvalue>false</defaultvalue>
+ </property>
+
+ <property>
+ <name>title</name>
+ <classname>java.lang.String</classname>
+ </property>
+
+ <property>
+ <name>tooltip</name>
+ <classname>java.lang.String</classname>
+ </property>
+
+ <property>
+ <name>errorClass</name>
+ <classname>java.lang.String</classname>
+ </property>
+
+ <property>
+ <name>fatalClass</name>
+ <classname>java.lang.String</classname>
+ </property>
+
+ <property>
+ <name>infoClass</name>
+ <classname>java.lang.String</classname>
+ </property>
+
+ <property>
+ <name>styleClass</name>
+ <classname>java.lang.String</classname>
+ </property>
+
+ <property>
+ <name>warnClass</name>
+ <classname>java.lang.String</classname>
+ </property>
+
+ <property>
+ <name>errorMarkerClass</name>
+ <classname>java.lang.String</classname>
+ </property>
+
+ <property>
+ <name>warnClass</name>
+ <classname>java.lang.String</classname>
+ </property>
+
+ <property>
+ <name>errorMarkerClass</name>
+ <classname>java.lang.String</classname>
+ </property>
+
+ <property>
+ <name>fatalMarkerClass</name>
+ <classname>java.lang.String</classname>
+ </property>
+
+ <property>
+ <name>infoMarkerClass</name>
+ <classname>java.lang.String</classname>
+ </property>
+
+ <property>
+ <name>warnMarkerClass</name>
+ <classname>java.lang.String</classname>
+ </property>
+
+ <property>
+ <name>MarkerClass</name>
+ <classname>java.lang.String</classname>
+ </property>
+
+ <property>
+ <name>errorLabelClass</name>
+ <classname>java.lang.String</classname>
+ </property>
+
+ <property>
+ <name>fatalLabelClass</name>
+ <classname>java.lang.String</classname>
+ </property>
+
+ <property>
+ <name>infoLabelClass</name>
+ <classname>java.lang.String</classname>
+ </property>
+
+ <property>
+ <name>warnLabelClass</name>
+ <classname>java.lang.String</classname>
+ </property>
+
+ <property>
+ <name>LabelClass</name>
+ <classname>java.lang.String</classname>
+ </property>
+ &ui_component_attributes;
+ </component>
+
+</components>
\ No newline at end of file
Added: trunk/sandbox/ui/message/src/main/java/org/richfaces/component/UIRichMessage.java
===================================================================
--- trunk/sandbox/ui/message/src/main/java/org/richfaces/component/UIRichMessage.java (rev 0)
+++ trunk/sandbox/ui/message/src/main/java/org/richfaces/component/UIRichMessage.java 2007-07-17 17:27:07 UTC (rev 1663)
@@ -0,0 +1,11 @@
+package org.richfaces.component;
+
+import javax.faces.component.UIMessage;
+
+
+/**
+ * @author Anton Belevich
+ *
+ */
+public abstract class UIRichMessage extends UIMessage{
+}
\ No newline at end of file
Added: trunk/sandbox/ui/message/src/main/java/org/richfaces/renderkit/html/RichMessageBaseRenderer.java
===================================================================
--- trunk/sandbox/ui/message/src/main/java/org/richfaces/renderkit/html/RichMessageBaseRenderer.java (rev 0)
+++ trunk/sandbox/ui/message/src/main/java/org/richfaces/renderkit/html/RichMessageBaseRenderer.java 2007-07-17 17:27:07 UTC (rev 1663)
@@ -0,0 +1,12 @@
+package org.richfaces.renderkit.html;
+
+import org.ajax4jsf.renderkit.RendererBase;
+
+
+/**
+ * @author Anton Belevich
+ *
+ */
+public abstract class RichMessageBaseRenderer extends RendererBase{
+}
+
\ No newline at end of file
Added: trunk/sandbox/ui/message/src/main/templates/org/richfaces/message.jspx
===================================================================
--- trunk/sandbox/ui/message/src/main/templates/org/richfaces/message.jspx (rev 0)
+++ trunk/sandbox/ui/message/src/main/templates/org/richfaces/message.jspx 2007-07-17 17:27:07 UTC (rev 1663)
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<f:root
+ xmlns:f="http://ajax4jsf.org/cdk/template"
+ xmlns:c=" http://java.sun.com/jsf/core"
+ xmlns:ui=" http://ajax4jsf.org/cdk/ui"
+ xmlns:u=" http://ajax4jsf.org/cdk/u"
+ xmlns:x=" http://ajax4jsf.org/cdk/x"
+ xmlns:h=" http://ajax4jsf.org/cdk/headers"
+ xmlns:vcp="http://ajax4jsf.org/cdk/vcp"
+ class="org.richfaces.renderkit.html.RichMessageRenderer"
+ baseclass="org.richfaces.renderkit.html.RichMessageBaseRenderer"
+ component="org.richfaces.component.UIRichMessage"
+ >
+
+</f:root>
\ No newline at end of file
Added: trunk/sandbox/ui/message/src/test/java/org/richfaces/sandbox/component/JSFComponentTest.java
===================================================================
--- trunk/sandbox/ui/message/src/test/java/org/richfaces/sandbox/component/JSFComponentTest.java (rev 0)
+++ trunk/sandbox/ui/message/src/test/java/org/richfaces/sandbox/component/JSFComponentTest.java 2007-07-17 17:27:07 UTC (rev 1663)
@@ -0,0 +1,53 @@
+/**
+ * License Agreement.
+ *
+ * Ajax4jsf 1.1 - Natural Ajax for Java Server Faces (JSF)
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+package org.richfaces.sandbox.component;
+
+import junit.framework.Test;
+import junit.framework.TestCase;
+import junit.framework.TestSuite;
+import javax.faces.component.UIComponent;
+
+/**
+ * Unit test for simple Component.
+ */
+public class JSFComponentTest
+ extends TestCase
+{
+ /**
+ * Create the test case
+ *
+ * @param testName name of the test case
+ */
+ public JSFComponentTest( String testName )
+ {
+ super( testName );
+ }
+
+
+ /**
+ * Rigourous Test :-)
+ */
+ public void testComponent()
+ {
+ assertTrue( true );
+ }
+}
17 years, 6 months
JBoss Rich Faces SVN: r1662 - branches/3.0.2/sandbox/scrollable-grid/src/main/resources/org/richfaces/renderkit/html/css.
by richfaces-svn-commits@lists.jboss.org
Author: dmorozov
Date: 2007-07-17 13:02:08 -0400 (Tue, 17 Jul 2007)
New Revision: 1662
Modified:
branches/3.0.2/sandbox/scrollable-grid/src/main/resources/org/richfaces/renderkit/html/css/grid.xcss
Log:
Little bit increase default row height
Modified: branches/3.0.2/sandbox/scrollable-grid/src/main/resources/org/richfaces/renderkit/html/css/grid.xcss
===================================================================
--- branches/3.0.2/sandbox/scrollable-grid/src/main/resources/org/richfaces/renderkit/html/css/grid.xcss 2007-07-17 16:15:46 UTC (rev 1661)
+++ branches/3.0.2/sandbox/scrollable-grid/src/main/resources/org/richfaces/renderkit/html/css/grid.xcss 2007-07-17 17:02:08 UTC (rev 1662)
@@ -298,7 +298,7 @@
display: block;
overflow: hidden;
width: 100%;
- height: 16px;
+ height: 20px;
}
/**
17 years, 6 months
JBoss Rich Faces SVN: r1661 - 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-17 12:15:46 -0400 (Tue, 17 Jul 2007)
New Revision: 1661
Modified:
branches/3.0.2/richfaces/tree/src/main/resources/org/richfaces/renderkit/html/scripts/tree.js
Log:
http://jira.jboss.com/jira/browse/RF-459
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-17 16:06:42 UTC (rev 1660)
+++ branches/3.0.2/richfaces/tree/src/main/resources/org/richfaces/renderkit/html/scripts/tree.js 2007-07-17 16:15:46 UTC (rev 1661)
@@ -109,7 +109,7 @@
},
getElements: function() {
- var contentId = this.id + Tree.ID_DEVIDER + Tree.ID_CHILDS_ROW + Tree.ID_DEVIDER + Tree.ID_CHILDS_TD;
+ var contentId = this.id;
this.elements.contentTd = $(contentId);
17 years, 6 months
JBoss Rich Faces SVN: r1660 - in branches/3.0.2/sandbox/calendar/src/main: resources/org/richfaces/renderkit/html/scripts and 1 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: pyaschenko
Date: 2007-07-17 12:06:42 -0400 (Tue, 17 Jul 2007)
New Revision: 1660
Modified:
branches/3.0.2/sandbox/calendar/src/main/resources/org/richfaces/renderkit/html/css/calendar.xcss
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:
Design update
SelectedDate and CurrentDate Input fields added
Support of Macrodefinition with input fields added
Some additions, improvements and optimization
Modified: branches/3.0.2/sandbox/calendar/src/main/resources/org/richfaces/renderkit/html/css/calendar.xcss
===================================================================
--- branches/3.0.2/sandbox/calendar/src/main/resources/org/richfaces/renderkit/html/css/calendar.xcss 2007-07-17 16:03:00 UTC (rev 1659)
+++ branches/3.0.2/sandbox/calendar/src/main/resources/org/richfaces/renderkit/html/css/calendar.xcss 2007-07-17 16:06:42 UTC (rev 1660)
@@ -85,11 +85,11 @@
color : #ff7800; /*unknown parameter - need to add*/
}
-.calendar_current{
+/*.calendar_current{
background-color : #ff7800; /*unknown parameter - need to add*/
color : #ffebda; /*unknown parameter - need to add*/
font-weight : bold;
-}
+}*/
.calendar_spec{
background-color : #e4f5e2; /*unknown parameter - need to add*/
@@ -201,11 +201,22 @@
background-color : #e4f5e2; /*unknown parameter - need to add
}
*/
+ <u:selector name=".calendar_current">
+ <u:style name="background-color" value="#ff7800"/> /*unknown parameter - need to add*/
+ <u:style name="color" value="#ffebda"/> /*unknown parameter - need to add*/
+ <u:style name="font-weight" value="bold"/>
+ </u:selector>
+
<u:selector name=".calendar_select">
<u:style name="background-color" skin="headerBackgroundColor"/>
<u:style name="color" skin="headerTextColor"/>
</u:selector>
+ <u:selector name=".calendar_select">
+ <u:style name="background-color" skin="headerBackgroundColor"/>
+ <u:style name="color" skin="headerTextColor"/>
+ </u:selector>
+
<u:selector name=".calendar_toolfooter">
<u:style name="border-top" skin="panelBorderColor"/>
<u:style name="border-right" skin="panelBorderColor"/>
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-17 16:03:00 UTC (rev 1659)
+++ branches/3.0.2/sandbox/calendar/src/main/resources/org/richfaces/renderkit/html/scripts/calendar.js 2007-07-17 16:06:42 UTC (rev 1660)
@@ -36,7 +36,7 @@
* Date:
* d - 1-31
* dd+ - 01-31 */
-Object.extend(Date, {
+Object.extend(Date.prototype, {
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'];
@@ -58,7 +58,7 @@
}
);
}
-})
+});
function isLeapYear(year) {
return new Date(year, 1, 29).getDate()==29;
@@ -115,7 +115,6 @@
return weeknumber;
}
-
Calendar = Class.create();
Object.extend(Calendar.prototype, {
initialize: function(id,parameters) {
@@ -149,6 +148,8 @@
this.firstWeekendDayNumber = 6-this.params.firstWeekDay;
this.secondWeekendDayNumber = (this.params.firstWeekDay>0 ? 7-this.params.firstWeekDay : 0);
+ this.calendarContext = new CalendarContext(this);
+
/*this.ids = {
currentYearMonthId: this.id+':currentyearmonth'
};*/
@@ -156,32 +157,30 @@
this.daysData = {startDate:null, days:[]};
this.days = [];
- 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.getNextYearControl,
- previousYearControl: Calendar.getPreviousYearControl,
- nextMonthControl: Calendar.getNextMonthControl,
- previousMonthControl: Calendar.getPreviousMonthControl,
- dateControl: Calendar.getDateControl,
- componentId: id,*/
- calendar:this
- };
- 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';
+ var htmlTextHeader = '<input id="'+this.id+'InputSelectedDate" name="'+this.id+'InputSelectedDate" type="hidden" value="'+this.getSelectedDateString()+'"/>\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>'
+ var htmlControlsFooter = '<tr><th colspan="8" id="'+this.id+':footer"></th></tr>'
+ var htmlTextFooter = '</tbody></table>\n';
// days bar creation
+ var styleClass;
+ var bottomStyleClass;
var htmlTextWeekDayBar='';
if (this.params.showWeekDaysBar)
{
var htmlTextWeekDayBar = '<tr id="'+this.params.weekDayBarId+'">';
- if (this.params.showWeeksBar) htmlTextWeekDayBar+='<td style="border-top:0px"></td>';
+ if (this.params.showWeeksBar) htmlTextWeekDayBar+='<td style="calendar_days"><br/></td>';
var weekDayCounter = this.params.firstWeekDay;
for (var i=0;i<7;i++)
{
- var weekDayHtml = this.params.weekDayMarkup( {weekDayLabel: this.params.weekDayLabels[weekDayCounter], weekDayNumber:weekDayCounter} );
+ var weekDayHtml = this.params.weekDayMarkup( {weekDayLabel: this.params.weekDayLabels[weekDayCounter], weekDayNumber:weekDayCounter, componentId:this.getWeekDayComponentId(i)} );
if (weekDayCounter==6) weekDayCounter=0; else weekDayCounter++;
-
- htmlTextWeekDayBar+='<td class="'+(i==this.firstWeekendDayNumber || i==this.secondWeekendDayNumber ? "Weekendclass" : "Dayclass")+'">'+weekDayHtml+'</td>';
+
+ styleClass = (i==this.firstWeekendDayNumber || i==this.secondWeekendDayNumber ? "Weekendclass" : "calendar_days");
+ if (i==6) styleClass +=" right_cell";
+ htmlTextWeekDayBar+='<td class="'+styleClass+'">'+weekDayHtml+'</td>';
}
htmlTextWeekDayBar+='</tr>\n';
}
@@ -195,32 +194,59 @@
htmlTextWeek+='<tr id="'+this.params.weekNumberBarId+k+'">';
if (this.params.showWeeksBar)
{
- var weekNumberHtml = this.params.weekNumberMarkup( {weekNumber: k} );
- htmlTextWeek+='<td>'+weekNumberHtml+'</td>';
+ var weekNumberHtml = this.params.weekNumberMarkup( {weekNumber: k, componentId:this.getWeekNumberComponentId(k-1)} );
+ htmlTextWeek+='<td class="calendar_week">'+weekNumberHtml+'</td>';
}
+
+ // day cells creation
+ bottomStyleClass = (k==6 ? "bottom_cell " : "");
for (var i=0;i<7;i++)
{
- htmlTextWeek+='<td id="'+this.params.dayListTableId+':cell'+p+'" style="vertical-align:top"></td>';
+ styleClass = bottomStyleClass+"cell_size calendar_cell calendar_btn";
+ if (i==this.firstWeekendDayNumber || i==this.secondWeekendDayNumber) styleClass+=" calendar_holly";
+ if (i==6) styleClass+=" right_cell";
+
+ htmlTextWeek+='<td class="'+styleClass+'" id="'+this.params.dayListTableId+'Cell'+p+'"></td>';
p++;
}
htmlTextWeek+='</tr>';
}
+
+ // footer
+
// set content
var obj=$(id);
obj.component = this;
obj.richfacesComponent="richfaces:calendar";
- obj.innerHTML = htmlTextHeader+htmlControlsHeader+htmlTextWeekDayBar+htmlTextWeek+htmlTextFooter;
+ obj.innerHTML = htmlTextHeader+Calendar.headerOptional+htmlControlsHeader+htmlTextWeekDayBar+htmlTextWeek+htmlControlsFooter+Calendar.footerOptional+htmlTextFooter;
this.submitFunction = this.params.submitFunction.bind(this);
this.prepareEvents();
},
+ getWeekDayComponentId: function (v) {
+ return this.id+"WeekDay"+v;
+ },
+
+ getWeekNumberComponentId: function (v) {
+ return this.id+"WeekNumber"+v;
+ },
+
+ getDateComponentId: function (v) {
+ return this.id+"Date"+v;
+ },
+
+ getCurrentDate: function() {
+ return this.currentDate;
+ },
getSelectedDate: function() {
+ if (!this.selectedDate) return null; else return this.selectedDate;
+ },
+ getSelectedDateString: function(pattern) {
if (!this.selectedDate) return "";
- var value = this.selectedDate.getMonth()+1; value = (value<10 ? "0"+value : value);
- var date = this.selectedDate.getDate(); value += "/"+(date<10 ? "0"+date : date);
- return value+"/"+this.selectedDate.getFullYear();
+ if (!pattern) pattern = "dd/MM/y";
+ return this.selectedDate.format(pattern);
},
getPrevYear: function() {
@@ -280,7 +306,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)
{
@@ -293,9 +319,8 @@
this.selectedDateElement = obj;
Element.addClassName(obj, "Selecteddayclass");
- var selecteddate = this.getSelectedDate();
- $('div_'+this.params.dayListTableId+'_selected_date').innerHTML=selecteddate;
- $(this.id+':input').value=selecteddate;
+ $(this.id+'InputSelectedDate').value=this.getSelectedDateString();
+ this.renderFooter();
} else {
if (daydata._month==-1) this.prevMonth(); else this.nextMonth();
}
@@ -303,7 +328,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)
{
@@ -313,7 +338,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)
{
@@ -322,12 +347,12 @@
}
},
- load:function(daysData) {
+ load:function(daysData, isAjaxMode) {
// startDate,
// days:array[]
// {
// data
- // enabled
+ // enabled boolean or function
// isEnabled function
// text1: 'Meeting...',
// text2: 'Meeting...'
@@ -337,19 +362,26 @@
// }
if (daysData) {
- this.daysData = this.indexData(daysData);
+ this.daysData = this.indexData(daysData, isAjaxMode);
} else {
this.daysData = null;
}
- this.update();
+
+ this.render();
},
- indexData:function(daysData) {
+ indexData:function(daysData, isAjaxMode) {
var dateYear = daysData.startDate.getFullYear();
var dateMonth = daysData.startDate.getMonth();
daysData.index = [];
daysData.index[dateYear+'-'+dateMonth] = 0;
+ if (isAjaxMode)
+ {
+ this.currentDate = daysData.startDate;
+ this.currentDate.setDate(1);
+ return daysData;
+ }
var idx = daysInMonthByDate(daysData.startDate)-daysData.startDate.getDate()+1;
while (daysData.days[idx])
@@ -361,7 +393,7 @@
return daysData;
},
- update:function() {
+ render:function() {
this.todayDate = new Date();
var currentYear = this.getCurrentYear();
@@ -373,9 +405,6 @@
var selectedflag = (currentYear == this.selectedDate.getFullYear() && currentMonth == this.selectedDate.getMonth())
var selecteddate = this.selectedDate.getDate();
- //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);
var previousMonthDays = daysInMonth(currentYear, currentMonth-1);
@@ -436,12 +465,9 @@
}
// render
- //header render
- var header = $(this.id+":header");
- if (header)
- {
- header.innerHTML = Calendar.header.getContent({calendar:this});
- }
+ this.renderHeader();
+ this.renderFooter();
+
//days render
p=0;
var element;
@@ -451,6 +477,8 @@
this.selectedDayElement=null;
var weekflag=true;
+ var e;
+
//var _d=new Date();
for (var k=1;k<7;k++)
@@ -471,20 +499,31 @@
wn=1;
weekflag=false;
}
- element.innerHTML = this.params.weekNumberMarkup( {weekNumber: wn++} );
+ element.innerHTML = this.params.weekNumberMarkup( {weekNumber: wn++, componentId:this.getWeekNumberComponentId(k-1)} );
if (k==1&&wn>52) wn=1;
element = element.nextSibling;
}
while (element)
{
+ // TODO calendar_spec class not implemented
// TODO fix start/stop event's calls
this.stopCellEvents(element);
element.data=dataobj.day;
+ dataobj.componentId=this.getDateComponentId(p);
element.innerHTML = this.params.dayListMarkup( dataobj );
- element.className = dataobj._className + (todayflag && dataobj._month==0 && dataobj.day==todaydate ? " Todayclass" : "");
- if (selectedflag && dataobj._month==0 && dataobj.day==selecteddate) { this.selectedDateElement = element; element.className+=" Selecteddayclass"; }
+
+ // class styles
+ e = Element.classNames(element);
+ // ?? dataobj._className
+ // TODO make some optimization with calendar_current class
+ if (todayflag && dataobj._month==0 && dataobj.day==todaydate) e.add("calendar_current"); else e.remove("calendar_current");
+ if (selectedflag && dataobj._month==0 && dataobj.day==selecteddate) {
+ this.selectedDateElement = element;
+ e.add("Selecteddayclass");
+ }
+
this.setCellEvents(element);
p++;
@@ -494,27 +533,52 @@
}
//alert(new Date().getTime()-_d.getTime());
},
+ renderHeader: function()
+ {
+ var header = $(this.id+":header");
+ if (header)
+ {
+ header.innerHTML = Calendar.header.getContent(this.calendarContext);
+ }
+ },
+ renderFooter: function()
+ {
+ var footer = $(this.id+":footer");
+ if (footer)
+ {
+ footer.innerHTML = Calendar.footer.getContent(this.calendarContext);
+ }
+ },
+
+ onUpdate: function()
+ {
+ $(this.id+'InputCurrentDate').value=this.getCurrentDate().format("MM/y");
+
+ if (this.submitFunction)
+ this.submitFunction(this.getCurrentMonth() + '/' + this.getCurrentYear());
+ else
+ this.render();
+ },
+
nextMonth: function() {
this.currentDate = new Date(this.currentDate.getFullYear(), this.currentDate.getMonth()+1,1);
- this.submitFunction(this.currentDate.getMonth() + '/' + this.currentDate.getFullYear());
- //this.update();
+ this.onUpdate();
},
prevMonth: function() {
this.currentDate = new Date(this.currentDate.getFullYear(), this.currentDate.getMonth()-1,1);
- this.submitFunction(this.currentDate.getMonth() + '/' + this.currentDate.getFullYear());
- //this.update();
+ this.onUpdate();
},
nextYear: function() {
this.currentDate = new Date(this.currentDate.getFullYear() + 1, this.currentDate.getMonth(),1);
- this.update();
+ this.onUpdate();
},
prevYear: function() {
this.currentDate = new Date(this.currentDate.getFullYear() - 1, this.currentDate.getMonth(),1);
- this.update();
+ this.onUpdate();
},
today: function() {
@@ -532,7 +596,11 @@
this.currentDate = new Date(nowyear, nowmonth, 1);
}
- if (updateflag) this.update();
+ if (updateflag) this.onUpdate();
+ },
+
+ help: function() {
+ alert("Calendar help");
}
});
@@ -551,32 +619,51 @@
Calendar.getControl = function(context, attributes, text, functionName) {
var attr = {
- onclick: (functionName ? "Richfaces.invokeOnComponent('richfaces:calendar',this,'"+functionName+"');" : "")+"return false;"
+ onclick: (functionName ? "Richfaces.invokeOnComponent('richfaces:calendar',this,'"+functionName+"');" : "")+"return false;",
+ width: "100%"
};
if (attributes) {
Object.extend(attr, attributes);
}
- return new E('button',attr,[new T(text)]);
+ return new E('div',attr,[new T(text)]);
};
Calendar.nextYearControl = function(context) {
- return Calendar.getControl(context, null, ">> "+context.calendar.getNextYear(), "nextYear");
+ //return Calendar.getControl(context, null, ">> "+context.calendar.getNextYear(), "nextYear");
+ return Calendar.getControl(context, null, "��", "nextYear");
};
Calendar.previousYearControl = function(context) {
- return Calendar.getControl(context, null, context.calendar.getPrevYear()+" <<", "prevYear");
+ //return Calendar.getControl(context, null, context.calendar.getPrevYear()+" <<", "prevYear");
+ return Calendar.getControl(context, null, "��", "prevYear");
};
Calendar.nextMonthControl = function(context) {
- return Calendar.getControl(context, null, "> "+context.calendar.getNextMonth(true), "nextMonth");
+ //return Calendar.getControl(context, null, "> "+context.calendar.getNextMonth(true), "nextMonth");
+ return Calendar.getControl(context, null, "�", "nextMonth");
};
Calendar.previousMonthControl = function(context) {
- return Calendar.getControl(context, null, context.calendar.getPrevMonth(true)+" <", "prevMonth");
+ //return Calendar.getControl(context, null, context.calendar.getPrevMonth(true)+" <", "prevMonth");
+ return Calendar.getControl(context, null, "�", "prevMonth");
};
-Calendar.dateControl = function(context) {
- 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.currentMonthControl = function(context) {
+ var value =context.calendar.getCurrentDate().format("MMMM, y");
+ return value;
};
+Calendar.todayControl = function(context) {
+ return Calendar.getControl(context, null, "Today", "today");
+};
+Calendar.selectedDateControl = function(context) {
+ var value =context.calendar.getSelectedDateString("dd/MM/y");
+ return value;
+};
+Calendar.helpControl = function(context)
+{
+ return Calendar.getControl(context, null, "Help", "help");
+};
+Calendar.headerOptional ='<tr><td class="calendar_header" colspan="8">Optional Header</td></tr>';
+Calendar.footerOptional ='<tr><td class="calendar_footer" colspan="8">Optional Footer</td></tr>';
+
Calendar.header =
new E('table',{'border': '0', 'cellpadding': '0', 'cellspacing': '0', 'width': '100%'},
[
@@ -586,25 +673,66 @@
[
new E('td',{'class': 'calendar_tool calendar_btn'},
[
- new ET(function (context) { return Richfaces.evalMacro("Calendar.previousYearControl", context)})
+ new ET(function (context) { return Richfaces.evalMacro("previousYearControl", context)})
]),
new E('td',{'class': 'calendar_tool calendar_btn'},
[
- new ET(function (context) { return Richfaces.evalMacro("Calendar.previousMonthControl", context)})
+ new ET(function (context) { return Richfaces.evalMacro("previousMonthControl", context)})
]),
new E('td',{'class': 'calendar_month'},
[
- new ET(function (context) { return Richfaces.evalMacro("Calendar.dateControl", context)})
+ new ET(function (context) { return Richfaces.evalMacro("currentMonthControl", context)})
]),
new E('td',{'class': 'calendar_tool calendar_btn'},
[
- new ET(function (context) { return Richfaces.evalMacro("Calendar.nextMonthControl", context)})
+ new ET(function (context) { return Richfaces.evalMacro("nextMonthControl", context)})
]),
new E('td',{'class': 'calendar_tool calendar_btn'},
[
- new ET(function (context) { return Richfaces.evalMacro("Calendar.nextYearControl", context)})
+ new ET(function (context) { return Richfaces.evalMacro("nextYearControl", context)})
])
])
])
]
- );
\ No newline at end of file
+ );
+
+Calendar.footer =
+ new E('table',{'border': '0', 'cellpadding': '0', 'cellspacing': '0', 'width': '100%'},
+ [
+ new E('tbody',{},
+ [
+ new E('tr',{},
+ [
+ new E('td',{'class': 'calendar_toolfooter'},
+ [
+ new ET(function (context) { return Richfaces.evalMacro("Calendar.selectedDateControl", context)})
+ ]),
+ new E('td',{'class': 'calendar_toolfooter calendar_btn', 'width': '100%'},
+ [
+ new ET(function (context) { return Richfaces.evalMacro("Calendar.helpControl", context)})
+ ]),
+ new E('td',{'class': 'calendar_toolfooter calendar_btn', 'align': 'right'},
+ [
+ new ET(function (context) { return Richfaces.evalMacro("Calendar.todayControl", context)})
+ ])
+ ])
+ ])
+ ]
+ );
+
+
+CalendarContext = Class.create();
+Object.extend(CalendarContext.prototype, {
+ initialize: function(calendar) {
+ this.calendar=calendar;
+ },
+
+ nextYearControl: Calendar.nextYearControl,
+ previousYearControl: Calendar.previousYearControl,
+ nextMonthControl: Calendar.nextMonthControl,
+ previousMonthControl: Calendar.previousMonthControl,
+ currentMonthControl: Calendar.currentMonthControl,
+ todayControl: Calendar.todayControl,
+ selectedDateControl: Calendar.selectedDateControl,
+ helpControl: Calendar.helpControl
+});
\ No newline at end of file
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-17 16:03:00 UTC (rev 1659)
+++ branches/3.0.2/sandbox/calendar/src/main/templates/org/richfaces/htmlCalendar.jspx 2007-07-17 16:06:42 UTC (rev 1660)
@@ -14,7 +14,7 @@
<h:scripts>new org.ajax4jsf.framework.resource.PrototypeScript(),new org.ajax4jsf.framework.ajax.AjaxScript(),/org/richfaces/renderkit/html/scripts/utils.js,/org/richfaces/renderkit/html/scripts/json/json-dom.js,/org/richfaces/renderkit/html/scripts/calendar.js</h:scripts>
<h:styles>/org/richfaces/renderkit/html/css/calendar.xcss</h:styles>
- <div id="#{clientId}" style="width: #{this:qualifySize(component.attributes['width'])}; height: #{this:qualifySize(component.attributes['height'])}; #{component.attributes['style']}" class="#{component.attributes['styleClass']}"
+ <div id="#{clientId}" style="display:inline; width: #{this:qualifySize(component.attributes['width'])}; height: #{this:qualifySize(component.attributes['height'])}; #{component.attributes['style']}" class="#{component.attributes['styleClass']}"
x:passThruWithExclusions="value,name,type,id"
>
17 years, 6 months
JBoss Rich Faces SVN: r1659 - branches/3.0.2/sandbox/scrollable-grid/src/main/resources/org/richfaces/renderkit/html/css.
by richfaces-svn-commits@lists.jboss.org
Author: dmorozov
Date: 2007-07-17 12:03:00 -0400 (Tue, 17 Jul 2007)
New Revision: 1659
Modified:
branches/3.0.2/sandbox/scrollable-grid/src/main/resources/org/richfaces/renderkit/html/css/grid.xcss
Log:
Remove unnecessary style height for body tr
Modified: branches/3.0.2/sandbox/scrollable-grid/src/main/resources/org/richfaces/renderkit/html/css/grid.xcss
===================================================================
--- branches/3.0.2/sandbox/scrollable-grid/src/main/resources/org/richfaces/renderkit/html/css/grid.xcss 2007-07-17 12:54:40 UTC (rev 1658)
+++ branches/3.0.2/sandbox/scrollable-grid/src/main/resources/org/richfaces/renderkit/html/css/grid.xcss 2007-07-17 16:03:00 UTC (rev 1659)
@@ -267,7 +267,6 @@
white-space: nowrap;
box-sizing: border-box;
-moz-box-sizing: border-box;
- height:21px !important;
}
.idg-row-selected-h {
17 years, 6 months
JBoss Rich Faces SVN: r1658 - trunk/docs/ajaxguide/en/src/main/docbook/included.
by richfaces-svn-commits@lists.jboss.org
Author: vkorluzhenko
Date: 2007-07-17 08:54:40 -0400 (Tue, 17 Jul 2007)
New Revision: 1658
Modified:
trunk/docs/ajaxguide/en/src/main/docbook/included/actionparam.desc.xml
Log:
http://jira.jboss.com/jira/browse/AJSF-104
Modified: trunk/docs/ajaxguide/en/src/main/docbook/included/actionparam.desc.xml
===================================================================
--- trunk/docs/ajaxguide/en/src/main/docbook/included/actionparam.desc.xml 2007-07-17 12:54:21 UTC (rev 1657)
+++ trunk/docs/ajaxguide/en/src/main/docbook/included/actionparam.desc.xml 2007-07-17 12:54:40 UTC (rev 1658)
@@ -7,4 +7,11 @@
</emphasis> and <emphasis role="bold">
<property><f:actionListener></property>
</emphasis>.</para>
+ <para>More information about <emphasis role="bold">
+ <property><f:param></property>
+ </emphasis> and <emphasis role="bold">
+ <property><f:actionListener></property>
+ </emphasis> can be found <ulink
+ url="http://java.sun.com/javaee/javaserverfaces/1.2/docs/tlddocs/index.html"
+ >here</ulink>.</para>
</section>
\ No newline at end of file
17 years, 6 months
JBoss Rich Faces SVN: r1657 - trunk/docs/ajaxguide/en/src/main/docbook/included.
by richfaces-svn-commits@lists.jboss.org
Author: vkorluzhenko
Date: 2007-07-17 08:54:21 -0400 (Tue, 17 Jul 2007)
New Revision: 1657
Added:
trunk/docs/ajaxguide/en/src/main/docbook/included/actionparam.xml
Log:
http://jira.jboss.com/jira/browse/AJSF-104
Added: trunk/docs/ajaxguide/en/src/main/docbook/included/actionparam.xml
===================================================================
--- trunk/docs/ajaxguide/en/src/main/docbook/included/actionparam.xml (rev 0)
+++ trunk/docs/ajaxguide/en/src/main/docbook/included/actionparam.xml 2007-07-17 12:54:21 UTC (rev 1657)
@@ -0,0 +1,86 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<chapter>
+ <para>
+ <table frame="all">
+ <title>Component identification parameters</title>
+ <tgroup cols="2">
+ <thead>
+ <row>
+ <entry>Name</entry>
+ <entry>Value</entry>
+ </row>
+ </thead>
+ <tbody>
+ <row>
+ <entry>component-type</entry>
+ <entry>org.ajax4jsf.ajax.ActionParameter</entry>
+ </row>
+ <row>
+ <entry>component-family</entry>
+ <entry> </entry>
+ </row>
+ <row>
+ <entry>component-class</entry>
+ <entry>org.ajax4jsf.ajax.html.HtmlActionParameter</entry>
+ </row>
+ <row>
+ <entry>renderer-type</entry>
+ <entry> </entry>
+ </row>
+ </tbody>
+ </tgroup>
+ </table>
+ </para>
+ <section>
+ <title>Creating on a page</title>
+ <para>Simple component definition example:</para>
+ <para>
+ <emphasis role="bold">Example:</emphasis>
+ </para>
+ <programlisting role="XML"><![CDATA[<a4j:actionParam noEscape="true" name="param1" value="getMyValue()" assignTo="#{bean.prop1}" />]]></programlisting>
+ </section>
+ <section>
+ <title>Dynamical creation of a component from Java code</title>
+ <para>
+ <emphasis role="bold">Example:</emphasis>
+ </para>
+ <programlisting role="JAVA"><![CDATA[import org.ajax4jsf.ajax.html.HtmlActionParameter;
+...
+HtmlActionParameter myActionParameter = new HtmlActionParameter();
+...
+]]></programlisting>
+ </section>
+ <section>
+ <title>Key attributes and ways of usage</title>
+ <para>The component <emphasis role="bold">
+ <property><a4j:actionparam></property>
+ </emphasis> is a combination of the functionality of two JSF tags: <emphasis role="bold">
+ <property><f:param></property>
+ </emphasis> and <emphasis role="bold">
+ <property><f:actionListener></property>
+ </emphasis>.</para>
+ <para>At the render phase, it's decoded by parent component (<emphasis role="bold">
+ <property><h:commandLink></property>
+ </emphasis> or like) as usual. At the process request phase, if the parent component
+ performs an action event, update the value specified in the "assignTo"
+ attribute as its value. If a converter attribute is specified, use it to encode and
+ decode the value to a string stored in the html parameter.</para>
+ <para><emphasis role="bold">
+ <property><a4j:actionparam></property>
+ </emphasis>has a "noEscape" attribute. If it is set to
+ "true", the value will be evaluated as a JavaScript code. </para>
+ <emphasis role="bold">Example:</emphasis>
+ <programlisting role="XML"><![CDATA[...
+ <script>
+ ...
+ var foo = "bar";
+ ...
+ </script>
+ ...
+ <a4j:actionParam noEscape="true" name="param1" value="foo" assignTo="#{bean.prop1}" />
+...]]></programlisting>
+ <para>More information can be found on the <ulink
+ url="http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4063764"
+ >Ajax4JSF Users Forum</ulink>.</para>
+ </section>
+</chapter>
17 years, 6 months
JBoss Rich Faces SVN: r1656 - in branches/3.0.2/sandbox/calendar/src/main/java/org/richfaces: renderkit and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: akushunin
Date: 2007-07-17 08:46:44 -0400 (Tue, 17 Jul 2007)
New Revision: 1656
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/renderkit/CalendarRendererBase.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 12:41:01 UTC (rev 1655)
+++ branches/3.0.2/sandbox/calendar/src/main/java/org/richfaces/component/UICalendar.java 2007-07-17 12:46:44 UTC (rev 1656)
@@ -41,6 +41,7 @@
import javax.faces.context.FacesContext;
import javax.faces.convert.ConverterException;
import javax.faces.convert.DateTimeConverter;
+import javax.faces.el.MethodBinding;
import javax.faces.el.ValueBinding;
import javax.faces.event.AbortProcessingException;
import javax.faces.event.FacesEvent;
@@ -99,43 +100,58 @@
Date valueString = calendar.getCurrentDate();
return valueString.toString();
}
-
- public Date getConvertedValue(FacesContext context,
- String currentDateString) throws ConverterException {
-
- DateTimeConverter datetime = new DateTimeConverter();
- datetime.setPattern("MM/yyyy");
- Date newCurrentDate =(Date)datetime.getAsObject(context, this, currentDateString);
- return newCurrentDate;
- }
-
-/* public void queueEvent(FacesEvent event) {
- FacesEvent resultEvent = event;
- if (event instanceof CurrentDateEvent) {
- event.setPhaseId(PhaseId.APPLY_REQUEST_VALUES);
- } else {
- event.setPhaseId(PhaseId.INVOKE_APPLICATION);
- }
- resultEvent = wrapTreeEvent(event);
- super.queueEvent(resultEvent);
+ public Date getConvertedValue(FacesContext context, String currentDateString)
+ throws ConverterException {
+
+ DateTimeConverter datetime = new DateTimeConverter();
+ datetime.setPattern("MM/yyyy");
+ Date newCurrentDate = (Date) datetime.getAsObject(context, this,
+ currentDateString);
+ return newCurrentDate;
}
-
-*/
- public void updateModel(FacesContext context) {
- if (context == null) {
- throw new NullPointerException();
- }
+ public void updateModel(FacesContext context) {
+
+ if (context == null) {
+ throw new NullPointerException();
+ }
ValueBinding vb = getValueBinding("currentDate");
if (vb != null) {
- vb.setValue(context, getLocalValue());//??
+ vb.setValue(context, getLocalCurrentDate());
setValue(null);
setLocalValueSet(false);
- return;
+ return;
}
- }
+ }
+
+ protected Date getLocalCurrentDate() {
+
+ return this.currentDate;
+ }
+ protected void setLocalCurrentDate(Date currentDate){
+
+ this.currentDate = currentDate;
+ }
+
+ public Object saveState(FacesContext context) {
+
+ Object values[] = new Object[2];
+ values[0] = super.saveState(context);
+ values[1] = saveAttachedState(context, currentDate);
+ return (values);
+
+ }
+
+ public void restoreState(FacesContext context, Object state) {
+
+ Object values[] = (Object[]) state;
+ super.restoreState(context, values[0]);
+ currentDate = (Date) restoreAttachedState(context, values[1]);
+
+ }
+
// --------------------------------------------------------
private int getLastDayOfWeek(Calendar calendar) {
int i = calendar.getFirstDayOfWeek();
@@ -199,11 +215,12 @@
ajaxContext.setResponseData(getPreload());
}
- // added recently
+ /* added recently
if (event instanceof CurrentDateEvent) {
event.getPhaseId();
event.getComponent();
}
+ */
}
public Object getPreload() {
@@ -217,8 +234,7 @@
HashMap args = new HashMap();
args.put("startDate", CalendarRendererBase
.formatDate(preloadDateRange[0]));
- args
- .put("days", new AdaptingCollection(
+ args.put("days", new AdaptingCollection(
calendarDataModelItems));
return args;
}
Modified: branches/3.0.2/sandbox/calendar/src/main/java/org/richfaces/renderkit/CalendarRendererBase.java
===================================================================
--- branches/3.0.2/sandbox/calendar/src/main/java/org/richfaces/renderkit/CalendarRendererBase.java 2007-07-17 12:41:01 UTC (rev 1655)
+++ branches/3.0.2/sandbox/calendar/src/main/java/org/richfaces/renderkit/CalendarRendererBase.java 2007-07-17 12:46:44 UTC (rev 1656)
@@ -86,6 +86,7 @@
super.doDecode(context, component);
String clientId = component.getClientId(context);
+
Map requestParameterMap = context.getExternalContext()
.getRequestParameterMap();
@@ -96,6 +97,9 @@
((UICalendar) component)
.setCurrentDate(convertCurrentDate(currentDateString));
}
+
+
+
// CurrentDateEvent ev = new CurrentDateEvent(component) ;
// ev.setPhaseId(PhaseId.PROCESS_VALIDATIONS);
17 years, 6 months