JBoss Rich Faces SVN: r1705 - in branches/3.0.2/sandbox: calendar/src/main/templates/org/richfaces and 1 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: pyaschenko
Date: 2007-07-19 12:47:25 -0400 (Thu, 19 Jul 2007)
New Revision: 1705
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/templates/org/richfaces/htmlCalendar.jspx
branches/3.0.2/sandbox/scrollable-grid/pom.xml
Log:
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-19 16:28:21 UTC (rev 1704)
+++ branches/3.0.2/sandbox/calendar/src/main/resources/org/richfaces/renderkit/html/scripts/calendar.js 2007-07-19 16:47:25 UTC (rev 1705)
@@ -132,6 +132,16 @@
// showWeekDaysBar - show WeekDays Bar [default value is true]
// showWeeksBar - show Weeks numbers bar [default value is true]
+ // headerHtml - user defined header (optional)
+ // footeHtml - user defined footer (optional)
+
+ // direction - [top-left, top-right, bottom-left, bottom-right, auto]
+ // jointPoint
+ // popup - true
+ // userClasses - inputClass, inputDisabledClass, inputInvalidClass, buttonClass, buttonDisabledClass
+ // id+PopupButton, id+PopupInput,
+
+
this.id = id;
this.params = parameters;
if (!this.params.showWeekDaysBar) this.params.showWeekDaysBar = true;
@@ -161,8 +171,11 @@
var htmlTextHeader = '<input id="'+this.id+'InputSelectedDate" name="'+this.id+'InputSelectedDate" type="hidden" value="'+this.getSelectedDateString(this.params.datePattern)+'"/>\n' +
'<input id="'+this.id+'InputCurrentDate" name="'+this.id+'InputCurrentDate" type="hidden" value="'+this.getCurrentDate().format("MM/y")+'"/>\n' +
'<table border="0" cellpadding="0" cellspacing="0" class="calendar_exterior"><tbody>\n';
- var htmlControlsHeader = '<tr><th colspan="8" id="'+this.id+':header"></th></tr>'
- var htmlControlsFooter = '<tr><th colspan="8" id="'+this.id+':footer"></th></tr>'
+ var colspan = (this.params.showWeeksBar ? "8" : "7");
+ var htmlHeaderOptional = (this.params.headerHtml && this.params.headerHtml!='') ? '<tr><td class="calendar_header" colspan="'+colspan+'">'+this.params.headerHtml+'</td></tr>' : '';
+ var htmlFooterOptional = (this.params.footerHtml && this.params.footerHtml!='') ? '<tr><td class="calendar_footer" colspan="'+colspan+'">'+this.params.footerHtml+'</td></tr>' : '';
+ var htmlControlsHeader = '<tr><td colspan="'+colspan+'" id="'+this.id+':header"></td></tr>'
+ var htmlControlsFooter = '<tr><td colspan="'+colspan+'" id="'+this.id+':footer"></td></tr>'
var htmlTextFooter = '</tbody></table>\n';
// days bar creation
@@ -220,7 +233,7 @@
var obj=$(id);
obj.component = this;
obj.richfacesComponent="richfaces:calendar";
- obj.innerHTML = htmlTextHeader+Calendar.headerOptional+htmlControlsHeader+htmlTextWeekDayBar+htmlTextWeek+htmlControlsFooter+Calendar.footerOptional+htmlTextFooter;
+ obj.innerHTML = htmlTextHeader+htmlHeaderOptional+htmlControlsHeader+htmlTextWeekDayBar+htmlTextWeek+htmlControlsFooter+htmlFooterOptional+htmlTextFooter;
this.submitFunction = this.params.submitFunction.bind(this);
this.prepareEvents();
@@ -247,7 +260,7 @@
getSelectedDateString: function(pattern) {
if (!this.selectedDate) return "";
if (!pattern) pattern = "dd/MM/y";
- return this.selectedDate.format(pattern);
+ return this.selectedDate.format(pattern, this.params.monthLabels, this.params.monthLabelsShort);
},
getPrevYear: function() {
@@ -647,14 +660,14 @@
return Calendar.getControl(context, null, "�", "prevMonth");
};
Calendar.currentMonthControl = function(context) {
- var value =context.calendar.getCurrentDate().format("MMMM, y");
+ var value =context.calendar.getCurrentDate().format("MMMM, y", context.monthLabels, context.monthLabelsShort);
return value;
};
Calendar.todayControl = function(context) {
return Calendar.getControl(context, null, "Today", "today");
};
Calendar.selectedDateControl = function(context) {
- var value = context.calendar.getSelectedDateString(context.calendar.params.datePattern);
+ var value = Calendar.getControl(context, null, context.calendar.getSelectedDateString(context.calendar.params.datePattern), "prevMonth");
return value;
};
Calendar.helpControl = function(context)
@@ -662,8 +675,6 @@
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%'},
@@ -726,6 +737,8 @@
Object.extend(CalendarContext.prototype, {
initialize: function(calendar) {
this.calendar=calendar;
+ this.monthLabels=calendar.params.monthLabels;
+ this.monthLabelsShort=calendar.params.monthLabelsShort;
},
nextYearControl: Calendar.nextYearControl,
@@ -735,5 +748,5 @@
currentMonthControl: Calendar.currentMonthControl,
todayControl: Calendar.todayControl,
selectedDateControl: Calendar.selectedDateControl,
- helpControl: Calendar.helpControl
+ 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-19 16:28:21 UTC (rev 1704)
+++ branches/3.0.2/sandbox/calendar/src/main/templates/org/richfaces/htmlCalendar.jspx 2007-07-19 16:47:25 UTC (rev 1705)
@@ -28,9 +28,12 @@
currentDate: new Date(2007,6,1),
selectedDate: new Date(2007,4,5),
weekDayLabels: ['Sun','Mon','Tue','Wen','Thu','Fri','Sat'],
- monthLabels: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'],
+ monthLabels: ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'],
+ monthLabelsShort: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'],
firstWeekDay: 0,
minDaysInFirstWeek: 4,
+ headerHtml: '<b>User defined header</b>',
+ footerHtml: 'User defined footer',
dayListMarkup:
<jsp:scriptlet>/*<![CDATA[*/
if (component.getChildCount() != 0) {
Modified: branches/3.0.2/sandbox/scrollable-grid/pom.xml
===================================================================
--- branches/3.0.2/sandbox/scrollable-grid/pom.xml 2007-07-19 16:28:21 UTC (rev 1704)
+++ branches/3.0.2/sandbox/scrollable-grid/pom.xml 2007-07-19 16:47:25 UTC (rev 1705)
@@ -7,7 +7,6 @@
<modelVersion>4.0.0</modelVersion>
<groupId>org.richfaces</groupId>
<artifactId>scrollable-grid</artifactId>
- <version>1.0.0-SNAPSHOT</version>
<build>
<plugins>
<plugin>
17 years, 5 months
JBoss Rich Faces SVN: r1704 - trunk/framework/impl/src/main/java/org/ajax4jsf/renderkit/compiler.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2007-07-19 12:28:21 -0400 (Thu, 19 Jul 2007)
New Revision: 1704
Modified:
trunk/framework/impl/src/main/java/org/ajax4jsf/renderkit/compiler/ElementBase.java
Log:
http://jira.jboss.com/jira/browse/RF-269 - baseSkin parameter handling added
Modified: trunk/framework/impl/src/main/java/org/ajax4jsf/renderkit/compiler/ElementBase.java
===================================================================
--- trunk/framework/impl/src/main/java/org/ajax4jsf/renderkit/compiler/ElementBase.java 2007-07-19 16:19:50 UTC (rev 1703)
+++ trunk/framework/impl/src/main/java/org/ajax4jsf/renderkit/compiler/ElementBase.java 2007-07-19 16:28:21 UTC (rev 1704)
@@ -439,14 +439,19 @@
Object getValue(TemplateContext context) {
FacesContext facesContext = context.getFacesContext();
SkinFactory skinFactory = SkinFactory.getInstance();
- Object result = skinFactory.getSkin(facesContext).getParameter(facesContext,_skin,_default);
- if (_baseSkin != null && (result == null || result.toString().length()==0)) {
- if ("inherit".equals(_baseSkin)) {
- result = skinFactory.getBaseSkin(facesContext).getParameter(facesContext,_skin,_default);
- } else {
- result = skinFactory.getBaseSkin(facesContext).getParameter(facesContext,_baseSkin,_default);
+ Object result = null;
+
+ if (_skin != null) {
+ result = skinFactory.getSkin(facesContext).getParameter(facesContext,_skin,_default);
+ } else {
+ if (_baseSkin != null) {
+ result = skinFactory.getSkin(facesContext).getParameter(facesContext,_baseSkin,_default);
}
}
+
+ if (_baseSkin != null && (result == null || result.toString().length()==0)) {
+ result = skinFactory.getBaseSkin(facesContext).getParameter(facesContext,_baseSkin,_default);
+ }
return result;
}
}
17 years, 5 months
JBoss Rich Faces SVN: r1703 - in branches/3.0.2/sandbox: scrollable-grid and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: pyaschenko
Date: 2007-07-19 12:19:50 -0400 (Thu, 19 Jul 2007)
New Revision: 1703
Modified:
branches/3.0.2/sandbox/panel2/pom.xml
branches/3.0.2/sandbox/scrollable-grid/pom.xml
Log:
Modified: branches/3.0.2/sandbox/panel2/pom.xml
===================================================================
--- branches/3.0.2/sandbox/panel2/pom.xml 2007-07-19 16:12:55 UTC (rev 1702)
+++ branches/3.0.2/sandbox/panel2/pom.xml 2007-07-19 16:19:50 UTC (rev 1703)
@@ -1,9 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<parent>
- <artifactId>sandbox-parent</artifactId>
+ <artifactId>richfaces-parent</artifactId>
<groupId>org.richfaces</groupId>
- <version>1.0.0-SNAPSHOT</version>
+ <version>3.0.2-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>org.richfaces</groupId>
Modified: branches/3.0.2/sandbox/scrollable-grid/pom.xml
===================================================================
--- branches/3.0.2/sandbox/scrollable-grid/pom.xml 2007-07-19 16:12:55 UTC (rev 1702)
+++ branches/3.0.2/sandbox/scrollable-grid/pom.xml 2007-07-19 16:19:50 UTC (rev 1703)
@@ -1,8 +1,8 @@
<?xml version="1.0"?><project>
<parent>
- <artifactId>sandbox-parent</artifactId>
+ <artifactId>richfaces-parent</artifactId>
<groupId>org.richfaces</groupId>
- <version>1.0.0-SNAPSHOT</version>
+ <version>3.0.2-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>org.richfaces</groupId>
17 years, 5 months
JBoss Rich Faces SVN: r1702 - in trunk/framework: impl/src/main/java/org/ajax4jsf/renderkit/compiler and 1 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2007-07-19 12:12:55 -0400 (Thu, 19 Jul 2007)
New Revision: 1702
Modified:
trunk/framework/api/src/main/java/org/richfaces/skin/SkinFactory.java
trunk/framework/impl/src/main/java/org/ajax4jsf/renderkit/compiler/ElementBase.java
trunk/framework/impl/src/main/java/org/ajax4jsf/renderkit/compiler/HtmlCompiler.java
trunk/framework/impl/src/main/java/org/richfaces/skin/SkinFactoryImpl.java
Log:
http://jira.jboss.com/jira/browse/RF-269 - baseSkin parameter handling added
Modified: trunk/framework/api/src/main/java/org/richfaces/skin/SkinFactory.java
===================================================================
--- trunk/framework/api/src/main/java/org/richfaces/skin/SkinFactory.java 2007-07-19 16:04:56 UTC (rev 1701)
+++ trunk/framework/api/src/main/java/org/richfaces/skin/SkinFactory.java 2007-07-19 16:12:55 UTC (rev 1702)
@@ -177,4 +177,13 @@
*/
public static final String SKIN_PARAMETER = "org.ajax4jsf.SKIN";
+ public static final String BASE_SKIN_PARAMETER = "org.ajax4jsf.BASE_SKIN";
+
+ /**
+ * Get base {@link Skin} implementation
+ * @param facesContext
+ * @return
+ */
+ public abstract Skin getBaseSkin(FacesContext facesContext);
+
}
Modified: trunk/framework/impl/src/main/java/org/ajax4jsf/renderkit/compiler/ElementBase.java
===================================================================
--- trunk/framework/impl/src/main/java/org/ajax4jsf/renderkit/compiler/ElementBase.java 2007-07-19 16:04:56 UTC (rev 1701)
+++ trunk/framework/impl/src/main/java/org/ajax4jsf/renderkit/compiler/ElementBase.java 2007-07-19 16:12:55 UTC (rev 1702)
@@ -59,6 +59,7 @@
private Object _context = null;
private String _property = null;
private String _skin ;
+ private String _baseSkin ;
// private String _skinConfiguration ;
private String _call = null;
private PreparedTemplate parent;
@@ -288,22 +289,21 @@
/**
* @param skin The skin to set.
*/
+ public void setBaseSkin(String baseSkin) {
+ _baseSkin = baseSkin;
+// if( null == _skinConfiguration ){
+ // Only Skin parameter is used.
+ valueGetter = new SkinValueGetter();
+ }
+
+ /**
+ * @param skin The skin to set.
+ */
public void setSkin(String skin) {
_skin = skin;
// if( null == _skinConfiguration ){
// Only Skin parameter is used.
- valueGetter = new ValueGetter(){
-
- /* (non-Javadoc)
- * @see org.ajax4jsf.renderkit.compiler.RootElement.ValueGetter#getValue(javax.faces.context.FacesContext, javax.faces.component.UIComponent)
- */
- Object getValue(TemplateContext context) {
- FacesContext facesContext = context.getFacesContext();
- Object parameter = SkinFactory.getInstance().getSkin(facesContext).getParameter(facesContext,_skin,_default);
- return parameter;
- }
-
- };
+ valueGetter = new SkinValueGetter();
// } else {
// valueGetter = new ConfigurationAndSkinValueGetter();
// }
@@ -435,4 +435,20 @@
}
}
+ protected class SkinValueGetter extends ValueGetter {
+ Object getValue(TemplateContext context) {
+ FacesContext facesContext = context.getFacesContext();
+ SkinFactory skinFactory = SkinFactory.getInstance();
+ Object result = skinFactory.getSkin(facesContext).getParameter(facesContext,_skin,_default);
+ if (_baseSkin != null && (result == null || result.toString().length()==0)) {
+ if ("inherit".equals(_baseSkin)) {
+ result = skinFactory.getBaseSkin(facesContext).getParameter(facesContext,_skin,_default);
+ } else {
+ result = skinFactory.getBaseSkin(facesContext).getParameter(facesContext,_baseSkin,_default);
+ }
+ }
+ return result;
+ }
+ }
+
}
Modified: trunk/framework/impl/src/main/java/org/ajax4jsf/renderkit/compiler/HtmlCompiler.java
===================================================================
--- trunk/framework/impl/src/main/java/org/ajax4jsf/renderkit/compiler/HtmlCompiler.java 2007-07-19 16:04:56 UTC (rev 1701)
+++ trunk/framework/impl/src/main/java/org/ajax4jsf/renderkit/compiler/HtmlCompiler.java 2007-07-19 16:12:55 UTC (rev 1702)
@@ -106,6 +106,7 @@
* <ul>
* <li><b>value</b> as string or EL-expression</li>
* <li><b>property</b> name for property of current component</li>
+ * <li><b>baseSkin</b> name for property of base skin</li>
* <li><b>skin</b> name for property of current skin</li>
* <li><b>context</b> name for property of {@link TemplateContext} for trmplate encoding</li>
* <li><b>default</b> use as value if main property <code>null</code></li>
@@ -113,13 +114,13 @@
* Supported :
* <ul>
* <li>Call renderer or utils method <f:call name='xxx' /></li>
- * <li>Call method parameter <f:parameter name='xxx' (value='....' | property='style' | skin='paramName' | context='propertyName ) /></li>
- * <li>Encode plain text <f:verbatim [value='....' | property='style' | skin='paramName' | context='propertyName ] >Some Text</f:text></li>
- * <li>Encode as text in HTML CSS parameter format <u:style name='background' (value='....' | property='style' | skin='paramName' | context='propertyName )/></li>
+ * <li>Call method parameter <f:parameter name='xxx' (value='....' | property='style' | baseSkin='paramName' | skin='paramName' | context='propertyName ) /></li>
+ * <li>Encode plain text <f:verbatim [value='....' | property='style' | baseSkin='paramName' | skin='paramName' | context='propertyName ] >Some Text</f:text></li>
+ * <li>Encode as text in HTML CSS parameter format <u:style name='background' (value='....' | property='style' | baseSkin='paramName' | skin='paramName' | context='propertyName )/></li>
* <li>Get and encode resource <f:resource f:key='images/spacer.gif' [ ... any attributes ... ] /></li>
- * <li>Encode custom attribute <f:attribute name='style' (value='....' | property='style' | skin='paramName' | context='propertyName ) [endorsed='true'] /></li>
+ * <li>Encode custom attribute <f:attribute name='style' (value='....' | property='style' | baseSkin='paramName' | skin='paramName' | context='propertyName ) [endorsed='true'] /></li>
* <li>Template breakpoint <f:break name='xxxxx' /></li>
- * <li>Encode named facet <u:facet ( name='head | property='style' | skin='paramName' | context='propertyName )' /></li>
+ * <li>Encode named facet <u:facet ( name='head | property='style' | baseSkin='paramName' | skin='paramName' | context='propertyName )' /></li>
* <li>Encode children components for current <u:children /></li>
* <li>Encode one child component for enclosed u:facet or u:children <u:child /'></li>
* </ul>
@@ -156,11 +157,11 @@
digestr.addObjectCreate(pattern,ResourceElement.class);
digestr.addSetNext(pattern,CHILD_METHOD);
{
- Rule rule = new PutAttributesRule(digestr,new String[]{NS_PREFIX+"key",NS_PREFIX+"property",NS_PREFIX+"skin",NS_PREFIX+"context"});
+ Rule rule = new PutAttributesRule(digestr,new String[]{NS_PREFIX+"key",NS_PREFIX+"property",NS_PREFIX+"baseSkin",NS_PREFIX+"skin",NS_PREFIX+"context"});
digestr.addRule(pattern,rule);
}
{
- SetPropertiesRule rule = new SetPropertiesRule(new String[]{NS_PREFIX+"key",NS_PREFIX+"property",NS_PREFIX+"skin",NS_PREFIX+"context"},new String[]{"value","property","skin","context"});
+ SetPropertiesRule rule = new SetPropertiesRule(new String[]{NS_PREFIX+"key",NS_PREFIX+"property",NS_PREFIX+"baseSkin",NS_PREFIX+"skin",NS_PREFIX+"context"},new String[]{"value","property","baseSkin","skin","context"});
digestr.addRule(pattern,rule);
}
// custom attribute <f:attribute name='style' (value='....' | property='style' | skin='paramName' | call='methodName' | utilCall='methodName') [notNull='true'] />
Modified: trunk/framework/impl/src/main/java/org/richfaces/skin/SkinFactoryImpl.java
===================================================================
--- trunk/framework/impl/src/main/java/org/richfaces/skin/SkinFactoryImpl.java 2007-07-19 16:04:56 UTC (rev 1701)
+++ trunk/framework/impl/src/main/java/org/richfaces/skin/SkinFactoryImpl.java 2007-07-19 16:12:55 UTC (rev 1702)
@@ -85,6 +85,8 @@
private Properties defaultSkinProperties = null;
private String skinName = null;
private ValueBinding skinBinding = null;
+ private String baseSkinName = null;
+ private ValueBinding baseSkinBinding = null;
private static final Log log = LogFactory.getLog(SkinFactoryImpl.class);
protected Skin getSkinByName(Object currentSkinOrName) {
@@ -119,10 +121,15 @@
public Skin getSkin(FacesContext context) {
// TODO - cache skin for current thread ? or for current Faces Lifecycle
// Phase ?
- Object currentSkinOrName = getSkinOrName(context);
+ Object currentSkinOrName = getSkinOrName(context, false);
return getSkinByName(currentSkinOrName);
}
+ public Skin getBaseSkin(FacesContext context) {
+ Object currentSkinOrName = getSkinOrName(context, true);
+ return getSkinByName(currentSkinOrName);
+ }
+
protected Properties getDefaultSkinProperties() {
if (defaultSkinProperties == null) {
defaultSkinProperties = loadDefaultProperties(DEFAULT_SKIN_PROPERTIES_RESOURCE);
@@ -170,34 +177,55 @@
* binding for speed calculations.
*
* @param context
+ * @param useBase
* @return name of currens skin from init parameter ( "DEFAULT" if no
* parameter ) or {@link Skin } as result of evaluation EL
* expression.
*/
- protected Object getSkinOrName(FacesContext context) {
+ protected Object getSkinOrName(FacesContext context, boolean useBase) {
// Detect skin name
+ ValueBinding binding;
+ String skin;
+
synchronized (this) {
- if (skinName == null && skinBinding == null) {
+ if (useBase) {
+ binding = baseSkinBinding;
+ skin = baseSkinName;
+ } else {
+ binding = skinBinding;
+ skin = skinName;
+ }
+
+ if (binding == null && skin == null) {
String currentSkinName = context.getExternalContext()
- .getInitParameter(SKIN_PARAMETER);
+ .getInitParameter(useBase ? BASE_SKIN_PARAMETER : SKIN_PARAMETER);
if (currentSkinName == null) {
// not set - usr default.
return DEFAULT_SKIN_NAME;
}
if (SkinFactory.isValueReference(currentSkinName)) {
// For EL expression as skin name
- skinBinding = context.getApplication().createValueBinding(
+ binding = context.getApplication().createValueBinding(
currentSkinName);
} else {
- skinName = currentSkinName;
+ skin = currentSkinName;
}
}
+
+ if (useBase) {
+ baseSkinBinding = binding;
+ baseSkinName = skin;
+ } else {
+ skinBinding = binding;
+ skinName = skin;
+ }
+
// }
}
- if (skinBinding != null) {
- return skinBinding.getValue(context);
+ if (binding != null) {
+ return binding.getValue(context);
} else {
- return skinName;
+ return skin;
}
}
17 years, 5 months
JBoss Rich Faces SVN: r1701 - in branches/3.0.2: sandbox-samples/calendar-sample/src/main/webapp/pages and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: akushunin
Date: 2007-07-19 12:04:56 -0400 (Thu, 19 Jul 2007)
New Revision: 1701
Added:
branches/3.0.2/sandbox-samples/calendar-sample/src/main/webapp/pages/Calendar.jsp
Modified:
branches/3.0.2/sandbox/calendar/src/main/templates/org/richfaces/htmlCalendar.jspx
Log:
added input and button for popup mode.
New page for sample application.
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-19 15:43:57 UTC (rev 1700)
+++ branches/3.0.2/sandbox/calendar/src/main/templates/org/richfaces/htmlCalendar.jspx 2007-07-19 16:04:56 UTC (rev 1701)
@@ -1,24 +1,22 @@
<?xml version="1.0" encoding="UTF-8"?>
-<f:root
- xmlns:f="http://ajax4jsf.org/cdk/template"
- xmlns:c=" http://java.sun.com/jsf/core"
+<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:vcp=" http://ajax4jsf.org/cdk/vcp"
class="org.richfaces.renderkit.html.CalendarRenderer"
baseclass="org.richfaces.renderkit.CalendarRendererBase"
- component="org.richfaces.component.UICalendar"
- >
- <f:clientid var="clientId"/>
+ component="org.richfaces.component.UICalendar">
+ <f:clientid var="clientId" />
<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="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"
- >
-
- <script type="text/javascript">
+ <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"><script
+ type="text/javascript">
new Calendar('#{clientId}', {
submitFunction:
<jsp:scriptlet>/*<![CDATA[*/
@@ -72,6 +70,44 @@
writePreloadBody(context, component);
/*]]>*/</jsp:scriptlet>
);
- </script>
+ </script> <jsp:scriptlet>
+ <![CDATA[
+ boolean popup = attributeToBoolean(component, "popup");
+ if (popup) {]]>
+ </jsp:scriptlet>
+ <span> <input
+ x:passThruWithExclusions="name,id"
+ value="#{this:getInputValue(context,component)}"
+ type="text"
+ readonly="#{component.attributes['readonly']}"
+ disabled="#{component.attributes['disabled']}"
+ accesskey="#{component.attributes['accesskey']}"
+ maxlength="#{component.attributes['maxlength']}"
+ onchange="#{component.attributes['onchange']}"
+ onselect="#{component.attributes['onselect']}"
+ onfocus="#{component.attributes['onfocus']}"
+ onblur="#{component.attributes['onblur']}"
+ size="#{component.attributes['inputSize']}"
+ style="#{component.attributes['style']}"
+ tabindex="#{component.attributes['tabindex']}"
+ class="#{component.attributes['class']}"
+ onclick="#{component.attributes['onclick']}">
+ </input>
+ <button id="#{clientId}Button"
+ accesskey="#{component.attributes['accesskey']}"
+ class="#{component.attributes['class']}"
+ name="#{clientId}"
+ onclick="#{component.attributes['onclick']}"
+ value="#{component.attributes['value']"
+ style="#{component.attributes['style']}"
+ tabindex="#{component.attributes['tabindex']}"
+ type="button">
+ </button>
+ </span>
+ <jsp:scriptlet>
+ <![CDATA[
+ }
+ ]]>
+ </jsp:scriptlet>
</div>
</f:root>
Added: branches/3.0.2/sandbox-samples/calendar-sample/src/main/webapp/pages/Calendar.jsp
===================================================================
--- branches/3.0.2/sandbox-samples/calendar-sample/src/main/webapp/pages/Calendar.jsp (rev 0)
+++ branches/3.0.2/sandbox-samples/calendar-sample/src/main/webapp/pages/Calendar.jsp 2007-07-19 16:04:56 UTC (rev 1701)
@@ -0,0 +1,17 @@
+<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %>
+<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
+<%@ taglib uri="http://richfaces.ajax4jsf.org/calendar" prefix="calendar" %>
+<html>
+ <head>
+ <title></title>
+ </head>
+ <body>
+ <f:view>
+ <h:form>
+ <calendar:calendar id="calendar" >
+ </calendar:calendar>
+
+ </h:form>
+ </f:view>
+ </body>
+</html>
Property changes on: branches/3.0.2/sandbox-samples/calendar-sample/src/main/webapp/pages/Calendar.jsp
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:eol-style
+ native
17 years, 5 months
JBoss Rich Faces SVN: r1700 - trunk/docs/userguide/en/src/main/docbook/included.
by richfaces-svn-commits@lists.jboss.org
Author: vkorluzhenko
Date: 2007-07-19 11:43:57 -0400 (Thu, 19 Jul 2007)
New Revision: 1700
Modified:
trunk/docs/userguide/en/src/main/docbook/included/dragIndicator.xml
Log:
http://jira.jboss.com/jira/browse/RF-394
Modified: trunk/docs/userguide/en/src/main/docbook/included/dragIndicator.xml
===================================================================
--- trunk/docs/userguide/en/src/main/docbook/included/dragIndicator.xml 2007-07-19 14:04:08 UTC (rev 1699)
+++ trunk/docs/userguide/en/src/main/docbook/included/dragIndicator.xml 2007-07-19 15:43:57 UTC (rev 1700)
@@ -75,6 +75,99 @@
...
]]></programlisting>
</section>
+
+ <section>
+ <title>Details of Usage</title>
+ <para> In the simplest way the component could be defined empty - in that case a default
+ indicator will be shown like this: </para>
+ <figure>
+ <title>Simplest dragIndicator </title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/dragIndicator3.gif"/>
+ </imageobject>
+ </mediaobject>
+ </figure>
+ <para>For indicator customization you need to define one of the following facets:</para>
+ <itemizedlist>
+ <listitem>single</listitem>
+ </itemizedlist>
+ <para>Indicator shown when dragging a single element.</para>
+ <itemizedlist>
+ <listitem>multy</listitem>
+ </itemizedlist>
+ <para>Indicator shown when dragging several components (for future components that will support
+ multiple selection).</para>
+ <para>Thus for specify a look-and-feel you have to define one of these facets and include into
+ it a content that should be shown in indicator.</para>
+ <section>
+ <title>Macro generations</title>
+ <para>To place some data from drag or drop zones into component you can use macro generations.
+ They are being defining in the following way:</para>
+ <itemizedlist>
+ <listitem>
+ <emphasis role="bold">
+ <property><rich:dndParam></property>
+ </emphasis> component with a specific name and value is being included into a drag/drop
+ support component (an image can be defined as placed inside <emphasis role="bold">
+ <property><rich:dndParam></property>
+ </emphasis> without defining a value). </listitem>
+ <listitem> in needed place a parameter value is included into the marking of indicator using
+ syntax (name of parameter)</listitem>
+ </itemizedlist>
+ <para> For instance, this:</para>
+ <programlisting role="XML"><![CDATA[...
+ <dnd:dropSupport…>
+ <dnd:dndParam name="testDrop">
+ <h:graphicImage value="/images/file-manager.png" />
+ </dnd:dndParam>
+ </dnd:dropSupport>
+...
+]]></programlisting>
+ <para>..Is placed into indicator as follows:</para>
+ <programlisting role="XML"><![CDATA[...
+ <f:facet name="single">
+ {testDrop}
+ </f:facet>
+...
+]]></programlisting>
+ </section>
+ <section>
+ <title>Predefined macro generations</title>
+ <para> Indicator can accept two default macro generations:</para>
+ <itemizedlist>
+ <listitem>marker</listitem>
+ <listitem>label</listitem>
+ </itemizedlist>
+ <para>Thus including one of these elements in the marking of indicator, in other words after
+ setting up appropriate parameters in DnD components and defining only default indicator -
+ without specifying facets - a developer gets these parameters values displayed in indicator
+ in the order "marker - label".</para>
+ </section>
+
+ <section>
+ <title>Marker customization</title>
+ <para>The macro generation "marker" can be customized depending on what a
+ draggable element is located over. For that you should define one of these three parameters
+ (specify a parameter with one of three names):</para>
+ <itemizedlist>
+ <listitem>accept </listitem>
+ </itemizedlist>
+ <para>Parameter will be set instead of {marker} into indicator when a draggable element is positioned over drop zone that accept this type of elements</para>
+
+ <itemizedlist>
+ <listitem>reject</listitem>
+ </itemizedlist>
+ <para>Parameter will be set instead of {marker} into indicator when a draggable element is positioned over drop zone that doesn't accept this type of elements </para>
+
+ <itemizedlist>
+ <listitem>default</listitem>
+ </itemizedlist>
+ <para>Parameter will be set instead of {marker} into indicator when a draggable element is positioned over all the rest of page elements</para>
+ </section>
+
+ </section>
+
<!--section>
<title>Details of Usage</title>
<para>The component seems to be combined of two elements: an icon on the left and informational
@@ -152,7 +245,9 @@
</section>
</section-->
- <section>
+
+
+ <section>
<title>Relevant resources links</title>
<para>
<ulink
17 years, 5 months
JBoss Rich Faces SVN: r1699 - trunk/docs/userguide/en/src/main/docbook/included.
by richfaces-svn-commits@lists.jboss.org
Author: vkorluzhenko
Date: 2007-07-19 10:04:08 -0400 (Thu, 19 Jul 2007)
New Revision: 1699
Modified:
trunk/docs/userguide/en/src/main/docbook/included/tab.xml
Log:
fixed error with using ""
Modified: trunk/docs/userguide/en/src/main/docbook/included/tab.xml
===================================================================
--- trunk/docs/userguide/en/src/main/docbook/included/tab.xml 2007-07-19 13:50:59 UTC (rev 1698)
+++ trunk/docs/userguide/en/src/main/docbook/included/tab.xml 2007-07-19 14:04:08 UTC (rev 1699)
@@ -135,7 +135,7 @@
</listitem>
</itemizedlist>
<para>
- Some event could be performed on the tab which has been entered/left using "ontabenter"/"ontableave" attributes. See the example below.</para>
+ Some event could be performed on the tab which has been entered/left using "ontabenter"/"ontableave" attributes. See the example below.</para>
<para>
<emphasis role="bold">Example:</emphasis>
17 years, 5 months
JBoss Rich Faces SVN: r1698 - trunk/docs/userguide/en/src/main/docbook/included.
by richfaces-svn-commits@lists.jboss.org
Author: vkorluzhenko
Date: 2007-07-19 09:50:59 -0400 (Thu, 19 Jul 2007)
New Revision: 1698
Modified:
trunk/docs/userguide/en/src/main/docbook/included/panel.xml
trunk/docs/userguide/en/src/main/docbook/included/panelBarItem.xml
trunk/docs/userguide/en/src/main/docbook/included/tab.xml
Log:
http://jira.jboss.com/jira/browse/RF-335 - added info about facets
Modified: trunk/docs/userguide/en/src/main/docbook/included/panel.xml
===================================================================
--- trunk/docs/userguide/en/src/main/docbook/included/panel.xml 2007-07-19 12:39:46 UTC (rev 1697)
+++ trunk/docs/userguide/en/src/main/docbook/included/panel.xml 2007-07-19 13:50:59 UTC (rev 1698)
@@ -50,10 +50,7 @@
<emphasis role="bold">Example:</emphasis>
</para>
<programlisting role="XML"><![CDATA[...
- <rich:panel>
- <f:facet name="header">
- <h:outputText value="Panel Header"/>
- </f:facet>
+ <rich:panel header="Panel Header">
...
<!--Any Content inside-->
...
@@ -75,6 +72,21 @@
</section>
<section>
<title>Details of Usage</title>
+ <para>The <emphasis ><property>"header"</property></emphasis > attribute defines text to be represented. If you can use the
+ <emphasis ><property>"header"</property></emphasis > facet, you can even not use the <emphasis ><property>"header"</property></emphasis > attribute.</para>
+ <emphasis role="bold">Example:</emphasis>
+ <programlisting role="XML"><![CDATA[...
+ <rich:panel>
+ <f:facet name="header">
+ <h:graphicImage value="/images/img1.gif"/>
+ </f:facet>
+ ...
+ <!--Any Content inside-->
+ ...
+ </rich:panel>
+...
+]]></programlisting>
+
<para><emphasis role="bold">
<property><rich:panel></property>
</emphasis> components are used to group page content pieces on similarly formatted
@@ -142,21 +154,6 @@
<listitem> etc. </listitem>
</itemizedlist>
- <!--<para>The "header" attribute defines text to be represented. If you can use the
- "header" facet, you can even not use the "header" attribute.</para>
- <emphasis role="bold">Example:</emphasis>
- <programlisting role="XML"><![CDATA[...
- <rich:panel>
- <f:facet name="header">
- <h:graphicImage value="/images/img1.gif"/>
- </f:facet>
- ...
- <Any Content inside>
- ...
- </rich:panel>
-...
-]]></programlisting>-->
-
</section>
<section>
<title>Look-and-Feel Customization</title>
Modified: trunk/docs/userguide/en/src/main/docbook/included/panelBarItem.xml
===================================================================
--- trunk/docs/userguide/en/src/main/docbook/included/panelBarItem.xml 2007-07-19 12:39:46 UTC (rev 1697)
+++ trunk/docs/userguide/en/src/main/docbook/included/panelBarItem.xml 2007-07-19 13:50:59 UTC (rev 1698)
@@ -75,11 +75,8 @@
</section>
<section>
<title>Details of Usage</title>
- <para>As it was mentioned above, <property>panelBarItem</property> is used for grouping any
- content inside within one <property>panelBar</property>, thus its customization deals only
- with specification of sizes and styles for rendering.</para>
- <para>The "label" attribute defines text to be represented. If you can use the
- "label" facet, you can even not use the "label" attribute.</para>
+ <para>The <emphasis ><property> "label"</property></emphasis > attribute defines text to be represented. If you can use the
+ <emphasis ><property>"label"</property></emphasis > facet, you can even not use the <emphasis ><property>"label"</property></emphasis > attribute.</para>
<emphasis role="bold">Example:</emphasis>
<programlisting role="XML"><![CDATA[...
<rich:panelBarItem...>
@@ -92,7 +89,10 @@
</rich:panelBarItem>
...
]]></programlisting>
- <para><property>panelBar</property> could contain any number of child
+ <para>As it was mentioned above, <property>panelBarItem</property> is used for grouping any
+ content inside within one <property>panelBar</property>, thus its customization deals only
+ with specification of sizes and styles for rendering.</para>
+ <para><property>panelBar</property> could contain any number of child
<property>panelBarItem</property> components inside, which content is uploaded onto the client
and headers are controls to open the corresponding child element.</para>
</section>
Modified: trunk/docs/userguide/en/src/main/docbook/included/tab.xml
===================================================================
--- trunk/docs/userguide/en/src/main/docbook/included/tab.xml 2007-07-19 12:39:46 UTC (rev 1697)
+++ trunk/docs/userguide/en/src/main/docbook/included/tab.xml 2007-07-19 13:50:59 UTC (rev 1698)
@@ -73,9 +73,8 @@
<section>
<title>Details of Usage</title>
<para>The main component function is to define a content group that is rendered and processed when the <property>tab</property> is active, i.e. click on a <property>tab</property> causes switching onto a <property>tab</property> containing content corresponded to this <property>tab</property>.</para>
-
- <para>The "label" attribute defines text to be represented. If you can use the
- "label" facet, you can even not use the "label" attribute.</para>
+ <para>The <emphasis ><property>"label"</property></emphasis > attribute defines text to be represented. If you can use the
+ <emphasis ><property>"label"</property></emphasis > facet, you can even not use the <emphasis ><property>"label"</property></emphasis > attribute.</para>
<emphasis role="bold">Example:</emphasis>
<programlisting role="XML"><![CDATA[...
<rich:tab>
@@ -88,7 +87,7 @@
</rich:tab>
...
]]></programlisting>
-
+
<para>A marker on a <property>tab</property> header defined with the <emphasis ><property>"label"</property></emphasis> attribute. Moreover, each <property>tab</property> could be disabled (switching on this <property>tab</property> is impossible) with the <emphasis ><property>"disable"</property></emphasis> attribute.</para>
<para>
@@ -143,7 +142,7 @@
</para>
<programlisting role="XML"><![CDATA[...
<rich:tabPanel>
- <rich:tab label="Tab1" ontabenter=”alert()”>
+ <rich:tab label="Tab1" ontabenter="alert()">
…
</rich:tab>
…
17 years, 5 months
JBoss Rich Faces SVN: r1697 - branches/3.0.2/richfaces/tree/src/main/templates.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2007-07-19 08:39:46 -0400 (Thu, 19 Jul 2007)
New Revision: 1697
Modified:
branches/3.0.2/richfaces/tree/src/main/templates/htmlTree.jspx
Log:
http://jira.jboss.com/jira/browse/RF-475 fixed
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-19 12:04:54 UTC (rev 1696)
+++ branches/3.0.2/richfaces/tree/src/main/templates/htmlTree.jspx 2007-07-19 12:39:46 UTC (rev 1697)
@@ -44,7 +44,11 @@
<f:parameter value="id,style,class"/>
</f:call>
- <vcp:body />
+ <table width="100%" cellpadding="0">
+ <tbody>
+ <vcp:body />
+ </tbody>
+ </table>
<f:call name="encodeSelectionStateInput" />
<f:clientId var="clientId" />
17 years, 5 months
JBoss Rich Faces SVN: r1696 - branches/3.0.2/sandbox/calendar/src/main/java/org/richfaces/component.
by richfaces-svn-commits@lists.jboss.org
Author: akushunin
Date: 2007-07-19 08:04:54 -0400 (Thu, 19 Jul 2007)
New Revision: 1696
Modified:
branches/3.0.2/sandbox/calendar/src/main/java/org/richfaces/component/UICalendar.java
Log:
Added exceptions handling.
Added ValueChangeEvent to broadcast method.
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-19 11:39:50 UTC (rev 1695)
+++ branches/3.0.2/sandbox/calendar/src/main/java/org/richfaces/component/UICalendar.java 2007-07-19 12:04:54 UTC (rev 1696)
@@ -35,7 +35,6 @@
import java.util.TimeZone;
import javax.faces.application.FacesMessage;
-//import javax.faces.component.MessageFactory;
import javax.faces.component.UIComponent;
import javax.faces.component.UIInput;
import javax.faces.component.UIViewRoot;
@@ -47,11 +46,13 @@
import javax.faces.el.ValueBinding;
import javax.faces.event.AbortProcessingException;
import javax.faces.event.FacesEvent;
+import javax.faces.event.ValueChangeEvent;
import javax.faces.render.Renderer;
import org.ajax4jsf.framework.ajax.AjaxChildrenEncoder;
import org.ajax4jsf.framework.ajax.AjaxContext;
import org.ajax4jsf.framework.ajax.AjaxEvent;
+import org.ajax4jsf.framework.util.message.Messages;
import org.richfaces.renderkit.CalendarDataModelItemAdaptor;
import org.richfaces.renderkit.CalendarRendererBase;
import org.richfaces.renderkit.CurrentDateChangeEvent;
@@ -124,10 +125,11 @@
return;
}else{ setCurrentDate(currentDate);}
}catch (Exception e) {
-//TODO Add Exceptionhandling String messageStr = e.getMessage();
-// FacesMessage message = MessageFactory.getMessage(context, CONVERSION_MESSAGE_ID);
-// message.setSeverity(FacesMessage.SEVERITY_ERROR);
-// context.addMessage(getClientId(context), message);
+
+ String messageString = e.getMessage();
+ FacesMessage message = new FacesMessage(messageString);
+ message.setSeverity(FacesMessage.SEVERITY_ERROR);
+ context.addMessage(getClientId(context), message);
}
}
@@ -204,14 +206,20 @@
CurrentDateChangeEvent newDateChangeEvent = new CurrentDateChangeEvent(this, currentDate);
newDateChangeEvent.queue();
} catch (Exception e) {
- //TODO Add Exception Handling
+ String messageString = e.getMessage();
+ FacesMessage message = new FacesMessage(messageString);
+ message.setSeverity(FacesMessage.SEVERITY_ERROR);
+ facesContext.addMessage(getClientId(facesContext), message);
}
+
}
else{
Date currentDate1 = dateChangeEvent.getCurrentDate();
Date currentDate2 = getCurrentDate();
if(!currentDate1.equals(currentDate2)){
updateCurrentDate(facesContext, currentDate1);
+ ValueChangeEvent changeEvent = new ValueChangeEvent(this,currentDate2,currentDate1);
+ changeEvent.queue();
//TODO Add ValueChange Events for currentDate
}
17 years, 5 months