JBoss Rich Faces SVN: r3638 - in trunk/ui/calendar/src/main: templates/org/richfaces and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: akushunin
Date: 2007-10-31 11:07:41 -0400 (Wed, 31 Oct 2007)
New Revision: 3638
Modified:
trunk/ui/calendar/src/main/java/org/richfaces/renderkit/CalendarRendererBase.java
trunk/ui/calendar/src/main/templates/org/richfaces/htmlCalendar.jspx
Log:
Calendar refactoring
Modified: trunk/ui/calendar/src/main/java/org/richfaces/renderkit/CalendarRendererBase.java
===================================================================
--- trunk/ui/calendar/src/main/java/org/richfaces/renderkit/CalendarRendererBase.java 2007-10-31 14:42:30 UTC (rev 3637)
+++ trunk/ui/calendar/src/main/java/org/richfaces/renderkit/CalendarRendererBase.java 2007-10-31 15:07:41 UTC (rev 3638)
@@ -158,7 +158,7 @@
String styleClass = (String) calendar.getAttributes().get("styleClass");
if (styleClass != null && styleClass.length() != 0) {
ResponseWriter writer = context.getResponseWriter();
- writer.writeText("className: " + styleClass + ", ", null);
+ writer.writeText(",\n className: " + styleClass, null);
}
}
@@ -170,7 +170,7 @@
"dayStyleClass");
if (dayStyleClass != null && dayStyleClass.length() != 0) {
ResponseWriter writer = context.getResponseWriter();
- writer.writeText("dayStyleClass: " + dayStyleClass + ", ", null);
+ writer.writeText(",\n dayStyleClass: " + dayStyleClass, null);
}
}
@@ -182,7 +182,7 @@
"isDayEnabled");
if (isDayEnabled != null && isDayEnabled.length() != 0) {
ResponseWriter writer = context.getResponseWriter();
- writer.writeText("isDayEnabled: " + isDayEnabled + ", ", null);
+ writer.writeText(",\n isDayEnabled: " + isDayEnabled, null);
}
}
@@ -197,7 +197,7 @@
UIComponent facet = component.getFacet(facetName);
if (facet != null && facet.isRendered()) {
ResponseWriter writer = context.getResponseWriter();
- writer.writeText(", " + facetName + MARKUP_SUFFIX + ": "
+ writer.writeText(",\n " + facetName + MARKUP_SUFFIX + ": "
+ "[new E('b',{},", null);
writeMarkupScriptBody(context, facet, false);
writer.writeText(")]", null);
@@ -213,7 +213,7 @@
"cellHeight");
ResponseWriter writer = context.getResponseWriter();
String clientId = component.getClientId(context);
- String divStyle="." + clientId + "DayCell{";
+ String divStyle="";
if (cellwidth != null && cellwidth.intValue() > 0){
divStyle = divStyle + "width:"+ cellwidth.toString() + "px;";
}
@@ -222,9 +222,8 @@
divStyle = divStyle +"height:"+ cellheight.toString() + "px;";
}
- if (cellwidth != null && cellwidth.intValue() > 0 || cellheight != null
- && cellheight.intValue() > 0) {
- writer.writeText(divStyle+"}", null);
+ if(divStyle.length()!=0){
+ writer.writeText("." + clientId + "DayCell{"+divStyle+"}", null);
}
}
@@ -240,13 +239,8 @@
&& cellheight.intValue() > 0) {
String clientId = component.getClientId(context);
- writer.writeText("dayCellClass: '" + clientId + "DayCell',", null);
+ writer.writeText(",\n dayCellClass: '" + clientId + "DayCell'", null);
}
-
- if (component.getChildCount() != 0) {
- writer.writeText("dayListMarkup: ", null);
- writeMarkupScriptBody(context, component, true);
- }
}
public void writeFacetMarkupScriptBody(FacesContext context,
@@ -255,7 +249,7 @@
UIComponent facet = component.getFacet(facetName);
if (facet != null && facet.isRendered()) {
ResponseWriter writer = context.getResponseWriter();
- writer.writeText(", " + facetName + MARKUP_SUFFIX + ": ", null);
+ writer.writeText(",\n " + facetName + MARKUP_SUFFIX + ": ", null);
writeMarkupScriptBody(context, facet, false);
}
}
@@ -345,6 +339,7 @@
ResponseWriter writer = facesContext.getResponseWriter();
Map symbolsMap = getSymbolsMap(facesContext, calendar);
Iterator entryIterator = symbolsMap.entrySet().iterator();
+ writer.writeText(", \n", null);
while (entryIterator.hasNext()) {
Map.Entry entry = (Map.Entry) entryIterator.next();
@@ -353,7 +348,7 @@
writer.writeText(ScriptUtils.toScript(entry.getValue()), null);
if (entryIterator.hasNext()) {
- writer.writeText(", ", null);
+ writer.writeText(", \n", null);
}
}
}
Modified: trunk/ui/calendar/src/main/templates/org/richfaces/htmlCalendar.jspx
===================================================================
--- trunk/ui/calendar/src/main/templates/org/richfaces/htmlCalendar.jspx 2007-10-31 14:42:30 UTC (rev 3637)
+++ trunk/ui/calendar/src/main/templates/org/richfaces/htmlCalendar.jspx 2007-10-31 15:07:41 UTC (rev 3638)
@@ -150,15 +150,18 @@
verticalOffset:#{component.verticalOffset},
horizontalOffset: #{component.horizontalOffset},
style:'z-index: #{component.attributes["zindex"]}; #{component.attributes["style"]}',
+ firstWeekDay: #{this:getFirstWeekDay(context, component)},
+ minDaysInFirstWeek: #{this:getMinDaysInFirstWeek(context, component)}
+
+
<f:call name="writeClass"/>
<f:call name="writeDayCellClass"/>
<f:call name="writeDayStyleClass"/>
<f:call name="writeIsDayEnabled"/>
- <f:call name="writeSymbols" />,
- firstWeekDay: #{this:getFirstWeekDay(context, component)},
- minDaysInFirstWeek: #{this:getMinDaysInFirstWeek(context, component)}
+ <f:call name="writeSymbols" />
+
<f:call name="writeEventHandlerFunction"><f:parameter value="ondateselected" /></f:call>
<f:call name="writeEventHandlerFunction"><f:parameter value="ondateselect" /></f:call>
<f:call name="writeEventHandlerFunction"><f:parameter value="ondatemouseover" /></f:call>
@@ -167,6 +170,14 @@
<f:call name="writeEventHandlerFunction"><f:parameter value="oncollapse" /></f:call>
<f:call name="writeEventHandlerFunction"><f:parameter value="oncurrentdateselect" /></f:call>
+ <jsp:scriptlet>/*<![CDATA[*/
+ if (component.getChildCount() != 0) {
+ /*]]>*/</jsp:scriptlet>
+ ,\n dayListMarkup:
+ <jsp:scriptlet>/*<![CDATA[*/
+ writeMarkupScriptBody(context, component, true);
+ }
+ /*]]>*/</jsp:scriptlet>
<f:call name="writeOptionalFacetMarkupScriptBody"><f:parameter value="optionalHeader" /></f:call>
<f:call name="writeOptionalFacetMarkupScriptBody"><f:parameter value="optionalFooter" /></f:call>
17 years, 2 months
JBoss Rich Faces SVN: r3637 - management/design/columns.
by richfaces-svn-commits@lists.jboss.org
Author: ilya_shaikovsky
Date: 2007-10-31 10:42:30 -0400 (Wed, 31 Oct 2007)
New Revision: 3637
Modified:
management/design/columns/Func Spec Columns.doc
Log:
Modified: management/design/columns/Func Spec Columns.doc
===================================================================
(Binary files differ)
17 years, 2 months
JBoss Rich Faces SVN: r3636 - in management/design: columns and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: ilya_shaikovsky
Date: 2007-10-31 10:29:12 -0400 (Wed, 31 Oct 2007)
New Revision: 3636
Added:
management/design/columns/
management/design/columns/Func Spec Columns.doc
management/design/columns/columns Vision.doc
Log:
columns component design documents
Added: management/design/columns/Func Spec Columns.doc
===================================================================
(Binary files differ)
Property changes on: management/design/columns/Func Spec Columns.doc
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: management/design/columns/columns Vision.doc
===================================================================
(Binary files differ)
Property changes on: management/design/columns/columns Vision.doc
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
17 years, 2 months
JBoss Rich Faces SVN: r3635 - trunk/ui/calendar/src/main/resources/org/richfaces/renderkit/html/scripts.
by richfaces-svn-commits@lists.jboss.org
Author: pyaschenko
Date: 2007-10-31 10:16:27 -0400 (Wed, 31 Oct 2007)
New Revision: 3635
Modified:
trunk/ui/calendar/src/main/resources/org/richfaces/renderkit/html/scripts/calendar.js
Log:
markup refactoring in progress
Modified: trunk/ui/calendar/src/main/resources/org/richfaces/renderkit/html/scripts/calendar.js
===================================================================
--- trunk/ui/calendar/src/main/resources/org/richfaces/renderkit/html/scripts/calendar.js 2007-10-31 14:08:03 UTC (rev 3634)
+++ trunk/ui/calendar/src/main/resources/org/richfaces/renderkit/html/scripts/calendar.js 2007-10-31 14:16:27 UTC (rev 3635)
@@ -424,7 +424,12 @@
// isDayEnabled - end-developer JS function
// dayStyleClass - end-developer JS function that provide style class for day's cells.
+ // dayCellClass - add div to day cell with class 'rich-calendar-cell-div' and add this class to TD if defined
+ // style - table style
+ // className - table class
+
+
this.id = id;
this.params = parameters;
if (!this.params.showWeekDaysBar) this.params.showWeekDaysBar = true;
@@ -479,10 +484,21 @@
this.selectedDateCellColor = "";
var obj=$(id);
+ var span=$(this.POPUP_ID);
+ var popupStyles = "";
+ this.isVisible = true;
+ if (this.params.popup==true)
+ {
+ // popup mode initialisation
+ popupStyles = "display:none; position:absolute;"
+ this.isVisible = false;
+ }
+
var htmlTextHeader = (!this.params.popup ? '<input id="'+this.INPUT_DATE_ID+'" name="'+this.INPUT_DATE_ID+'" type="hidden" style="display:none" value="'+this.getSelectedDateString(this.params.datePattern)+'"/>\n' : '') +
'<input id="'+this.id+'InputCurrentDate" name="'+this.id+'InputCurrentDate" type="hidden" style="display:none" value="'+this.getCurrentDate().format("MM/yyyy")+'"/>\n' +
- '<table border="0" cellpadding="0" cellspacing="0" class="rich-calendar-exterior"><tbody>\n';
+ (this.params.popup && Richfaces.browser.isIE6 ? '<iframe src="javascript:\'\'" frameborder="0" scrolling="no" id="' + this.IFRAME_ID + '" style="display:none; position: absolute; width: 1px; height: 1px; background-color:white;">'+'</iframe>\n' : '' )+
+ '<table id="'+this.id+'" border="0" cellpadding="0" cellspacing="0" class="rich-calendar-exterior rich-calendar-popup'+(this.params.className ? ' '+this.params.className : '')+'" style="'+popupStyles+this.params.style+'"><tbody>\n';
var colspan = (this.params.showWeeksBar ? "8" : "7");
var htmlHeaderOptional = (this.params.optionalHeaderMarkup) ? '<tr><td class="rich-calendar-header-optional" colspan="'+colspan+'" id="'+this.id+'HeaderOptional"></td></tr>' : '';
var htmlFooterOptional = (this.params.optionalFooterMarkup) ? '<tr><td class="rich-calendar-footer-optional" colspan="'+colspan+'" id="'+this.id+'FooterOptional"></td></tr>' : '';
@@ -491,24 +507,6 @@
var htmlTextFooter = '</tbody></table>\n'
var htmlTextIFrame = '';
- this.isVisible = true;
- if (this.params.popup==true)
- {
- // popup mode initialisation
- var e = $(this.id);
- if (e)
- {
- e.style.display='none';
- e.style.position = 'absolute';
- this.isVisible = false;
- if (Richfaces.browser.isIE6)
- {
- new Insertion.Before(obj,'<iframe src="javascript:\'\'" frameborder="0" scrolling="no" id="' + this.IFRAME_ID + '"' +
- 'style="display:none; position: absolute; width: 1px; height: 1px; background-color:white;">'+'</iframe>');
- }
- }
- }
-
// days bar creation
var styleClass;
var bottomStyleClass;
@@ -564,10 +562,11 @@
htmlTextWeek+='</tr>';
}
+ //obj.innerHTML = htmlTextIFrame+htmlTextHeader+htmlHeaderOptional+htmlControlsHeader+htmlTextWeekDayBar+htmlTextWeek+htmlControlsFooter+htmlFooterOptional+htmlTextFooter;
+ new Insertion.After(span,htmlTextIFrame+htmlTextHeader+htmlHeaderOptional+htmlControlsHeader+htmlTextWeekDayBar+htmlTextWeek+htmlControlsFooter+htmlFooterOptional+htmlTextFooter);
// set content
obj.component = this;
obj.richfacesComponent="richfaces:calendar";
- obj.innerHTML = htmlTextIFrame+htmlTextHeader+htmlHeaderOptional+htmlControlsHeader+htmlTextWeekDayBar+htmlTextWeek+htmlControlsFooter+htmlFooterOptional+htmlTextFooter;
if(this.params.submitFunction) this.submitFunction = this.params.submitFunction.bind(this);
this.prepareEvents();
@@ -603,9 +602,26 @@
this.eventOnCollapseFlag = false;
}
- if (Richfaces.browser.isIE6) Element.hide(this.IFRAME_ID);
+ var iframe=null;
+ if (Richfaces.browser.isIE6) iframe = $(this.IFRAME_ID);
+ if (iframe) Element.hide(iframe);
+
Element.hide(element);
this.isVisible = false;
+
+ /*if (this.floatedToBody && this.parent)
+ {
+ if (iframe)
+ {
+ document.body.removeChild(iframe);
+ this.parent.appendChild(iframe);
+ }
+ document.body.removeChild(element);
+ this.parent.appendChild(element);
+ this.floatedToBody = false;
+ this.parent = null;
+ }*/
+
}
},
@@ -616,6 +632,17 @@
if (this.invokeEvent("expand", element))
{
+
+ var iframe=null;
+ if (Richfaces.browser.isIE6) iframe = $(this.IFRAME_ID);
+
+ /*if (!this.floatedToBody) {
+ this.parent = element.parentNode;
+ if (iframe) document.body.insertBefore(this.parent.removeChild(iframe), null);
+ document.body.insertBefore(this.parent.removeChild(element), null);
+ this.floatedToBody = true;
+ }*/
+
var base = $(this.POPUP_ID)
var baseInput = base.firstChild;
var baseButton = baseInput.nextSibling;
@@ -625,8 +652,6 @@
this.selectDate(baseInput.value);
}
- var iframe = $(this.IFRAME_ID);
-
/*this.setPopupEvents(e);
this.setPopupEvents(base);*/
@@ -652,7 +677,7 @@
Richfaces.Calendar.setElementPosition(element, o, this.params.jointPoint, this.params.direction, this.popupOffset);
- if (Richfaces.browser.isIE6)
+ if (iframe)
{
iframe.style.left = element.style.left;
iframe.style.top = element.style.top;
@@ -1513,7 +1538,7 @@
]
)];
-CalendarView.dayList = [new ET(function (context) { return context.day})];
+CalendarView.dayList = [new E('div',{'style':'overflow:hidden;width:100%;height:100%;'},[new ET(function (context) { return context.day})])];
CalendarView.weekNumber = [new ET(function (context) { return context.weekNumber})];
CalendarView.weekDay = [new ET(function (context) { return context.weekDayLabelShort})];
17 years, 2 months
JBoss Rich Faces SVN: r3634 - in trunk/ui/calendar/src/main: templates/org/richfaces and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: akushunin
Date: 2007-10-31 10:08:03 -0400 (Wed, 31 Oct 2007)
New Revision: 3634
Modified:
trunk/ui/calendar/src/main/java/org/richfaces/renderkit/CalendarRendererBase.java
trunk/ui/calendar/src/main/templates/org/richfaces/htmlCalendar.jspx
Log:
Calendar refactoring
Modified: trunk/ui/calendar/src/main/java/org/richfaces/renderkit/CalendarRendererBase.java
===================================================================
--- trunk/ui/calendar/src/main/java/org/richfaces/renderkit/CalendarRendererBase.java 2007-10-31 13:29:40 UTC (rev 3633)
+++ trunk/ui/calendar/src/main/java/org/richfaces/renderkit/CalendarRendererBase.java 2007-10-31 14:08:03 UTC (rev 3634)
@@ -204,7 +204,7 @@
}
}
- public void writeDayCellClass(FacesContext context, UIComponent component)
+ public void dayCellClass(FacesContext context, UIComponent component)
throws IOException {
// if cellWidth/Height is set send dayCellClass to script
Integer cellwidth = (Integer) component.getAttributes()
@@ -212,19 +212,23 @@
Integer cellheight = (Integer) component.getAttributes().get(
"cellHeight");
ResponseWriter writer = context.getResponseWriter();
+ String clientId = component.getClientId(context);
+ String divStyle="." + clientId + "DayCell{";
+ if (cellwidth != null && cellwidth.intValue() > 0){
+ divStyle = divStyle + "width:"+ cellwidth.toString() + "px;";
+ }
+ if(cellheight != null
+ && cellheight.intValue() > 0){
+ divStyle = divStyle +"height:"+ cellheight.toString() + "px;";
+ }
+
if (cellwidth != null && cellwidth.intValue() > 0 || cellheight != null
&& cellheight.intValue() > 0) {
-
- String clientId = component.getClientId(context);
-
- String divStyle = "." + clientId + "DayCell{width: "
- + cellwidth.toString() + "px; height:"
- + cellheight.toString() + "px; }<style/>";
- writer.writeText(divStyle, null);
+ writer.writeText(divStyle+"}", null);
}
}
- public void dayCellClass(FacesContext context, UIComponent component)
+ public void writeDayCellClass(FacesContext context, UIComponent component)
throws IOException {
Integer cellwidth = (Integer) component.getAttributes()
@@ -236,7 +240,7 @@
&& cellheight.intValue() > 0) {
String clientId = component.getClientId(context);
- writer.writeText("dayCellClass: " + clientId + "DayCell,", null);
+ writer.writeText("dayCellClass: '" + clientId + "DayCell',", null);
}
if (component.getChildCount() != 0) {
Modified: trunk/ui/calendar/src/main/templates/org/richfaces/htmlCalendar.jspx
===================================================================
--- trunk/ui/calendar/src/main/templates/org/richfaces/htmlCalendar.jspx 2007-10-31 13:29:40 UTC (rev 3633)
+++ trunk/ui/calendar/src/main/templates/org/richfaces/htmlCalendar.jspx 2007-10-31 14:08:03 UTC (rev 3634)
@@ -116,7 +116,7 @@
]]>
</jsp:scriptlet> </span>
<style type="text/css">
- <f:call name="writeDayCellClass" />
+ <f:call name="dayCellClass" />
</style>
<script type="text/javascript">
new Calendar('#{clientId}', {
@@ -147,12 +147,13 @@
showInput: #{component.attributes['showInput']},
disabled: #{component.disabled},
ajaxSingle: #{component.attributes['ajaxSingle']},
- verticalOffset:'#{component.verticalOffset}',
- horizontalOffset: '#{component.horizontalOffset}',
+ verticalOffset:#{component.verticalOffset},
+ horizontalOffset: #{component.horizontalOffset},
style:'z-index: #{component.attributes["zindex"]}; #{component.attributes["style"]}',
<f:call name="writeClass"/>
- <f:call name="dayCellClass"/>
+ <f:call name="writeDayCellClass"/>
+ <f:call name="writeDayStyleClass"/>
<f:call name="writeIsDayEnabled"/>
<f:call name="writeSymbols" />,
firstWeekDay: #{this:getFirstWeekDay(context, component)},
17 years, 2 months
JBoss Rich Faces SVN: r3633 - in trunk/ui/calendar/src/main: templates/org/richfaces and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: akushunin
Date: 2007-10-31 09:29:40 -0400 (Wed, 31 Oct 2007)
New Revision: 3633
Modified:
trunk/ui/calendar/src/main/java/org/richfaces/renderkit/CalendarRendererBase.java
trunk/ui/calendar/src/main/templates/org/richfaces/htmlCalendar.jspx
Log:
Calendar refactoring
Modified: trunk/ui/calendar/src/main/java/org/richfaces/renderkit/CalendarRendererBase.java
===================================================================
--- trunk/ui/calendar/src/main/java/org/richfaces/renderkit/CalendarRendererBase.java 2007-10-31 12:30:12 UTC (rev 3632)
+++ trunk/ui/calendar/src/main/java/org/richfaces/renderkit/CalendarRendererBase.java 2007-10-31 13:29:40 UTC (rev 3633)
@@ -151,7 +151,7 @@
}
- public void writeStyles(FacesContext context, UIComponent component)
+ public void writeClass(FacesContext context, UIComponent component)
throws IOException {
UICalendar calendar = (UICalendar) component;
@@ -171,8 +171,6 @@
if (dayStyleClass != null && dayStyleClass.length() != 0) {
ResponseWriter writer = context.getResponseWriter();
writer.writeText("dayStyleClass: " + dayStyleClass + ", ", null);
- // getUtils().writeAttribute(writer,
- // "dayStyleClass",dayStyleClass+',');
}
}
@@ -206,7 +204,7 @@
}
}
- public void writeDivBody(FacesContext context, UIComponent component)
+ public void writeDayCellClass(FacesContext context, UIComponent component)
throws IOException {
// if cellWidth/Height is set send dayCellClass to script
Integer cellwidth = (Integer) component.getAttributes()
@@ -214,21 +212,37 @@
Integer cellheight = (Integer) component.getAttributes().get(
"cellHeight");
ResponseWriter writer = context.getResponseWriter();
- if (cellwidth != null && cellwidth > 0 || cellheight != null
- && cellheight > 0) {
+ if (cellwidth != null && cellwidth.intValue() > 0 || cellheight != null
+ && cellheight.intValue() > 0) {
String clientId = component.getClientId(context);
- String divStyle = "<style> ." + clientId + "DayCell{width: "
- + cellwidth + "px; height:" + cellheight + "px; }<style/>";
- writer.writeText(", dayCellClass: " + divStyle, null);
+
+ String divStyle = "." + clientId + "DayCell{width: "
+ + cellwidth.toString() + "px; height:"
+ + cellheight.toString() + "px; }<style/>";
+ writer.writeText(divStyle, null);
}
+ }
- if (component.getChildCount() != 0) {
+ public void dayCellClass(FacesContext context, UIComponent component)
+ throws IOException {
- writer.writeText(",dayListMarkup: ", null);
- writeMarkupScriptBody(context, component, true);
+ Integer cellwidth = (Integer) component.getAttributes()
+ .get("cellWidth");
+ Integer cellheight = (Integer) component.getAttributes().get(
+ "cellHeight");
+ ResponseWriter writer = context.getResponseWriter();
+ if (cellwidth != null && cellwidth.intValue() > 0 || cellheight != null
+ && cellheight.intValue() > 0) {
+ String clientId = component.getClientId(context);
+ writer.writeText("dayCellClass: " + clientId + "DayCell,", null);
}
+
+ if (component.getChildCount() != 0) {
+ writer.writeText("dayListMarkup: ", null);
+ writeMarkupScriptBody(context, component, true);
+ }
}
public void writeFacetMarkupScriptBody(FacesContext context,
Modified: trunk/ui/calendar/src/main/templates/org/richfaces/htmlCalendar.jspx
===================================================================
--- trunk/ui/calendar/src/main/templates/org/richfaces/htmlCalendar.jspx 2007-10-31 12:30:12 UTC (rev 3632)
+++ trunk/ui/calendar/src/main/templates/org/richfaces/htmlCalendar.jspx 2007-10-31 13:29:40 UTC (rev 3633)
@@ -114,7 +114,10 @@
<![CDATA[
}
]]>
- </jsp:scriptlet> </span>
+ </jsp:scriptlet> </span>
+ <style type="text/css">
+ <f:call name="writeDayCellClass" />
+ </style>
<script type="text/javascript">
new Calendar('#{clientId}', {
@@ -146,10 +149,10 @@
ajaxSingle: #{component.attributes['ajaxSingle']},
verticalOffset:'#{component.verticalOffset}',
horizontalOffset: '#{component.horizontalOffset}',
- style:'z-index: #{component.attributes['zindex']}; #{component.attributes['style']}'
+ style:'z-index: #{component.attributes["zindex"]}; #{component.attributes["style"]}',
- <f:call name="writeStyles"/>
- <f:call name="writeDayStyleClass"/>
+ <f:call name="writeClass"/>
+ <f:call name="dayCellClass"/>
<f:call name="writeIsDayEnabled"/>
<f:call name="writeSymbols" />,
firstWeekDay: #{this:getFirstWeekDay(context, component)},
@@ -163,7 +166,6 @@
<f:call name="writeEventHandlerFunction"><f:parameter value="oncollapse" /></f:call>
<f:call name="writeEventHandlerFunction"><f:parameter value="oncurrentdateselect" /></f:call>
- <f:call name="writeDivBody"></f:call>
<f:call name="writeOptionalFacetMarkupScriptBody"><f:parameter value="optionalHeader" /></f:call>
<f:call name="writeOptionalFacetMarkupScriptBody"><f:parameter value="optionalFooter" /></f:call>
17 years, 2 months
JBoss Rich Faces SVN: r3632 - in trunk/ui/calendar/src/main: resources/org/richfaces/renderkit/html/css and 1 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: akushunin
Date: 2007-10-31 08:30:12 -0400 (Wed, 31 Oct 2007)
New Revision: 3632
Modified:
trunk/ui/calendar/src/main/java/org/richfaces/renderkit/CalendarRendererBase.java
trunk/ui/calendar/src/main/resources/org/richfaces/renderkit/html/css/calendar.xcss
trunk/ui/calendar/src/main/templates/org/richfaces/htmlCalendar.jspx
Log:
Calendar refactoring
Modified: trunk/ui/calendar/src/main/java/org/richfaces/renderkit/CalendarRendererBase.java
===================================================================
--- trunk/ui/calendar/src/main/java/org/richfaces/renderkit/CalendarRendererBase.java 2007-10-31 09:38:30 UTC (rev 3631)
+++ trunk/ui/calendar/src/main/java/org/richfaces/renderkit/CalendarRendererBase.java 2007-10-31 12:30:12 UTC (rev 3632)
@@ -99,11 +99,12 @@
}
UICalendar calendar = (UICalendar) component;
if (calendar.getConverter() != null) {
-
- return calendar.getConverter().getAsObject(context, component, (String)submittedValue);
-
+
+ return calendar.getConverter().getAsObject(context, component,
+ (String) submittedValue);
+
} else {
- DateTimeConverter converter = new DateTimeConverter();
+ DateTimeConverter converter = new DateTimeConverter();
converter.setPattern(calendar.getDatePattern());
converter.setLocale(calendar.getLocale());
converter.setTimeZone(calendar.getTimeZone());
@@ -149,44 +150,87 @@
throws IOException {
}
-
- public void writeDayStyleClass(FacesContext context, UIComponent component) throws IOException{
-
+
+ public void writeStyles(FacesContext context, UIComponent component)
+ throws IOException {
+
UICalendar calendar = (UICalendar) component;
- String dayStyleClass = (String) calendar.getAttributes().get("dayStyleClass");
- if(dayStyleClass!=null && dayStyleClass.length()!=0){
+ String styleClass = (String) calendar.getAttributes().get("styleClass");
+ if (styleClass != null && styleClass.length() != 0) {
ResponseWriter writer = context.getResponseWriter();
- writer.writeText("dayStyleClass: "+dayStyleClass+", ", null);
- //getUtils().writeAttribute(writer, "dayStyleClass",dayStyleClass+',');
+ writer.writeText("className: " + styleClass + ", ", null);
}
-
+ }
+
+ public void writeDayStyleClass(FacesContext context, UIComponent component)
+ throws IOException {
+
+ UICalendar calendar = (UICalendar) component;
+ String dayStyleClass = (String) calendar.getAttributes().get(
+ "dayStyleClass");
+ if (dayStyleClass != null && dayStyleClass.length() != 0) {
+ ResponseWriter writer = context.getResponseWriter();
+ writer.writeText("dayStyleClass: " + dayStyleClass + ", ", null);
+ // getUtils().writeAttribute(writer,
+ // "dayStyleClass",dayStyleClass+',');
}
- public void writeIsDayEnabled(FacesContext context, UIComponent component)throws IOException{
+
+ }
+
+ public void writeIsDayEnabled(FacesContext context, UIComponent component)
+ throws IOException {
UICalendar calendar = (UICalendar) component;
- String isDayEnabled = (String) calendar.getAttributes().get("isDayEnabled");
- if(isDayEnabled!=null && isDayEnabled.length()!=0){
+ String isDayEnabled = (String) calendar.getAttributes().get(
+ "isDayEnabled");
+ if (isDayEnabled != null && isDayEnabled.length() != 0) {
ResponseWriter writer = context.getResponseWriter();
- writer.writeText("isDayEnabled: "+isDayEnabled+", ", null);
- }
+ writer.writeText("isDayEnabled: " + isDayEnabled + ", ", null);
+ }
}
-
+
public void writeMarkupScriptBody(FacesContext context,
UIComponent component, boolean children) throws IOException {
writeScriptBody(context, component, children);
}
-
+
public void writeOptionalFacetMarkupScriptBody(FacesContext context,
- UIComponent component, String facetName) throws IOException{
-
+ UIComponent component, String facetName) throws IOException {
+
UIComponent facet = component.getFacet(facetName);
if (facet != null && facet.isRendered()) {
ResponseWriter writer = context.getResponseWriter();
- writer.writeText(", " + facetName + MARKUP_SUFFIX + ": "+"[new E('b',{},", null);
+ writer.writeText(", " + facetName + MARKUP_SUFFIX + ": "
+ + "[new E('b',{},", null);
writeMarkupScriptBody(context, facet, false);
- writer.writeText(")]",null);
+ writer.writeText(")]", null);
}
}
-
+
+ public void writeDivBody(FacesContext context, UIComponent component)
+ throws IOException {
+ // if cellWidth/Height is set send dayCellClass to script
+ Integer cellwidth = (Integer) component.getAttributes()
+ .get("cellWidth");
+ Integer cellheight = (Integer) component.getAttributes().get(
+ "cellHeight");
+ ResponseWriter writer = context.getResponseWriter();
+ if (cellwidth != null && cellwidth > 0 || cellheight != null
+ && cellheight > 0) {
+
+ String clientId = component.getClientId(context);
+ String divStyle = "<style> ." + clientId + "DayCell{width: "
+ + cellwidth + "px; height:" + cellheight + "px; }<style/>";
+ writer.writeText(", dayCellClass: " + divStyle, null);
+ }
+
+ if (component.getChildCount() != 0) {
+
+ writer.writeText(",dayListMarkup: ", null);
+ writeMarkupScriptBody(context, component, true);
+
+ }
+ }
+
public void writeFacetMarkupScriptBody(FacesContext context,
UIComponent component, String facetName) throws IOException {
@@ -266,16 +310,15 @@
Date value = input.getAsDate(input.getSubmittedValue());
Date curVal = input.getAsDate(input.getValue());
-
- DateTimeConverter converter = new DateTimeConverter();
- converter.setPattern(input.getDatePattern());
- converter.setLocale(input.getLocale());
- converter.setTimeZone(input.getTimeZone());
- if (value == null) {
+ DateTimeConverter converter = new DateTimeConverter();
+ converter.setPattern(input.getDatePattern());
+ converter.setLocale(input.getLocale());
+ converter.setTimeZone(input.getTimeZone());
+ if (value == null) {
return converter.getAsString(context, input, curVal);
- }else{
- return converter.getAsString(context, input, value);
+ } else {
+ return converter.getAsString(context, input, value);
}
}
Modified: trunk/ui/calendar/src/main/resources/org/richfaces/renderkit/html/css/calendar.xcss
===================================================================
--- trunk/ui/calendar/src/main/resources/org/richfaces/renderkit/html/css/calendar.xcss 2007-10-31 09:38:30 UTC (rev 3631)
+++ trunk/ui/calendar/src/main/resources/org/richfaces/renderkit/html/css/calendar.xcss 2007-10-31 12:30:12 UTC (rev 3632)
@@ -20,11 +20,17 @@
border-bottom : 1px solid;
}
-.rich-cell-size{
+.rich-calendar-cell-size{
width : 25px;
height : 22px;
}
+.rich-calendar-cell-div{
+ width : 100%;
+ height : 100%;
+ overflow: hidden;
+}
+
.rich-calendar-cell{
border-bottom : 1px solid;
border-right : 1px solid;
Modified: trunk/ui/calendar/src/main/templates/org/richfaces/htmlCalendar.jspx
===================================================================
--- trunk/ui/calendar/src/main/templates/org/richfaces/htmlCalendar.jspx 2007-10-31 09:38:30 UTC (rev 3631)
+++ trunk/ui/calendar/src/main/templates/org/richfaces/htmlCalendar.jspx 2007-10-31 12:30:12 UTC (rev 3632)
@@ -14,8 +14,9 @@
<h:styles>/org/richfaces/renderkit/html/css/calendar.xcss</h:styles>
<f:call name="addPopupToAjaxRendered" />
-
- <span id="#{clientId}Popup"> <jsp:scriptlet>
+
+ <span id="#{clientId}Popup"
+ x:passThruWithExclusions="value,name,type,id,styleClass,class,style"> <jsp:scriptlet>
<![CDATA[
boolean popup = getUtils().isBooleanAttribute(component, "popup");
if (!popup) {
@@ -113,12 +114,7 @@
<![CDATA[
}
]]>
- </jsp:scriptlet> </span>
-
- <div id="#{clientId}"
- style="z-index: #{component.attributes['zindex']}; #{component.attributes['style']}"
- class="rich-calendar-popup #{component.attributes['styleClass']}"
- x:passThruWithExclusions="value,name,type,id,styleClass,class,style">
+ </jsp:scriptlet> </span>
<script type="text/javascript">
new Calendar('#{clientId}', {
@@ -150,8 +146,9 @@
ajaxSingle: #{component.attributes['ajaxSingle']},
verticalOffset:'#{component.verticalOffset}',
horizontalOffset: '#{component.horizontalOffset}',
- cellHeight:'#{component.cellHeight}',
- cellWidth:'#{component.cellWidth}',
+ style:'z-index: #{component.attributes['zindex']}; #{component.attributes['style']}'
+
+ <f:call name="writeStyles"/>
<f:call name="writeDayStyleClass"/>
<f:call name="writeIsDayEnabled"/>
<f:call name="writeSymbols" />,
@@ -165,18 +162,9 @@
<f:call name="writeEventHandlerFunction"><f:parameter value="onexpand" /></f:call>
<f:call name="writeEventHandlerFunction"><f:parameter value="oncollapse" /></f:call>
<f:call name="writeEventHandlerFunction"><f:parameter value="oncurrentdateselect" /></f:call>
-
+
+ <f:call name="writeDivBody"></f:call>
-
- <jsp:scriptlet>/*<![CDATA[*/
- if (component.getChildCount() != 0) {
- /*]]>*/</jsp:scriptlet>
- ,dayListMarkup:
- <jsp:scriptlet>/*<![CDATA[*/
- writeMarkupScriptBody(context, component, true);
- }
- /*]]>*/</jsp:scriptlet>
-
<f:call name="writeOptionalFacetMarkupScriptBody"><f:parameter value="optionalHeader" /></f:call>
<f:call name="writeOptionalFacetMarkupScriptBody"><f:parameter value="optionalFooter" /></f:call>
@@ -190,6 +178,5 @@
writePreloadBody(context, component);
/*]]>*/</jsp:scriptlet>
);
- </script></div>
-
+ </script>
</f:root>
17 years, 2 months
JBoss Rich Faces SVN: r3631 - trunk/docs/userguide/en/src/main/docbook/included.
by richfaces-svn-commits@lists.jboss.org
Author: vkorluzhenko
Date: 2007-10-31 05:38:30 -0400 (Wed, 31 Oct 2007)
New Revision: 3631
Modified:
trunk/docs/userguide/en/src/main/docbook/included/tree.xml
Log:
http://jira.jboss.com/jira/browse/RF-672 - colored meaningfull words
Modified: trunk/docs/userguide/en/src/main/docbook/included/tree.xml
===================================================================
--- trunk/docs/userguide/en/src/main/docbook/included/tree.xml 2007-10-31 02:15:39 UTC (rev 3630)
+++ trunk/docs/userguide/en/src/main/docbook/included/tree.xml 2007-10-31 09:38:30 UTC (rev 3631)
@@ -90,8 +90,9 @@
</section>
<section>
<title>Details of Usage</title>
- <para>As it has been mentioned <link linkend="tree">above</link> the tree component allows
- rendering any tree-like structure of data.</para>
+ <para>As it has been mentioned <link linkend="tree">above</link> the <emphasis role="bold">
+ <property><rich:tree></property>
+ </emphasis> component allows rendering any tree-like structure of data.</para>
<para>A bean property is passed into a tree <emphasis>
<property>"value"</property>
</emphasis> attribute. The property keeps a structure of
@@ -104,13 +105,14 @@
</emphasis> attribute of tree component. <ulink
url="http://labs.jboss.com/file-access/default/members/jbossrichfaces/freezone..."
>"XmlTreeDataBuilder" class</ulink> allows transforming XML into
- structures of objects containing "XmlNodeData" instances as data, which
- could be represented by the tree component. </para>
+ structures of objects containing <property>"XmlNodeData"</property>
+ instances as data, which could be represented by the tree component. </para>
<para>For particular visual representation of data <emphasis role="bold">
<property><rich:tree></property>
- </emphasis> selects one of the children treeNode components by type. The type is defined with
- the <emphasis>
+ </emphasis> selects one of the children <emphasis role="bold">
+ <property><rich:treeNode></property>
+ </emphasis> components by type. The type is defined with the <emphasis>
<property>"nodeFace"</property>
</emphasis> attribute that corresponds to a value of <emphasis>
<property>"type"</property>
@@ -173,16 +175,21 @@
<programlisting role="JAVA"><![CDATA[<h: outputText value="#{varAttributeName}">
]]></programlisting>
- <para> varAttributeName is a value for <emphasis>
+ <para>
+ <property>"varAttributeName"</property> is a value for <emphasis>
<property>"var"</property>
</emphasis> attribute. </para>
- <para> It's possible to define several treeNode components with the equal values of <emphasis>
+ <para> It's possible to define several <emphasis role="bold">
+ <property><rich:treeNode></property>
+ </emphasis> components with the equal values of <emphasis>
<property>"type"</property>
</emphasis> attribute and different values of <emphasis>
<property>"rendered"</property>
</emphasis> attribute. It provides the possibility to define different markup for the same
- treeNode components type. An example is placed below. </para>
+ <emphasis role="bold">
+ <property><rich:treeNode></property>
+ </emphasis> components type. An example is placed below. </para>
<para>
<emphasis role="bold">Example:</emphasis>
@@ -204,9 +211,11 @@
</h:form>
...]]></programlisting>
- <para> The example represents definition of two different treeNode components. The first
- specifies the album that's available for sale, the other specifies the album that is
- not available. The result is shown on the following screenshot: </para>
+ <para> The example represents definition of two different <emphasis role="bold">
+ <property> <rich:treeNode></property>
+ </emphasis> components. The first specifies the album that's available for sale, the
+ other specifies the album that is not available. The result is shown on the following
+ screenshot: </para>
<figure>
<title> Using the <emphasis>
@@ -291,9 +300,11 @@
<property>"value"</property>
</emphasis> and <emphasis>
<property>"var"</property>
- </emphasis>. Besides, visual representation shouldn't be defined right in the tree.
- In this case tree tag is intended mainly for defining common attributes such as
- <property>"ajaxSubmitSelection"</property>, for instance. </para>
+ </emphasis>. Besides, visual representation shouldn't be defined right in the
+ <property>tree</property>. In this case tree tag is intended mainly for defining common
+ attributes such as <emphasis>
+ <property>"ajaxSubmitSelection"</property>
+ </emphasis>, for instance. </para>
</section>
<section>
17 years, 2 months
JBoss Rich Faces SVN: r3629 - in trunk/extensions/portlet/src: main/java/org/ajax4jsf/portlet/application and 3 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: alexsmirnov
Date: 2007-10-30 20:58:31 -0400 (Tue, 30 Oct 2007)
New Revision: 3629
Added:
trunk/extensions/portlet/src/main/java/org/ajax4jsf/portlet/context/PortalActionURL.java
trunk/extensions/portlet/src/test/java/org/ajax4jsf/portlet/context/PortalActionUrlTest.java
Removed:
trunk/extensions/portlet/src/main/java/org/ajax4jsf/portlet/PortletAjaxContext.java
Modified:
trunk/extensions/portlet/src/main/java/org/ajax4jsf/portlet/application/PortletViewHandler.java
trunk/extensions/portlet/src/main/java/org/ajax4jsf/portlet/context/PortletContextImpl.java
trunk/extensions/portlet/src/main/java/org/ajax4jsf/portlet/context/PortletRenderContextImpl.java
trunk/extensions/portlet/src/main/resources/META-INF/faces-config.xml
Log:
Continue to implement JSR-301 bridge. Finish requrements from PLT 5.
Deleted: trunk/extensions/portlet/src/main/java/org/ajax4jsf/portlet/PortletAjaxContext.java
===================================================================
--- trunk/extensions/portlet/src/main/java/org/ajax4jsf/portlet/PortletAjaxContext.java 2007-10-30 23:16:49 UTC (rev 3628)
+++ trunk/extensions/portlet/src/main/java/org/ajax4jsf/portlet/PortletAjaxContext.java 2007-10-31 00:58:31 UTC (rev 3629)
@@ -1,93 +0,0 @@
-/**
- *
- */
-package org.ajax4jsf.portlet;
-
-import java.util.Map;
-
-import javax.faces.component.UIViewRoot;
-import javax.faces.context.ExternalContext;
-import javax.faces.context.FacesContext;
-
-import org.ajax4jsf.context.AjaxContextImpl;
-import org.ajax4jsf.portlet.context.AbstractExternalContext;
-import org.ajax4jsf.webapp.WebXml;
-
-/**
- * @author asmirnov
- *
- */
-public class PortletAjaxContext extends AjaxContextImpl {
- public String getAjaxActionURL(FacesContext context) {
- // Check arguments
- if (null == context) {
- throw new NullPointerException(
- "Faces context for build AJAX Action URL is null");
- }
-// if (context.getExternalContext().getContext() instanceof PortletContext) {
- UIViewRoot viewRoot = context.getViewRoot();
- if (null == viewRoot) {
- throw new NullPointerException(
- "Faces view tree for build AJAX Action URL is null");
- }
- String viewId = viewRoot.getViewId();
- if (null == viewId) {
- throw new NullPointerException(
- "View id for build AJAX Action URL is null");
- }
- if (!viewId.startsWith("/")) {
- throw new IllegalArgumentException(
- "Illegal view Id for build AJAX Action URL: " + viewId);
- }
- ExternalContext externalContext = context.getExternalContext();
- WebXml webXml = (WebXml) externalContext.getApplicationMap().get(
- WebXml.CONTEXT_ATTRIBUTE);
- if (null == webXml) {
- throw new NullPointerException(
- "Ajax Filter not properly configured for web application");
- }
- StringBuffer actionUrl = new StringBuffer(externalContext
- .getRequestContextPath());
- if (webXml.isPrefixMapping()) {
- String facesFilterPrefix = webXml.getFacesFilterPrefix();
- if (facesFilterPrefix.endsWith("/")) {
- facesFilterPrefix = facesFilterPrefix.substring(0,facesFilterPrefix.length()-1);
- }
- actionUrl.append(facesFilterPrefix).append(viewId);
- } else {
- int dot = viewId.lastIndexOf('.');
- if (dot < 0) {
- actionUrl.append(viewId).append(
- webXml.getFacesFilterSuffix());
- } else {
- actionUrl.append(viewId.substring(0, dot)).append(
- webXml.getFacesFilterSuffix());
- }
- }
- // ViewHandler viewHandler =
- // context.getApplication().getViewHandler();
- // TODO - append optional seam/portlet.. parameters
- return externalContext.encodeActionURL(actionUrl.toString());
-// } else {
-// return super.getAjaxActionURL(context);
-// }
- }
-
- public Map getCommonAjaxParameters() {
- Map map = super.getCommonAjaxParameters();
- FacesContext facesContext = FacesContext.getCurrentInstance();
- String namespace = AjaxFacesPortlet.getPortletNamespace(facesContext);
- if (null != namespace) {
- map.put(AbstractExternalContext.NAMESPACE_PARAMETER, namespace);
- }
- String actionUrl = (String) facesContext.getExternalContext().getRequestParameterMap().get(AbstractExternalContext.ACTION__PARAMETER);
- if(null != actionUrl){
- map.put(AbstractExternalContext.ACTION__PARAMETER, actionUrl);
- }
- String portletMode = (String) facesContext.getExternalContext().getRequestParameterMap().get(AbstractExternalContext.PORTLET_MODE_PARAMETER);
- if(null != actionUrl){
- map.put(AbstractExternalContext.PORTLET_MODE_PARAMETER, portletMode);
- }
- return map;
- }
-}
Modified: trunk/extensions/portlet/src/main/java/org/ajax4jsf/portlet/application/PortletViewHandler.java
===================================================================
--- trunk/extensions/portlet/src/main/java/org/ajax4jsf/portlet/application/PortletViewHandler.java 2007-10-30 23:16:49 UTC (rev 3628)
+++ trunk/extensions/portlet/src/main/java/org/ajax4jsf/portlet/application/PortletViewHandler.java 2007-10-31 00:58:31 UTC (rev 3629)
@@ -12,67 +12,64 @@
import javax.faces.context.FacesContext;
import javax.portlet.PortletURL;
import javax.portlet.RenderResponse;
+import javax.portlet.faces.Bridge;
import org.ajax4jsf.application.AjaxViewHandler;
+import org.ajax4jsf.component.AjaxViewRoot;
import org.ajax4jsf.context.AjaxContext;
import org.ajax4jsf.portlet.component.UIPortletViewRoot;
import org.ajax4jsf.portlet.context.AbstractExternalContext;
/**
* @author asmirnov
- *
+ *
*/
public class PortletViewHandler extends AjaxViewHandler {
- /**
- * @param parent
- */
- public PortletViewHandler(ViewHandler parent) {
- super(parent);
- }
-
-
- public void initView(FacesContext context) throws FacesException {
- super.initView(context);
- }
-
- public UIViewRoot createView(FacesContext facesContext, String viewId) {
- AjaxContext ajaxContext = AjaxContext.getCurrentInstance(facesContext);
- boolean ajaxRequest = ajaxContext.isAjaxRequest(facesContext);
- UIViewRoot root = new UIPortletViewRoot(super.createView(facesContext, viewId));
- if(ajaxRequest && null != ajaxContext.getViewIdHolder()){
- // Store new viewId for a portlet.
- }
- return root;
- }
+ /**
+ * @param parent
+ */
+ public PortletViewHandler(ViewHandler parent) {
+ super(parent);
+ }
- public void renderView(FacesContext context, UIViewRoot root) throws IOException, FacesException {
- super.renderView(context, root);
- // Save view to use in portlet rendering phases
-// PortletViewState state = new PortletViewState();
-// state.save(context);
-// context.getExternalContext().getSessionMap().put(
-// PortletViewState.SAVED_VIEW_ATTRIBUTE, state);
+ public void initView(FacesContext context) throws FacesException {
+ super.initView(context);
+ }
- }
-
- public String getActionURL(FacesContext context, String url) {
- ExternalContext externalContext = context.getExternalContext();
- String portalActionURL = (String) externalContext.getRequestParameterMap().get(AbstractExternalContext.ACTION__PARAMETER);
- Object response = externalContext.getResponse();
- if (response instanceof RenderResponse) {
- RenderResponse renderResponse = (RenderResponse) response;
- PortletURL portletURL = renderResponse.createActionURL();
-// portletURL.setParameter(AbstractExternalContext.VIEW_ID_PARAMETER, context.getViewRoot().getViewId());
- portletURL.setParameter(AbstractExternalContext.NAMESPACE_PARAMETER, renderResponse.getNamespace());
- return portletURL.toString();
- } else if(null!=portalActionURL){
- return portalActionURL;
- } else {
- return super.getActionURL(context, url);
+ public UIViewRoot createView(FacesContext facesContext, String viewId) {
+ AjaxContext ajaxContext = AjaxContext.getCurrentInstance(facesContext);
+ boolean ajaxRequest = ajaxContext.isAjaxRequest(facesContext);
+ UIViewRoot root = super.createView(facesContext, viewId);
+ Class<? extends UIViewRoot> rootClass = root.getClass();
+ if (rootClass == AjaxViewRoot.class || rootClass == UIViewRoot.class) {
+ root = new UIPortletViewRoot(root);
+ }
+ if (ajaxRequest && null != ajaxContext.getViewIdHolder()) {
+ // Store new viewId for a portlet.
+ }
+ return root;
}
- }
-
- protected synchronized void fillChain(FacesContext context) {
- // Do nothing - chain must be filled in AjaxViewHandler
- }
+
+ public void renderView(FacesContext context, UIViewRoot root)
+ throws IOException, FacesException {
+ super.renderView(context, root);
+ // Save view to use in portlet rendering phases
+ // PortletViewState state = new PortletViewState();
+ // state.save(context);
+ // context.getExternalContext().getSessionMap().put(
+ // PortletViewState.SAVED_VIEW_ATTRIBUTE, state);
+
+ }
+
+ public String getActionURL(FacesContext context, String url) {
+ String actionURL = super.getActionURL(context, url);
+ if( null != context.getExternalContext().getRequestMap().get(Bridge.PORTLET_LIFECYCLE_PHASE)){
+ actionURL = actionURL + ((actionURL.lastIndexOf('?')>0)?"&":"?")+AbstractExternalContext.VIEW_ID_PARAMETER+"="+url;
+ }
+ return actionURL;
+ }
+
+ protected synchronized void fillChain(FacesContext context) {
+ // Do nothing - chain must be filled in AjaxViewHandler
+ }
}
Added: trunk/extensions/portlet/src/main/java/org/ajax4jsf/portlet/context/PortalActionURL.java
===================================================================
--- trunk/extensions/portlet/src/main/java/org/ajax4jsf/portlet/context/PortalActionURL.java (rev 0)
+++ trunk/extensions/portlet/src/main/java/org/ajax4jsf/portlet/context/PortalActionURL.java 2007-10-31 00:58:31 UTC (rev 3629)
@@ -0,0 +1,190 @@
+/**
+ *
+ */
+package org.ajax4jsf.portlet.context;
+
+import java.net.MalformedURLException;
+import java.net.URL;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.Map;
+import java.util.Map.Entry;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+
+import org.apache.commons.collections.map.LinkedMap;
+
+/**
+ * @author asmirnov
+ *
+ */
+public class PortalActionURL {
+
+ private static final Pattern urlPattern = Pattern
+ .compile("^(\\w*:)?(//[\\w\\._-]+[^/:])?((?:\\:)(\\d+))?([^?]*)?((?:\\?)(.*))?$");
+
+ private static final String NULL = "";
+
+ private String protocol;
+
+ private String host;
+
+ private int port = -1;
+
+ /**
+ * The authority part of this URL.
+ *
+ * @serial
+ */
+ private String authority;
+
+ /**
+ * The path part of this URL.
+ */
+ private transient String path;
+
+ /**
+ * The userinfo part of this URL.
+ */
+ private transient String userInfo;
+
+ private Map<String, String> parameters;
+
+ private String queryString;
+
+ private int _length;
+
+ /**
+ * @param url
+ */
+ public PortalActionURL(String url) throws MalformedURLException {
+ Matcher urlMatcher = urlPattern.matcher(url);
+ if (!urlMatcher.matches()) {
+ throw new MalformedURLException(url);
+ }
+ _length = url.length();
+ this.protocol = urlMatcher.group(1);
+ this.host = urlMatcher.group(2);
+ String portStr = urlMatcher.group(4);
+ if (null != portStr && portStr.length() > 0) {
+ this.port = Integer.parseInt(portStr);
+ }
+ this.path = urlMatcher.group(5);
+ queryString = urlMatcher.group(7);
+ parameters = new LinkedMap(30);
+ if (null != queryString) {
+ String[] queryParams = queryString.split("&");
+ for (int i = 0; i < queryParams.length; i++) {
+ String par = queryParams[i];
+ int eqIndex = par.indexOf('=');
+ if(eqIndex>=0){
+ parameters.put(par.substring(0, eqIndex), par.substring(eqIndex+1));
+ } else {
+ parameters.put(par, NULL);
+ }
+ }
+ }
+ }
+
+ /**
+ * @return the protocol
+ */
+ public String getProtocol() {
+ return protocol;
+ }
+
+ /**
+ * @return the host
+ */
+ public String getHost() {
+ return host;
+ }
+
+ /**
+ * @return the port
+ */
+ public int getPort() {
+ return port;
+ }
+
+ /**
+ * @return the authority
+ */
+ public String getAuthority() {
+ return authority;
+ }
+
+ /**
+ * @return the path
+ */
+ public String getPath() {
+ return path;
+ }
+
+ /**
+ * @return the userInfo
+ */
+ public String getUserInfo() {
+ return userInfo;
+ }
+
+ /**
+ * @return the queryString
+ */
+ public String getQueryString() {
+ return queryString;
+ }
+
+ public String getParameter(String name) {
+ return parameters.get(name);
+ }
+
+ public void addParameter(String name, String value){
+ parameters.put(name, value);
+ }
+
+ public String removeParameter(String name){
+ return parameters.remove(name);
+ }
+
+ public int parametersSize() {
+ return parameters.size();
+ }
+
+ public boolean isInContext(String context) {
+ return host==null && protocol == null && port == -1 && path.startsWith(context+"/");
+ }
+
+ @Override
+ public String toString() {
+ StringBuffer url = new StringBuffer(_length);
+ if(null != protocol){
+ url.append(protocol);
+ }
+ if (null!=host) {
+ url.append(host);
+ }
+ if(port>0){
+ url.append(':').append(port);
+ }
+ url.append(path);
+ if(parameters.size()>0){
+ url.append('?');
+ for (Iterator<Entry<String, String>> iterator = parameters.entrySet().iterator(); iterator.hasNext();) {
+ Entry<String, String> param = iterator.next();
+ url.append(param.getKey());
+ if(param.getValue() != NULL){
+ url.append('=').append(param.getValue());
+ }
+ if (iterator.hasNext()) {
+ url.append('&');
+ }
+ }
+ }
+ return url.toString();
+ }
+
+ public Map<String,String> getParameters() {
+ return parameters;
+ }
+}
Property changes on: trunk/extensions/portlet/src/main/java/org/ajax4jsf/portlet/context/PortalActionURL.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:keywords
+ Date Revision Author
Modified: trunk/extensions/portlet/src/main/java/org/ajax4jsf/portlet/context/PortletContextImpl.java
===================================================================
--- trunk/extensions/portlet/src/main/java/org/ajax4jsf/portlet/context/PortletContextImpl.java 2007-10-30 23:16:49 UTC (rev 3628)
+++ trunk/extensions/portlet/src/main/java/org/ajax4jsf/portlet/context/PortletContextImpl.java 2007-10-31 00:58:31 UTC (rev 3629)
@@ -16,8 +16,11 @@
import java.util.Locale;
import java.util.Map;
import java.util.Set;
+import java.util.regex.Pattern;
import javax.faces.FacesException;
+import javax.faces.context.ExternalContext;
+import javax.faces.context.FacesContextFactory;
import javax.portlet.ActionRequest;
import javax.portlet.ActionResponse;
import javax.portlet.PortletContext;
@@ -28,8 +31,11 @@
import javax.portlet.PortletSession;
import javax.portlet.RenderRequest;
import javax.portlet.RenderResponse;
+import javax.portlet.faces.Bridge;
/**
+ * Version of the {@link ExternalContext} for a Portlet request. {@link FacesContextFactory} will create instance of this class
+ * for a portal <code>action</code> phase.
* @author asmirnov
*
*/
@@ -47,47 +53,26 @@
}
public String getResponseCharacterEncoding() {
- PortletResponse portletResponse = getPortletResponse();
- if (portletResponse instanceof RenderResponse) {
- RenderResponse renderResponse = (RenderResponse) portletResponse;
- return renderResponse.getCharacterEncoding();
- } else {
return null;
- }
}
public String getResponseContentType() {
- PortletResponse portletResponse = getPortletResponse();
- if (portletResponse instanceof RenderResponse) {
- RenderResponse renderResponse = (RenderResponse) portletResponse;
- return renderResponse.getContentType();
- } else {
return null;
- }
}
public void setRequestCharacterEncoding(String encoding)
throws UnsupportedEncodingException {
- PortletRequest portletRequest = getPortletRequest();
- if (portletRequest instanceof ActionRequest) {
try {
- ActionRequest actionRequest = (ActionRequest) portletRequest;
+ ActionRequest actionRequest = (ActionRequest) getPortletRequest();
actionRequest.setCharacterEncoding(encoding);
-
} catch (IllegalStateException e) {
// TODO: handle exception
}
- }
}
public String getRequestCharacterEncoding() {
- PortletRequest portletRequest = getPortletRequest();
- if (portletRequest instanceof ActionRequest) {
- ActionRequest actionRequest = (ActionRequest) portletRequest;
+ ActionRequest actionRequest = (ActionRequest) getPortletRequest();
return actionRequest.getCharacterEncoding();
- } else {
- return null;
- }
}
public String getRequestContentType() {
@@ -112,16 +97,12 @@
protected String getNamespace() {
if (null == namespace) {
- if (getResponse() instanceof RenderResponse) {
- namespace = ((RenderResponse) getResponse()).getNamespace();
- } else {
namespace = (String) getRequestParameter(
AbstractExternalContext.NAMESPACE_PARAMETER);
if(null == namespace){
throw new IllegalStateException(
"Can not determine portlet namespace");
}
- }
}
return namespace;
}
@@ -232,30 +213,62 @@
if (null == path) {
throw new NullPointerException("Path to new view is null");
}
- if (!(getRequest() instanceof RenderRequest && getResponse() instanceof RenderResponse)) {
throw new IllegalStateException(
"Dispatch to new view not at render phase");
- }
- PortletRequestDispatcher dispatcher = getPortletContext()
- .getRequestDispatcher(path);
- if (null == dispatcher) {
- throw new IllegalStateException(
- "Dispatcher for render request is not created");
- }
- try {
- dispatcher.include((RenderRequest) getRequest(),
- (RenderResponse) getResponse());
- } catch (PortletException e) {
- throw new FacesException(e);
- }
}
+ private static final Pattern absoluteUrl = Pattern.compile("");
+ private static final Pattern directLink = Pattern.compile("");
+ private static final Pattern viewIdParam = Pattern.compile("");
+
+ /* (non-Javadoc)
+ * @see javax.faces.context.ExternalContext#encodeActionURL(java.lang.String)
+ * JSR-301 requirements, PLT 6.1.3.1 :
+ * Return the inputURL, after performing any rewriting needed to ensure that it will correctly identify an addressable URL in the current application. The inputURL is expected to conform to standard URI syntax or more specifically not be the result of calling PortletURL.toString(). When called during the RenderPhase, the inputURL is transformed, encoded, and returned so it can be used as markup into the response. When called during the ActionPhase, the inputURL is transformed and encoded into the ActionResponse as the Faces navigation which resulted from processing the action. To process such an inputURL correctly, this method must:
+ o If the inputURL starts with the # character or the inputURL is an absolute path external to this portlet application return the inputURL unchanged.
+ o If the inputURL contains the parameter javax.portlet.faces.DirectLink and its value is true then return it without removing this parameter. If the inputURL contains the parameter javax.portlet.faces.DirectLink and its value is false then remove the javax.portlet.faces.DirectLink parameter and value from the queryString and continue processing.
+ o Otherwise:
+ + Identify the viewId within the inputURL.
+ # If the inputURL contains a bridge encoded viewId then extract it from the URL and use this as the viewId.
+ # Otherwise if the inputURL is a full path within the portlet application, use the servlet definitions from the web application's web.xml to determine both how the Faces servlet is mapped and whether this URL resolves to the Faces servlet. Derive the view identifier that corresponds to this URL, as follows:
+ Note: all resulting viewIds start with a "/".
+ * If prefix mapping (such as “/faces/*”) is used for FacesServlet, the viewId is set from the extra path information of the request URI. This corresponds to the path that follows the prefix mapping.
+ * If suffix mapping (such as “*.faces”) is used for FacesServlet, the viewId is set from the servlet path information of the request URI, after replacing the suffix with the value of the context initialization parameter named by the symbolic constant ViewHandler.DEFAULT_SUFFIX_PARAM_NAME (if no such context initialization parameter is present, use the value of the symbolic constant ViewHandler.DEFAULT_SUFFIX as the replacement suffix). This corresponds to the path that follows the context path.
+ * If the URL doesn't reference a FacesServlet mapping then the viewId is the path that follows the context path.
+ + Process the viewId based URL
+ # If executed during the ActionPhase, encode the viewId and any additional querystring parameters in the ActionResponse in a way that not only ensures that the appropriate subsequent render will be based on these but also that inappropriate subsequent renders will not. (See section 5.1 concerning request scopes). Return a non-null URL string whose value isn't equal to the inputURL.
+ # If executed during the RenderPhase, construct an actionURL by calling getResponse().createActionURL(). Encode the viewId and any additional querystring parameters in this actionURL in a way that not only ensures that the appropriate subsequent render will be based on these parameters but also that inappropriate subsequent renders will not. (See section 5.1 concerning request scopes).. And return actionURL.toString().
+
+ Note: the result must not contain doubly encoded querystring parameter values and hence additional processing is required to detect and undo such double encoding when the inputURL is already encoded and the actionURL.toString() does reencoding.
+
+ */
public String encodeActionURL(String url) {
if (null == url) {
throw new NullPointerException();
}
- return url;
+ String actionUrl = url;
+ if(!actionUrl.startsWith("#") ){
+ try {
+ PortalActionURL portalUrl = new PortalActionURL(url);
+ if(portalUrl.isInContext(getRequestContextPath()) || !(Boolean.parseBoolean(portalUrl.getParameter(Bridge.DIRECT_LINK)))){
+ portalUrl.removeParameter(Bridge.DIRECT_LINK);
+ String viewId = portalUrl.getParameter(VIEW_ID_PARAMETER);
+ actionUrl = createActionUrl(portalUrl.getParameters());
+ }
+ } catch (MalformedURLException e) {
+ throw new FacesException(e);
+ }
+ }
+ return getPortletResponse().encodeURL(actionUrl);
}
+
+ /**
+ * @param parameters
+ * @return
+ */
+ protected String createActionUrl(Map parameters){
+ return "/ajax4jsfPortletBridge/actionUrl/do/nothitg";
+ }
public String encodeResourceURL(String url) {
return getPortletResponse().encodeURL(url);
@@ -317,10 +330,6 @@
if (null == url) {
throw new NullPointerException("Path to redirect is null");
}
- if (!(getRequest() instanceof ActionRequest && getResponse() instanceof ActionResponse)) {
- throw new IllegalStateException(
- "Redirect to new url not at action phase");
- }
((ActionResponse) getResponse()).sendRedirect(url);
}
}
Modified: trunk/extensions/portlet/src/main/java/org/ajax4jsf/portlet/context/PortletRenderContextImpl.java
===================================================================
--- trunk/extensions/portlet/src/main/java/org/ajax4jsf/portlet/context/PortletRenderContextImpl.java 2007-10-30 23:16:49 UTC (rev 3628)
+++ trunk/extensions/portlet/src/main/java/org/ajax4jsf/portlet/context/PortletRenderContextImpl.java 2007-10-31 00:58:31 UTC (rev 3629)
@@ -3,17 +3,30 @@
*/
package org.ajax4jsf.portlet.context;
+import java.io.IOException;
+import java.io.UnsupportedEncodingException;
import java.util.Collection;
import java.util.Collections;
import java.util.Enumeration;
import java.util.HashMap;
+import java.util.Iterator;
import java.util.Map;
+import java.util.Map.Entry;
+import java.util.regex.Pattern;
+import javax.faces.FacesException;
import javax.faces.render.ResponseStateManager;
+import javax.portlet.ActionRequest;
+import javax.portlet.ActionResponse;
import javax.portlet.PortletConfig;
import javax.portlet.PortletContext;
+import javax.portlet.PortletException;
import javax.portlet.PortletRequest;
+import javax.portlet.PortletRequestDispatcher;
import javax.portlet.PortletResponse;
+import javax.portlet.PortletURL;
+import javax.portlet.RenderRequest;
+import javax.portlet.RenderResponse;
import javax.portlet.faces.Bridge;
import org.ajax4jsf.portlet.application.PortletViewState;
@@ -24,6 +37,29 @@
*/
public class PortletRenderContextImpl extends PortletContextImpl {
+ public String getResponseCharacterEncoding() {
+ RenderResponse renderResponse = (RenderResponse) getPortletResponse();
+ return renderResponse.getCharacterEncoding();
+ }
+
+ public String getResponseContentType() {
+ RenderResponse renderResponse = (RenderResponse) getPortletResponse();
+ return renderResponse.getContentType();
+ }
+
+ public void setRequestCharacterEncoding(String encoding)
+ throws UnsupportedEncodingException {
+ // Do nothing.
+ }
+
+ public String getRequestCharacterEncoding() {
+ return null;
+ }
+
+ protected String getNamespace() {
+ return ((RenderResponse)getPortletResponse()).getNamespace();
+ }
+
private Map<String, String[]> _requestParameters;
public PortletRenderContextImpl(PortletContext context,
@@ -49,6 +85,43 @@
}
}
+ @Override
+ public void redirect(String url) throws IOException {
+ throw new IllegalStateException(
+ "Redirect to new url not at action phase");
+ }
+
+
+ @Override
+ protected String createActionUrl(Map parameters) {
+ RenderResponse renderResponse = (RenderResponse) getPortletResponse();
+ PortletURL portletURL = renderResponse.createActionURL();
+ portletURL.setParameter(AbstractExternalContext.NAMESPACE_PARAMETER, renderResponse.getNamespace());
+ for (Iterator<Entry<String, String>> param = parameters.entrySet().iterator(); param.hasNext();) {
+ Entry<String, String> parameter = param.next();
+ portletURL.setParameter(parameter.getKey(), parameter.getValue());
+ }
+ return portletURL.toString();
+ }
+
+ public void dispatch(String path) throws IOException {
+ if (null == path) {
+ throw new NullPointerException("Path to new view is null");
+ }
+ PortletRequestDispatcher dispatcher = getPortletContext()
+ .getRequestDispatcher(path);
+ if (null == dispatcher) {
+ throw new IllegalStateException(
+ "Dispatcher for render request is not created");
+ }
+ try {
+ dispatcher.include((RenderRequest) getRequest(),
+ (RenderResponse) getResponse());
+ } catch (PortletException e) {
+ throw new FacesException(e);
+ }
+ }
+
/**
* @return
*/
Modified: trunk/extensions/portlet/src/main/resources/META-INF/faces-config.xml
===================================================================
--- trunk/extensions/portlet/src/main/resources/META-INF/faces-config.xml 2007-10-30 23:16:49 UTC (rev 3628)
+++ trunk/extensions/portlet/src/main/resources/META-INF/faces-config.xml 2007-10-31 00:58:31 UTC (rev 3629)
@@ -11,17 +11,11 @@
org.ajax4jsf.portlet.context.FacesContextFactoryImpl
</faces-context-factory>
</factory>
-<lifecycle>
- <phase-listener>org.ajax4jsf.portlet.lifecycle.PortalPhaseListener</phase-listener>
-</lifecycle>
- <managed-bean>
- <managed-bean-name>ajaxContext</managed-bean-name>
- <managed-bean-class>
- org.ajax4jsf.portlet.PortletAjaxContext
- </managed-bean-class>
- <managed-bean-scope>request</managed-bean-scope>
- </managed-bean>
-
+ <lifecycle>
+ <phase-listener>
+ org.ajax4jsf.portlet.lifecycle.PortalPhaseListener
+ </phase-listener>
+ </lifecycle>
<render-kit>
<renderer>
Added: trunk/extensions/portlet/src/test/java/org/ajax4jsf/portlet/context/PortalActionUrlTest.java
===================================================================
--- trunk/extensions/portlet/src/test/java/org/ajax4jsf/portlet/context/PortalActionUrlTest.java (rev 0)
+++ trunk/extensions/portlet/src/test/java/org/ajax4jsf/portlet/context/PortalActionUrlTest.java 2007-10-31 00:58:31 UTC (rev 3629)
@@ -0,0 +1,89 @@
+/**
+ *
+ */
+package org.ajax4jsf.portlet.context;
+
+import junit.framework.TestCase;
+
+/**
+ * @author asmirnov
+ *
+ */
+public class PortalActionUrlTest extends TestCase {
+
+ /**
+ * @param name
+ */
+ public PortalActionUrlTest(String name) {
+ super(name);
+ }
+
+ /* (non-Javadoc)
+ * @see junit.framework.TestCase#setUp()
+ */
+ protected void setUp() throws Exception {
+ super.setUp();
+ }
+
+ /* (non-Javadoc)
+ * @see junit.framework.TestCase#tearDown()
+ */
+ protected void tearDown() throws Exception {
+ super.tearDown();
+ }
+
+ public void testActionUrl() throws Exception {
+ PortalActionURL url = new PortalActionURL("ftp://foo.bar:90/some/path/index.jsf?a=b&cd=ef");
+ assertEquals("ftp:", url.getProtocol());
+ assertEquals("//foo.bar", url.getHost());
+ assertEquals(90, url.getPort());
+ assertEquals("/some/path/index.jsf", url.getPath());
+ assertEquals("a=b&cd=ef", url.getQueryString());
+ }
+ public void testActionUrl1() throws Exception {
+ PortalActionURL url = new PortalActionURL("//foo.bar:90/some/path/index.jsf?a=b&cd=ef");
+ assertNull( url.getProtocol());
+ assertEquals("//foo.bar", url.getHost());
+ assertEquals(90, url.getPort());
+ assertEquals("/some/path/index.jsf", url.getPath());
+ assertEquals("a=b&cd=ef", url.getQueryString());
+ }
+ public void testActionUrl2() throws Exception {
+ PortalActionURL url = new PortalActionURL("//foo.bar/some/path/index.jsf?a=b&cd=ef");
+ assertNull( url.getProtocol());
+ assertEquals("//foo.bar", url.getHost());
+ assertEquals(-1, url.getPort());
+ assertEquals("/some/path/index.jsf", url.getPath());
+ assertEquals("a=b&cd=ef", url.getQueryString());
+ }
+ public void testActionUrl3() throws Exception {
+ PortalActionURL url = new PortalActionURL("/some/path/index.jsf?a=b&cd=ef");
+ assertNull( url.getProtocol());
+ assertNull( url.getHost());
+ assertEquals(-1, url.getPort());
+ assertEquals("/some/path/index.jsf", url.getPath());
+ assertEquals("a=b&cd=ef", url.getQueryString());
+ }
+ public void testActionUrl4() throws Exception {
+ PortalActionURL url = new PortalActionURL("/some/path/index.jsf");
+ assertNull( url.getProtocol());
+ assertNull( url.getHost());
+ assertEquals(-1, url.getPort());
+ assertEquals("/some/path/index.jsf", url.getPath());
+ assertNull( url.getQueryString());
+ }
+
+ public void testParseQueryString() throws Exception {
+ PortalActionURL url = new PortalActionURL("/some/path/index.jsf?a=b&cd=ef");
+ assertEquals(2, url.parametersSize());
+ assertEquals("b", url.getParameter("a"));
+ assertEquals("ef", url.getParameter("cd"));
+ assertNull(url.getParameter("xxx"));
+ }
+ public void testParseQueryString1() throws Exception {
+ PortalActionURL url = new PortalActionURL("/some/path/index.jsf?a=b");
+ assertEquals(1, url.parametersSize());
+ assertEquals("b", url.getParameter("a"));
+ assertNull(url.getParameter("cd"));
+ }
+}
Property changes on: trunk/extensions/portlet/src/test/java/org/ajax4jsf/portlet/context/PortalActionUrlTest.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:keywords
+ Date Revision Author
17 years, 2 months
JBoss Rich Faces SVN: r3628 - trunk/samples/tooltip-sample/src/main/webapp/pages.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2007-10-30 19:16:49 -0400 (Tue, 30 Oct 2007)
New Revision: 3628
Modified:
trunk/samples/tooltip-sample/src/main/webapp/pages/demo.jsp
Log:
http://jira.jboss.com/jira/browse/RF-1269
Modified: trunk/samples/tooltip-sample/src/main/webapp/pages/demo.jsp
===================================================================
--- trunk/samples/tooltip-sample/src/main/webapp/pages/demo.jsp 2007-10-30 23:16:45 UTC (rev 3627)
+++ trunk/samples/tooltip-sample/src/main/webapp/pages/demo.jsp 2007-10-30 23:16:49 UTC (rev 3628)
@@ -36,7 +36,7 @@
</p>
</f:verbatim>
- <rich:toolTip followMouse="true" direction="top-right" delay="500" styleClass="tooltip" style="width:250px">
+ <rich:toolTip followMouse="true" direction="top-right" showDelay="500" styleClass="tooltip" style="width:250px">
<f:verbatim>
<span>
This tool-tip content also <strong>pre-rendered</strong> to the page.
@@ -93,6 +93,47 @@
</rich:toolTip>
</a4j:outputPanel>
</h:form>
+ <h:form>
+ <f:verbatim>
+ <div id="justdiv" style="width:350px;height:75px;cursor:arrow;border-width:2px;text-align:center;border:2px solid red">
+ Simple HTML DIV
+ </div>
+ </f:verbatim>
+
+ <rich:toolTip for="justdiv">
+ <f:verbatim>
+ <span style="white-space:nowrap">
+ This tool-tip content was <strong>pre-rendered</strong> to the page.<br/>
+ The look of this tool-tip is 100% defined by skin.
+ </span>
+ </f:verbatim>
+ </rich:toolTip>
+ </h:form>
+ <h:panelGroup>
+ <a4j:outputPanel id="forComponent" layout="block" style="width:350px;height:75px;cursor:arrow;border-width:2px;text-align:center;border:2px solid red">
+ <f:verbatim>
+ <p>
+ For pointed to JSF component
+ </p>
+ </f:verbatim>
+ </a4j:outputPanel>
+ <a4j:outputPanel layout="block" style="width:350px;height:75px;cursor:arrow;border-width:2px;text-align:center;border:2px solid red">
+ <rich:toolTip for="forComponent">
+ <f:verbatim>
+ <span style="white-space:nowrap">
+ This tool-tip content was <strong>pre-rendered</strong> to the page.<br/>
+ The look of this tool-tip is 100% defined by skin.
+ </span>
+ </f:verbatim>
+ </rich:toolTip>
+
+ <f:verbatim>
+ <span style="white-space:nowrap">
+ No tooltip here!
+ </span>
+ </f:verbatim>
+ </a4j:outputPanel>
+ </h:panelGroup>
</h:panelGrid>
<h:form>
@@ -103,7 +144,7 @@
</p>
</f:verbatim>
- <rich:toolTip delay="2000" direction="top-right" mode="ajax" styleClass="tooltip" layout="block">
+ <rich:toolTip showDelay="2000" direction="top-right" mode="ajax" styleClass="tooltip" layout="block">
<f:facet name="defaultContent">
<f:verbatim>
<strong>Wait...</strong>
17 years, 2 months