JBoss Rich Faces SVN: r1837 - trunk/ui/suggestionbox/src/test/java/org/richfaces/component.
by richfaces-svn-commits@lists.jboss.org
Author: sergeyhalipov
Date: 2007-07-25 07:02:38 -0400 (Wed, 25 Jul 2007)
New Revision: 1837
Modified:
trunk/ui/suggestionbox/src/test/java/org/richfaces/component/SuggestionBoxComponentTest.java
Log:
Fix new package name in test.
Modified: trunk/ui/suggestionbox/src/test/java/org/richfaces/component/SuggestionBoxComponentTest.java
===================================================================
--- trunk/ui/suggestionbox/src/test/java/org/richfaces/component/SuggestionBoxComponentTest.java 2007-07-25 09:48:50 UTC (rev 1836)
+++ trunk/ui/suggestionbox/src/test/java/org/richfaces/component/SuggestionBoxComponentTest.java 2007-07-25 11:02:38 UTC (rev 1837)
@@ -44,7 +44,7 @@
static {
javaScripts.add("org.ajax4jsf.javascript.AjaxScript");
javaScripts.add("prototype.js");
- javaScripts.add("org.ajax4jsf.resource.SmartPositionScript");
+ javaScripts.add("org.ajax4jsf.javascript.SmartPositionScript");
javaScripts.add("org/richfaces/renderkit/html/scripts/browser_info.js");
javaScripts.add("org/richfaces/renderkit/html/scripts/scriptaculo.js");
javaScripts.add("org/richfaces/renderkit/html/scripts/suggestionbox.js");
17 years, 5 months
JBoss Rich Faces SVN: r1836 - trunk/ui/tooltip/src/main/resources/org/richfaces/renderkit/html/scripts.
by richfaces-svn-commits@lists.jboss.org
Author: dbiatenia
Date: 2007-07-25 05:48:50 -0400 (Wed, 25 Jul 2007)
New Revision: 1836
Modified:
trunk/ui/tooltip/src/main/resources/org/richfaces/renderkit/html/scripts/tooltip.js
Log:
Modified: trunk/ui/tooltip/src/main/resources/org/richfaces/renderkit/html/scripts/tooltip.js
===================================================================
--- trunk/ui/tooltip/src/main/resources/org/richfaces/renderkit/html/scripts/tooltip.js 2007-07-25 08:54:56 UTC (rev 1835)
+++ trunk/ui/tooltip/src/main/resources/org/richfaces/renderkit/html/scripts/tooltip.js 2007-07-25 09:48:50 UTC (rev 1836)
@@ -125,8 +125,12 @@
var event = e;
eval(this.ajaxExecuteString);
}
+ if(this.delay > 0){
+ setTimeout(this.jsVarName + '.displayDiv()', this.delay);
+ } else {
+ this.displayDiv();
+ }
- setTimeout(this.jsVarName + '.displayDiv()', this.delay);
},
doHide: function(e){
@@ -158,31 +162,22 @@
setToolTipPosition: function(e){
- var windowDim = this.windowSize();
- var cursorX = e.clientX + document.body.scrollLeft;
- var cursorY = e.clientY + document.body.scrollTop;
-
- if(this.toolTip.style.display != 'none'){
- this.toolTipH = this.toolTip.getHeight();
- this.toolTipW = this.toolTip.getWidth();
- }
-/*
- this.toolTip.style.display = 'block';
-
- this.toolTip.style.top = cursorY;
- this.toolTip.style.left = cursorX;
-*/
- //var offsets = Position.cumulativeOffset(this.toolTip.parentNode);
- var offsets = Position.cumulativeOffset(this.toolTip.parentNode);
+// var offsets = Position.cumulativeOffset(this.toolTip.parentNode);
-
-
-// offsets[0] -= this.toolTip.parentNode.offsetLeft || 0;
-// offsets[1] -= this.toolTip.parentNode.offsetTop || 0;
-//
-//
var toolTipX=0;
var toolTipY=0;
+
+ var x = Event.pointerX(e);
+ var y = Event.pointerY(e);
+
+
+ var offsets = Position.cumulativeOffset(this.toolTip);
+ offsets[0] -= this.toolTip.offsetLeft || 0;
+ offsets[1] -= this.toolTip.offsetTop || 0;
+
+ toolTipX = x - offsets[0];
+ toolTipY = y - offsets[1];
+/*
var p = Element.getStyle(this.toolTip.parentNode, 'position');
if (p == 'relative'){
@@ -208,6 +203,7 @@
// this.toolTip.style.left = cursorX;
}
}
+*/
//Element.setStyle(this.toolTip, {"left": toolTipX + "px", "top": toolTipY + "px"});
//
17 years, 5 months
JBoss Rich Faces SVN: r1835 - trunk/sandbox/ui/calendar/src/main/resources/org/richfaces/renderkit/html/scripts.
by richfaces-svn-commits@lists.jboss.org
Author: pyaschenko
Date: 2007-07-25 04:54:56 -0400 (Wed, 25 Jul 2007)
New Revision: 1835
Modified:
trunk/sandbox/ui/calendar/src/main/resources/org/richfaces/renderkit/html/scripts/calendar.js
Log:
ie fix
Modified: trunk/sandbox/ui/calendar/src/main/resources/org/richfaces/renderkit/html/scripts/calendar.js
===================================================================
--- trunk/sandbox/ui/calendar/src/main/resources/org/richfaces/renderkit/html/scripts/calendar.js 2007-07-25 02:03:59 UTC (rev 1834)
+++ trunk/sandbox/ui/calendar/src/main/resources/org/richfaces/renderkit/html/scripts/calendar.js 2007-07-25 08:54:56 UTC (rev 1835)
@@ -799,7 +799,7 @@
CalendarView.getControl = function(text, functionName) {
var attr = {
- onclick: (functionName ? "Richfaces.invokeOnComponent('richfaces:calendar',this,'"+functionName+"');" : "")+"return false;",
+ onclick: (functionName ? "Richfaces.invokeOnComponent('richfaces:calendar',this,'"+functionName+"');" : "")+"return false;"
};
return new E('span',attr,[new T(text)]);
17 years, 5 months
JBoss Rich Faces SVN: r1834 - in trunk/samples/richfaces-demo/src/main: webapp/richfaces and 1 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: ishabalov
Date: 2007-07-24 22:03:59 -0400 (Tue, 24 Jul 2007)
New Revision: 1834
Modified:
trunk/samples/richfaces-demo/src/main/java/org/richfaces/demo/common/ComponentNavigator.java
trunk/samples/richfaces-demo/src/main/webapp/richfaces/actionparam.xhtml
trunk/samples/richfaces-demo/src/main/webapp/richfaces/ajaxAttributes.xhtml
trunk/samples/richfaces-demo/src/main/webapp/richfaces/commandButton.xhtml
trunk/samples/richfaces-demo/src/main/webapp/richfaces/dataFilterSlider.xhtml
trunk/samples/richfaces-demo/src/main/webapp/richfaces/dataTable.xhtml
trunk/samples/richfaces-demo/src/main/webapp/richfaces/dataTableScroller.xhtml
trunk/samples/richfaces-demo/src/main/webapp/richfaces/dragIndicator.xhtml
trunk/samples/richfaces-demo/src/main/webapp/richfaces/panel.xhtml
trunk/samples/richfaces-demo/src/main/webapp/richfaces/tabPanel.xhtml
trunk/samples/richfaces-demo/src/main/webapp/richfaces/toolTip.xhtml
trunk/samples/richfaces-demo/src/main/webapp/richfaces/toolTip/use-with-data-table.xhtml
Log:
Added tab state saving code
Modified: trunk/samples/richfaces-demo/src/main/java/org/richfaces/demo/common/ComponentNavigator.java
===================================================================
--- trunk/samples/richfaces-demo/src/main/java/org/richfaces/demo/common/ComponentNavigator.java 2007-07-24 18:20:16 UTC (rev 1833)
+++ trunk/samples/richfaces-demo/src/main/java/org/richfaces/demo/common/ComponentNavigator.java 2007-07-25 02:03:59 UTC (rev 1834)
@@ -18,10 +18,19 @@
private List components = null;
private ComponentDescriptor currentComponent;
private List componentGroups = null;
+ private Object activeTab;
+
+ public Object getActiveTab() {
+ return activeTab;
+ }
+ public void setActiveTab(Object activeTab) {
+ this.activeTab = activeTab;
+ }
public ComponentDescriptor getCurrentComponent() {
String id = getComponentParam();
if (id!=null) {
+ setActiveTab(null);
setCurrentComponent(findComponentById(id));
}
return currentComponent;
Modified: trunk/samples/richfaces-demo/src/main/webapp/richfaces/actionparam.xhtml
===================================================================
--- trunk/samples/richfaces-demo/src/main/webapp/richfaces/actionparam.xhtml 2007-07-24 18:20:16 UTC (rev 1833)
+++ trunk/samples/richfaces-demo/src/main/webapp/richfaces/actionparam.xhtml 2007-07-25 02:03:59 UTC (rev 1834)
@@ -7,7 +7,7 @@
<ui:composition template="/templates/main.xhtml">
<ui:define name="title">RichFaces - Open Source Rich JSF Components - Action Parameter</ui:define>
<ui:define name="body">
- <rich:tabPanel switchType="server" styleClass="top_tab" contentClass="content_tab" inactiveTabClass="inactive_tab" activeTabClass="active_tab">
+ <rich:tabPanel switchType="server" value="#{componentNavigator.activeTab}" styleClass="top_tab" contentClass="content_tab" inactiveTabClass="inactive_tab" activeTabClass="active_tab">
<rich:tab label="Usage">
<ui:include src="/richfaces/actionparam/usage.xhtml"/>
</rich:tab>
Modified: trunk/samples/richfaces-demo/src/main/webapp/richfaces/ajaxAttributes.xhtml
===================================================================
--- trunk/samples/richfaces-demo/src/main/webapp/richfaces/ajaxAttributes.xhtml 2007-07-24 18:20:16 UTC (rev 1833)
+++ trunk/samples/richfaces-demo/src/main/webapp/richfaces/ajaxAttributes.xhtml 2007-07-25 02:03:59 UTC (rev 1834)
@@ -7,7 +7,7 @@
<ui:composition template="/templates/main.xhtml">
<ui:define name="title">RichFaces - Open Source Rich JSF Components - Ajax Attributes</ui:define>
<ui:define name="body">
- <rich:tabPanel switchType="server" styleClass="top_tab" contentClass="content_tab" inactiveTabClass="inactive_tab" activeTabClass="active_tab">
+ <rich:tabPanel switchType="server" value="#{componentNavigator.activeTab}" styleClass="top_tab" contentClass="content_tab" inactiveTabClass="inactive_tab" activeTabClass="active_tab">
<rich:tab label="Usage">
<ui:include src="/richfaces/ajaxAttributes/usage.xhtml"/>
</rich:tab>
Modified: trunk/samples/richfaces-demo/src/main/webapp/richfaces/commandButton.xhtml
===================================================================
--- trunk/samples/richfaces-demo/src/main/webapp/richfaces/commandButton.xhtml 2007-07-24 18:20:16 UTC (rev 1833)
+++ trunk/samples/richfaces-demo/src/main/webapp/richfaces/commandButton.xhtml 2007-07-25 02:03:59 UTC (rev 1834)
@@ -7,7 +7,7 @@
<ui:composition template="/templates/main.xhtml">
<ui:define name="title">RichFaces - Open Source Rich JSF Components - Ajax Form</ui:define>
<ui:define name="body">
- <rich:tabPanel switchType="server" styleClass="top_tab" contentClass="content_tab" inactiveTabClass="inactive_tab" activeTabClass="active_tab">
+ <rich:tabPanel switchType="server" value="#{componentNavigator.activeTab}" styleClass="top_tab" contentClass="content_tab" inactiveTabClass="inactive_tab" activeTabClass="active_tab">
<rich:tab label="Usage">
<ui:include src="/richfaces/commandButton/usage.xhtml"/>
</rich:tab>
Modified: trunk/samples/richfaces-demo/src/main/webapp/richfaces/dataFilterSlider.xhtml
===================================================================
--- trunk/samples/richfaces-demo/src/main/webapp/richfaces/dataFilterSlider.xhtml 2007-07-24 18:20:16 UTC (rev 1833)
+++ trunk/samples/richfaces-demo/src/main/webapp/richfaces/dataFilterSlider.xhtml 2007-07-25 02:03:59 UTC (rev 1834)
@@ -7,7 +7,7 @@
<ui:composition template="/templates/main.xhtml">
<ui:define name="title">RichFaces - Open Source Rich JSF Components - Data FIlter Slider</ui:define>
<ui:define name="body">
- <rich:tabPanel switchType="server" styleClass="top_tab" contentClass="content_tab" inactiveTabClass="inactive_tab" activeTabClass="active_tab">
+ <rich:tabPanel switchType="server" value="#{componentNavigator.activeTab}" styleClass="top_tab" contentClass="content_tab" inactiveTabClass="inactive_tab" activeTabClass="active_tab">
<rich:tab label="Usage">
<ui:include src="/richfaces/dataFilterSlider/usage.xhtml"/>
</rich:tab>
Modified: trunk/samples/richfaces-demo/src/main/webapp/richfaces/dataTable.xhtml
===================================================================
--- trunk/samples/richfaces-demo/src/main/webapp/richfaces/dataTable.xhtml 2007-07-24 18:20:16 UTC (rev 1833)
+++ trunk/samples/richfaces-demo/src/main/webapp/richfaces/dataTable.xhtml 2007-07-25 02:03:59 UTC (rev 1834)
@@ -7,7 +7,7 @@
<ui:composition template="/templates/main.xhtml">
<ui:define name="title">RichFaces - Open Source Rich JSF Components - Data table</ui:define>
<ui:define name="body">
- <rich:tabPanel switchType="server" styleClass="top_tab" contentClass="content_tab" inactiveTabClass="inactive_tab" activeTabClass="active_tab">
+ <rich:tabPanel switchType="server" value="#{componentNavigator.activeTab}" styleClass="top_tab" contentClass="content_tab" inactiveTabClass="inactive_tab" activeTabClass="active_tab">
<rich:tab label="Usage">
<ui:include src="/richfaces/dataTable/usage.xhtml"/>
</rich:tab>
Modified: trunk/samples/richfaces-demo/src/main/webapp/richfaces/dataTableScroller.xhtml
===================================================================
--- trunk/samples/richfaces-demo/src/main/webapp/richfaces/dataTableScroller.xhtml 2007-07-24 18:20:16 UTC (rev 1833)
+++ trunk/samples/richfaces-demo/src/main/webapp/richfaces/dataTableScroller.xhtml 2007-07-25 02:03:59 UTC (rev 1834)
@@ -7,7 +7,7 @@
<ui:composition template="/templates/main.xhtml">
<ui:define name="title">RichFaces - Open Source Rich JSF Components - Data Table Scroller</ui:define>
<ui:define name="body">
- <rich:tabPanel switchType="server" styleClass="top_tab" contentClass="content_tab" inactiveTabClass="inactive_tab" activeTabClass="active_tab">
+ <rich:tabPanel switchType="server" value="#{componentNavigator.activeTab}" styleClass="top_tab" contentClass="content_tab" inactiveTabClass="inactive_tab" activeTabClass="active_tab">
<rich:tab label="Usage">
<ui:include src="/richfaces/dataTableScroller/usage.xhtml"/>
</rich:tab>
Modified: trunk/samples/richfaces-demo/src/main/webapp/richfaces/dragIndicator.xhtml
===================================================================
--- trunk/samples/richfaces-demo/src/main/webapp/richfaces/dragIndicator.xhtml 2007-07-24 18:20:16 UTC (rev 1833)
+++ trunk/samples/richfaces-demo/src/main/webapp/richfaces/dragIndicator.xhtml 2007-07-25 02:03:59 UTC (rev 1834)
@@ -7,7 +7,7 @@
<ui:composition template="/templates/main.xhtml">
<ui:define name="title">RichFaces - Open Source Rich JSF Components - Drag-n-Drop. Drag Indicator</ui:define>
<ui:define name="body">
- <rich:tabPanel switchType="server" styleClass="top_tab" contentClass="content_tab" inactiveTabClass="inactive_tab" activeTabClass="active_tab">
+ <rich:tabPanel switchType="server" value="#{componentNavigator.activeTab}" styleClass="top_tab" contentClass="content_tab" inactiveTabClass="inactive_tab" activeTabClass="active_tab">
<rich:tab label="Usage">
<ui:include src="/richfaces/dragSupport/usage.xhtml"/>
</rich:tab>
Modified: trunk/samples/richfaces-demo/src/main/webapp/richfaces/panel.xhtml
===================================================================
--- trunk/samples/richfaces-demo/src/main/webapp/richfaces/panel.xhtml 2007-07-24 18:20:16 UTC (rev 1833)
+++ trunk/samples/richfaces-demo/src/main/webapp/richfaces/panel.xhtml 2007-07-25 02:03:59 UTC (rev 1834)
@@ -9,7 +9,7 @@
<ui:define name="title">RichFaces - Open Source Rich JSF Components - Panel</ui:define>
<ui:define name="current">panel</ui:define>
<ui:define name="body">
- <rich:tabPanel switchType="server" styleClass="top_tab" contentClass="content_tab" inactiveTabClass="inactive_tab" activeTabClass="active_tab">
+ <rich:tabPanel switchType="server" value="#{componentNavigator.activeTab}" styleClass="top_tab" contentClass="content_tab" inactiveTabClass="inactive_tab" activeTabClass="active_tab">
<rich:tab label="Usage">
<ui:include src="/richfaces/panel/usage.xhtml"/>
</rich:tab>
Modified: trunk/samples/richfaces-demo/src/main/webapp/richfaces/tabPanel.xhtml
===================================================================
--- trunk/samples/richfaces-demo/src/main/webapp/richfaces/tabPanel.xhtml 2007-07-24 18:20:16 UTC (rev 1833)
+++ trunk/samples/richfaces-demo/src/main/webapp/richfaces/tabPanel.xhtml 2007-07-25 02:03:59 UTC (rev 1834)
@@ -7,7 +7,7 @@
<ui:composition template="/templates/main.xhtml">
<ui:define name="title">RichFaces - Open Source Rich JSF Components - TabPanel</ui:define>
<ui:define name="body">
- <rich:tabPanel switchType="server" styleClass="top_tab" contentClass="content_tab" inactiveTabClass="inactive_tab" activeTabClass="active_tab">
+ <rich:tabPanel switchType="server" value="#{componentNavigator.activeTab}" styleClass="top_tab" contentClass="content_tab" inactiveTabClass="inactive_tab" activeTabClass="active_tab">
<rich:tab label="Usage">
<ui:include src="/richfaces/tabPanel/usage.xhtml"/>
</rich:tab>
Modified: trunk/samples/richfaces-demo/src/main/webapp/richfaces/toolTip/use-with-data-table.xhtml
===================================================================
--- trunk/samples/richfaces-demo/src/main/webapp/richfaces/toolTip/use-with-data-table.xhtml 2007-07-24 18:20:16 UTC (rev 1833)
+++ trunk/samples/richfaces-demo/src/main/webapp/richfaces/toolTip/use-with-data-table.xhtml 2007-07-25 02:03:59 UTC (rev 1834)
@@ -50,7 +50,7 @@
<h:outputText value="Make"/>
</f:facet>
<h:outputText id="make" value="#{vehicle.make}" >
- <rich:toolTip direction="top-right" mode="ajax" styleClass="tooltip">
+ <rich:toolTip direction="top-right" mode="ajax" delay="1000" styleClass="tooltip" immediate="true">
<a4j:actionparam name="key" value="#{row}" assignTo="#{toolTipData.currentVehicleIndex}" />
<f:facet name="defaultContent">
<strong>Wait...</strong>
Modified: trunk/samples/richfaces-demo/src/main/webapp/richfaces/toolTip.xhtml
===================================================================
--- trunk/samples/richfaces-demo/src/main/webapp/richfaces/toolTip.xhtml 2007-07-24 18:20:16 UTC (rev 1833)
+++ trunk/samples/richfaces-demo/src/main/webapp/richfaces/toolTip.xhtml 2007-07-25 02:03:59 UTC (rev 1834)
@@ -9,7 +9,7 @@
<ui:define name="title">RichFaces - Open Source Rich JSF Components - PanelBar</ui:define>
<ui:define name="current">panel</ui:define>
<ui:define name="body">
- <rich:tabPanel switchType="server" styleClass="top_tab" contentClass="content_tab" inactiveTabClass="inactive_tab" activeTabClass="active_tab">
+ <rich:tabPanel switchType="ajax" value="#{componentNavigator.activeTab}" styleClass="top_tab" contentClass="content_tab" inactiveTabClass="inactive_tab" activeTabClass="active_tab">
<rich:tab label="Usage">
<ui:include src="/richfaces/toolTip/usage.xhtml"/>
</rich:tab>
17 years, 5 months
JBoss Rich Faces SVN: r1833 - in trunk/sandbox: samples/calendar-sample/src/main/webapp/pages and 4 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: pyaschenko
Date: 2007-07-24 14:20:16 -0400 (Tue, 24 Jul 2007)
New Revision: 1833
Modified:
trunk/sandbox/samples/calendar-sample/src/main/java/org/richfaces/CalendarBean.java
trunk/sandbox/samples/calendar-sample/src/main/webapp/pages/Calendar.jsp
trunk/sandbox/ui/calendar/src/main/config/component/calendar.xml
trunk/sandbox/ui/calendar/src/main/java/org/richfaces/component/UICalendar.java
trunk/sandbox/ui/calendar/src/main/resources/org/richfaces/renderkit/html/scripts/calendar.js
trunk/sandbox/ui/calendar/src/main/templates/org/richfaces/htmlCalendar.jspx
Log:
Modified: trunk/sandbox/samples/calendar-sample/src/main/java/org/richfaces/CalendarBean.java
===================================================================
--- trunk/sandbox/samples/calendar-sample/src/main/java/org/richfaces/CalendarBean.java 2007-07-24 18:19:02 UTC (rev 1832)
+++ trunk/sandbox/samples/calendar-sample/src/main/java/org/richfaces/CalendarBean.java 2007-07-24 18:20:16 UTC (rev 1833)
@@ -42,6 +42,8 @@
private String pattern;
private Date currentDate;
private Date selectedDate;
+ private String jointPoint;
+ private String direction;
private boolean useCustomDayLabels;
@@ -76,6 +78,8 @@
locale = Locale.US;
popup = false;
pattern = "MMM d, yyyy";
+ jointPoint = "bottom-left";
+ direction = "bottom-right";
}
public void selectLocale(ValueChangeEvent event){
@@ -128,4 +132,23 @@
public void setSelectedDate(Date selectedDate) {
this.selectedDate = selectedDate;
}
+
+ public String getJointPoint() {
+ return jointPoint;
+ }
+ public void setJointPoint(String jointPoint) {
+ this.jointPoint = jointPoint;
+ }
+ public void selectJointPoint(ValueChangeEvent event){
+ jointPoint = (String) event.getNewValue();
+ }
+ public String getDirection() {
+ return direction;
+ }
+ public void setDirection(String direction) {
+ this.direction = direction;
+ }
+ public void selectDirection(ValueChangeEvent event){
+ direction = (String) event.getNewValue();
+ }
}
\ No newline at end of file
Modified: trunk/sandbox/samples/calendar-sample/src/main/webapp/pages/Calendar.jsp
===================================================================
--- trunk/sandbox/samples/calendar-sample/src/main/webapp/pages/Calendar.jsp 2007-07-24 18:19:02 UTC (rev 1832)
+++ trunk/sandbox/samples/calendar-sample/src/main/webapp/pages/Calendar.jsp 2007-07-24 18:20:16 UTC (rev 1833)
@@ -35,7 +35,9 @@
datePattern="#{calendarBean.pattern}"
weekDayLabelsShort="#{calendarBean.weekDayLabelsShort}"
value="#{calendarBean.selectedDate}"
- currentDate="#{calendarBean.currentDate}">
+ currentDate="#{calendarBean.currentDate}"
+ jointPoint="#{calendarBean.jointPoint}"
+ direction="#{calendarBean.direction}">
<f:validator validatorId="org.richfaces.CalendarValidator" />
@@ -67,7 +69,24 @@
<f:selectItem itemLabel="dd/M/yy" itemValue="dd/M/yy"/>
<f:selectItem itemLabel="d/MMM/y" itemValue="d/MMM/y"/>
<f:selectItem itemLabel="MMM d, yyyy" itemValue="MMM d, yyyy"/>
- </h:selectOneMenu>
+ </h:selectOneMenu>
+ <h:inputText id="selectdate"/><h:commandButton type="button" value="Select Date" onclick="$(this.form.id+':calendar').component.selectDate(this.form[this.form.id+':selectdate'].value);"/>
+ <h:outputText value="Select Popup Joint Point:" />
+ <h:selectOneRadio onchange="submit()" value="#{calendarBean.jointPoint}" valueChangeListener="#{calendarBean.selectJointPoint}">
+ <f:selectItem itemLabel="bottom-right" itemValue="bottom-right"/>
+ <f:selectItem itemLabel="bottom-left" itemValue="bottom-left"/>
+ <f:selectItem itemLabel="top-right" itemValue="top-right"/>
+ <f:selectItem itemLabel="top-left" itemValue="top-left"/>
+ </h:selectOneRadio>
+ <h:outputText value="Select Popup Direction:" />
+ <h:selectOneRadio onchange="submit()" value="#{calendarBean.direction}" valueChangeListener="#{calendarBean.selectDirection}">
+ <f:selectItem itemLabel="bottom-right" itemValue="bottom-right"/>
+ <f:selectItem itemLabel="bottom-left" itemValue="bottom-left"/>
+ <f:selectItem itemLabel="top-right" itemValue="top-right"/>
+ <f:selectItem itemLabel="top-left" itemValue="top-left"/>
+ </h:selectOneRadio>
+
+ <h:commandButton id="calendarPopup" type="button" value="popup" onclick="$(this.form.id+':calendar').component.doSwitch();"/>
</h:panelGrid>
<h:outputText value="Current date: "/>
Modified: trunk/sandbox/ui/calendar/src/main/config/component/calendar.xml
===================================================================
--- trunk/sandbox/ui/calendar/src/main/config/component/calendar.xml 2007-07-24 18:19:02 UTC (rev 1832)
+++ trunk/sandbox/ui/calendar/src/main/config/component/calendar.xml 2007-07-24 18:20:16 UTC (rev 1833)
@@ -98,6 +98,18 @@
<description></description>
<defaultvalue>true</defaultvalue>
</property>
+ <property>
+ <name>jointPoint</name>
+ <classname>java.lang.String</classname>
+ <description></description>
+ <defaultvalue>"bottom-left"</defaultvalue>
+ </property>
+ <property>
+ <name>direction</name>
+ <classname>java.lang.String</classname>
+ <description></description>
+ <defaultvalue>"bottom-right"</defaultvalue>
+ </property>
<property>
<name>weekDayLabels</name>
Modified: trunk/sandbox/ui/calendar/src/main/java/org/richfaces/component/UICalendar.java
===================================================================
--- trunk/sandbox/ui/calendar/src/main/java/org/richfaces/component/UICalendar.java 2007-07-24 18:19:02 UTC (rev 1832)
+++ trunk/sandbox/ui/calendar/src/main/java/org/richfaces/component/UICalendar.java 2007-07-24 18:20:16 UTC (rev 1833)
@@ -105,6 +105,12 @@
public abstract Object getWeekDayLabelsShort();
public abstract void setWeekDayLabelsShort(Object labels);
+ public abstract String getJointPoint();
+ public abstract void setJointPoint(String jointPoint);
+ public abstract String getDirection();
+ public abstract void setDirection(String direction);
+
+
// currentDate processing -------------------------------------------------
public String getValueAsString(FacesContext context, UIComponent component)
Modified: trunk/sandbox/ui/calendar/src/main/resources/org/richfaces/renderkit/html/scripts/calendar.js
===================================================================
--- trunk/sandbox/ui/calendar/src/main/resources/org/richfaces/renderkit/html/scripts/calendar.js 2007-07-24 18:19:02 UTC (rev 1832)
+++ trunk/sandbox/ui/calendar/src/main/resources/org/richfaces/renderkit/html/scripts/calendar.js 2007-07-24 18:20:16 UTC (rev 1833)
@@ -2,8 +2,84 @@
window.LOG = {warn:function(){}};
}
-//if (!window.Richfaces) window.Richfaces={};
+if (!Richfaces) Richfaces={};
+Richfaces.Calendar={};
+Richfaces.Calendar.setElementPosition = function(element, baseElement, jointPoint, direction, offset)
+{
+ var elementDim = {width: element.getWidth(), height: element.getHeight()};
+ var baseElementDim = {width: baseElement.getWidth(), height: baseElement.getHeight()};
+ var windowDim = Richfaces.Calendar.getWindowDimensions();
+ var windowOffset = Richfaces.Calendar.getWindowScrollOffset();
+
+ var baseOffset = Position.cumulativeOffset(baseElement);
+
+ // jointPoint Correction
+ var ox=0;
+ var oy=0;
+ if (jointPoint)
+ {
+ var jp = jointPoint.toLowerCase().split('-');
+ if (jp[0]=='bottom') oy=baseElementDim.height;
+ if (jp[1]=='right') ox=baseElementDim.width;
+ }
+
+ // direction Correction
+ if (direction)
+ {
+ var d = direction.toLowerCase().split('-');
+ if (d[0]=='top') oy-=elementDim.height;
+ if (d[1]=='left') ox-=elementDim.width;
+ }
+
+ element.style.left = baseOffset[0] + ox + 'px';
+ element.style.top = baseOffset[1] + oy + 'px';
+
+}
+Richfaces.Calendar.getWindowDimensions = function() {
+ var w = self.innerWidth
+ || document.documentElement.clientWidth
+ || document.body.clientWidth
+ || 0;
+ var h = self.innerHeight
+ || document.documentElement.clientHeight
+ || document.body.clientHeight
+ || 0;
+ return {width:w, height: h};
+}
+
+Richfaces.Calendar.getWindowScrollOffset = function() {
+ var dx = window.pageXOffset
+ || document.documentElement.scrollLeft
+ || document.body.scrollLeft
+ || 0;
+ var dy = window.pageYOffset
+ || document.documentElement.scrollTop
+ || document.body.scrollTop
+ || 0;
+ return {left:dx, top: dy};
+}
+
+/*Richfaces.Calendar.getPageDimensions = function() {
+ var x,y;
+ var test1 = document.body.scrollHeight;
+ var test2 = document.body.offsetHeight;
+ if (test1 > test2) {
+ // all but Explorer Mac
+ x = document.body.scrollWidth;
+ y = document.body.scrollHeight;
+ }
+ else {
+ // Explorer Mac;
+ // would also work in Explorer 6 Strict, Mozilla and Safari
+
+ x = document.body.offsetWidth;
+ y = document.body.offsetHeight;
+ }
+
+ return {width:x, height:y};
+}*/
+
Object.extend(Event, {
findElementByAttr : function(event, tagName, attribute, value, flag) {
var element = Event.findElement(event, tagName);
@@ -136,8 +212,9 @@
// showWeekDaysBar - show WeekDays Bar [default value is true]
// showWeeksBar - show Weeks numbers bar [default value is true]
+ // POPUP description
// direction - [top-left, top-right, bottom-left, bottom-right, auto]
- // jointPoint
+ // jointPoint - [top-left, top-right, bottom-left, bottom-right, auto]
// popup - true
// userClasses - inputClass, inputDisabledClass, inputInvalidClass, buttonClass, buttonDisabledClass
// id+PopupButton, id+PopupInput,
@@ -158,6 +235,7 @@
if (!this.params.footerMarkup) this.params.footerMarkup = CalendarView.footer;
this.currentDate = this.params.currentDate ? this.params.currentDate : new Date();
+ this.currentDate.setDate(1);
this.selectedDate = this.params.selectedDate;
this.todayDate = new Date();
@@ -169,10 +247,13 @@
this.calendarContext = new CalendarContext(this);
- /*this.ids = {
- currentYearMonthId: this.id+':currentyearmonth'
- };*/
+ this.DATE_ELEMENT_ID = this.params.dayListTableId+'Cell';
+ this.POPUP_ID = this.id+'Popup';
+ this.POPUP_BUTTON_ID = this.id+'PopupButton';
+ this.POPUP_INPUT_ID = this.id+'PopupInput';
+ this.firstDateIndex = 0;
+
this.daysData = {startDate:null, days:[]};
this.days = [];
@@ -184,8 +265,23 @@
var htmlFooterOptional = (this.params.footerOptionalMarkup) ? '<tr><td class="calendar_footer" colspan="'+colspan+'" id="'+this.id+'FooterOptional"></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';
+ var htmlTextFooter = '</tbody></table>\n'
+ 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';
+ e.style.left="0px";
+ e.style.top="0px";
+ this.isVisible = false;
+ }
+ }
+
// days bar creation
var styleClass;
var bottomStyleClass;
@@ -228,15 +324,12 @@
if (i==this.firstWeekendDayNumber || i==this.secondWeekendDayNumber) styleClass+=" calendar_holly";
if (i==6) styleClass+=" right_cell";
- htmlTextWeek+='<td class="'+styleClass+'" id="'+this.params.dayListTableId+'Cell'+p+'"></td>';
+ htmlTextWeek+='<td class="'+styleClass+'" id="'+this.DATE_ELEMENT_ID+p+'"></td>';
p++;
}
htmlTextWeek+='</tr>';
}
- // footer
-
-
// set content
var obj=$(id);
obj.component = this;
@@ -247,6 +340,29 @@
this.prepareEvents();
},
+ doCollapse: function() {
+ if (/*!this.params.popup || */!this.isVisible) return;
+
+ Element.hide(this.id);
+ this.isVisible = false;
+ },
+
+ doExpand: function() {
+ if (/*!this.params.popup || */this.isVisible) return;
+
+ var base = $(this.POPUP_ID);
+ var e = $(this.id);
+
+ Richfaces.Calendar.setElementPosition(e, base, this.params.jointPoint, this.params.direction);
+
+ Element.show(this.id);
+ this.isVisible = true;
+ },
+
+ doSwitch: function() {
+ this.isVisible ? this.doCollapse() : this.doExpand();
+ },
+
getWeekDayComponentId: function (v) {
return this.id+"WeekDay"+v;
},
@@ -258,7 +374,7 @@
getDateComponentId: function (v) {
return this.id+"Date"+v;
},
-
+
getCurrentDate: function() {
return this.currentDate;
},
@@ -328,11 +444,10 @@
},
eventCellOnClick: function (e) {
- var idstr = this.params.dayListTableId+'Cell';
- var obj = Event.findElementByAttr(e, "TD", "id", idstr, true);
+ var obj = Event.findElementByAttr(e, "TD", "id", this.DATE_ELEMENT_ID, true);
if (obj)
{
- var daydata = this.days[parseInt(obj.id.substr(idstr.length))];
+ var daydata = this.days[parseInt(obj.id.substr(this.DATE_ELEMENT_ID.length))];
if (daydata._month==0)
{
this.selectedDate=new Date(this.currentDate);
@@ -342,6 +457,7 @@
Element.addClassName(obj, "Selecteddayclass");
$(this.id+'InputSelectedDate').value=this.getSelectedDateString(this.params.datePattern);
+ this.renderHeader();
this.renderFooter();
} else {
if (daydata._month==-1) this.prevMonth(); else this.nextMonth();
@@ -350,21 +466,19 @@
},
eventCellOnMouseOver: function (e) {
- var idstr = this.params.dayListTableId+'Cell';
- var obj = Event.findElementByAttr(e, "TD", "id", idstr, true);
+ var obj = Event.findElementByAttr(e, "TD", "id", this.DATE_ELEMENT_ID, true);
if (obj)
{
- var daydata = this.days[parseInt(obj.id.substr(idstr.length))];
+ var daydata = this.days[parseInt(obj.id.substr(this.DATE_ELEMENT_ID.length))];
if (daydata._month==0 && Element.hasClassName(obj,daydata._className)) Element.replaceClassName(obj,daydata._className, daydata._hoverClassName);
}
},
eventCellOnMouseOut: function (e) {
- var idstr = this.params.dayListTableId+'Cell';
- var obj = Event.findElementByAttr(e, "TD", "id", idstr, true);
+ var obj = Event.findElementByAttr(e, "TD", "id", this.DATE_ELEMENT_ID, true);
if (obj)
{
- var daydata = this.days[parseInt(obj.id.substr(idstr.length))];
+ var daydata = this.days[parseInt(obj.id.substr(this.DATE_ELEMENT_ID.length))];
if (daydata._month==0 && Element.hasClassName(obj,daydata._hoverClassName)) Element.replaceClassName(obj,daydata._hoverClassName, daydata._className);
}
},
@@ -440,6 +554,8 @@
if (wd>0) while (dayCounter<=previousMonthDays) {this.days.push({day:dayCounter, _isWeekend: this.isWeekend(p), _month:month, _className:"Disableddayclass"}); dayCounter++; p++; }
dayCounter = 1;
month=0;
+
+ this.firstDateIndex = p;
// current month days
if (this.daysData && this.daysData.index[currentYear+'-'+currentMonth]!=undefined)
@@ -505,6 +621,11 @@
//var _d=new Date();
+ if (this.selectedDateElement) {
+ Element.classNames(this.selectedDateElement).remove("Selecteddayclass");
+ this.selectedDateElement = null;
+ }
+
for (var k=1;k<7;k++)
{
//
@@ -644,6 +765,32 @@
help: function() {
alert("Calendar help");
+ },
+
+ selectDate: function(date) {
+ if (date)
+ {
+ date = new Date(date);
+ if (this.selectedDate && this.selectedDate == date) return;
+ this.selectedDate = date;
+ }
+
+ if (this.selectedDate)
+ {
+ var d = new Date(this.selectedDate);
+ d.setDate(1);
+ if (d.getMonth()==this.currentDate.getMonth() && d.getFullYear()==this.currentDate.getFullYear())
+ {
+ // find cell and call onklick event
+ var e = $(this.DATE_ELEMENT_ID+(this.firstDateIndex + this.selectedDate.getDate()-1));
+ if (e) Richfaces.createEvent ('click', e).fire();
+ } else {
+ // change currentDate and call this.onUpdate();
+ this.currentDate = d;
+ this.onUpdate();
+
+ }
+ }
}
});
@@ -664,7 +811,7 @@
CalendarView.previousMonthControl = CalendarView.getControl("<", "prevMonth");
CalendarView.currentMonthControl = function (context) { return context.calendar.getCurrentDate().format("MMMM, y", context.monthLabels, context.monthLabelsShort);};
CalendarView.todayControl = CalendarView.getControl("Today", "today");
-CalendarView.selectedDateControl = function (context) { return CalendarView.getControl(context.calendar.getSelectedDateString(context.calendar.params.datePattern), "prevMonth");};
+CalendarView.selectedDateControl = function (context) { return CalendarView.getControl(context.calendar.getSelectedDateString(context.calendar.params.datePattern), "selectDate");};
CalendarView.helpControl = CalendarView.getControl("Help", "help");
CalendarView.header = [
@@ -706,7 +853,7 @@
[
new E('tr',{},
[
- new E('td',{'class': 'calendar_toolfooter', 'style': 'white-space:nowrap'},
+ new E('td',{'class': 'calendar_toolfooter calendar_btn', 'style': 'white-space:nowrap'},
[
new ET(function (context) { return Richfaces.evalMacro("selectedDateControl", context)})
]),
Modified: trunk/sandbox/ui/calendar/src/main/templates/org/richfaces/htmlCalendar.jspx
===================================================================
--- trunk/sandbox/ui/calendar/src/main/templates/org/richfaces/htmlCalendar.jspx 2007-07-24 18:19:02 UTC (rev 1832)
+++ trunk/sandbox/ui/calendar/src/main/templates/org/richfaces/htmlCalendar.jspx 2007-07-24 18:20:16 UTC (rev 1833)
@@ -9,11 +9,11 @@
baseclass="org.richfaces.renderkit.CalendarRendererBase"
component="org.richfaces.component.UICalendar">
<f:clientid var="clientId" />
- <h:scripts>new org.ajax4jsf.javascript.PrototypeScript(),new org.ajax4jsf.javascript.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:scripts>new org.ajax4jsf.javascript.PrototypeScript(),new org.ajax4jsf.javascript.AjaxScript(),/org/richfaces/renderkit/html/scripts/events.js,/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']}"
+ style="#{component.attributes['style']}"
class="#{component.attributes['styleClass']}"
x:passThruWithExclusions="value,name,type,id"><script
type="text/javascript">
@@ -28,6 +28,8 @@
currentDate: #{this:getCurrentDate(context, component)},
selectedDate: #{this:getSelectedDate(context, component)},
datePattern: '#{component.datePattern}',
+ jointPoint: '#{component.jointPoint}',
+ direction: '#{component.direction}',
<f:call name="writeSymbols" />,
firstWeekDay: #{this:getFirstWeekDay(context, component)},
minDaysInFirstWeek: #{this:getMinDaysInFirstWeek(context, component)},
@@ -74,7 +76,7 @@
class="#{component.attributes['class']}"
onclick="#{component.attributes['onclick']}">
</input>
- <button id="#{clientId}Button"
+ <button id="#{clientId}PopupButton"
accesskey="#{component.attributes['accesskey']}"
class="#{component.attributes['class']}"
name="#{clientId}"
17 years, 5 months
JBoss Rich Faces SVN: r1832 - trunk/ui/tooltip/src/main/resources/org/richfaces/renderkit/html/scripts.
by richfaces-svn-commits@lists.jboss.org
Author: dbiatenia
Date: 2007-07-24 14:19:02 -0400 (Tue, 24 Jul 2007)
New Revision: 1832
Modified:
trunk/ui/tooltip/src/main/resources/org/richfaces/renderkit/html/scripts/tooltip.js
Log:
positioning bugfix
Modified: trunk/ui/tooltip/src/main/resources/org/richfaces/renderkit/html/scripts/tooltip.js
===================================================================
--- trunk/ui/tooltip/src/main/resources/org/richfaces/renderkit/html/scripts/tooltip.js 2007-07-24 18:04:01 UTC (rev 1831)
+++ trunk/ui/tooltip/src/main/resources/org/richfaces/renderkit/html/scripts/tooltip.js 2007-07-24 18:19:02 UTC (rev 1832)
@@ -10,7 +10,10 @@
this.onshow = events.onshow;
this.oncomplete = events.oncomplete;
this.onhide = events.onhide;
+ this.delay = events.delay;
+ this.jsVarName = events.jsVarName;
+
this.id = id;
this.parentId = parentId;
this.mode = mode;
@@ -101,10 +104,8 @@
},
-
-
doShow: function(e){
-
+ //alert('IE=' + IE);
if(this.onshow){
eval(this.onshow);
}
@@ -124,10 +125,8 @@
var event = e;
eval(this.ajaxExecuteString);
}
- this.displayDiv(e);
- if(this.mode != 'ajax' && this.oncomplete){
- eval(this.oncomplete);
- }
+
+ setTimeout(this.jsVarName + '.displayDiv()', this.delay);
},
doHide: function(e){
@@ -144,10 +143,10 @@
}
this.hintParentElement = null;
this.isMouseOvered = false;
+ if(this.onhide){
+ eval(this.onhide);
+ }
}
- if(this.onhide){
- eval(this.onhide);
- }
},
doEnable: function(){
@@ -167,23 +166,75 @@
this.toolTipH = this.toolTip.getHeight();
this.toolTipW = this.toolTip.getWidth();
}
+/*
+ this.toolTip.style.display = 'block';
+
+ this.toolTip.style.top = cursorY;
+ this.toolTip.style.left = cursorX;
+*/
+ //var offsets = Position.cumulativeOffset(this.toolTip.parentNode);
+ var offsets = Position.cumulativeOffset(this.toolTip.parentNode);
- var offsets = Position.cumulativeOffset(this.parent);
+
+
+// offsets[0] -= this.toolTip.parentNode.offsetLeft || 0;
+// offsets[1] -= this.toolTip.parentNode.offsetTop || 0;
+//
+//
+ var toolTipX=0;
+ var toolTipY=0;
+ var p = Element.getStyle(this.toolTip.parentNode, 'position');
+
+ if (p == 'relative'){
+ toolTipX = cursorX - offsets[0];
+ toolTipY = cursorY - offsets[1];
+ //Element.setStyle(this.toolTip, {"left": - offsets[0] + cursorX + "px", "top": - offsets[1] + cursorY + "px"});
+ } else {
+ if(IE){
+
+ var cumOffset = this.cumCumOffset(this.toolTip.parentNode);
+ //Element.setStyle(this.toolTip, {"left": - cumOffset[0] + cursorX + "px", "top": - cumOffset[1] + cursorY + "px"});
+ toolTipX = cursorX - cumOffset[0];
+ toolTipY = cursorY - cumOffset[1];
+
+
+ //Element.setStyle(this.toolTip, {"left": Event.pointerX(e) + "px", "top": Event.pointerY(e) + "px"});
+ //Element.setStyle(this.toolTip, {"left": - offsets[0] + Event.pointerX(e) + "px", "top": - offsets[1] + Event.pointerY(e) + "px"});
+ } else {
+ toolTipX = cursorX;
+ toolTipY = cursorY;
+
+// this.toolTip.style.top = cursorY;
+// this.toolTip.style.left = cursorX;
+ }
+ }
+ //Element.setStyle(this.toolTip, {"left": toolTipX + "px", "top": toolTipY + "px"});
+
+//
+ //Element.setStyle(this.toolTip, {"left": offsets[0] + "px", "top": offsets[1] + "px"});
+/*
+ this.toolTip.style.top = cursorY;
+ this.toolTip.style.left = cursorX;
+
cursorX -= offsets[0];
cursorY -= offsets[1];
+
+ this.toolTip.style.top = cursorY;
+ this.toolTip.style.left = cursorX;
+
cursorX += this.parent.offsetLeft;
cursorY += this.parent.offsetTop;
this.toolTip.style.top = cursorY;
this.toolTip.style.left = cursorX;
-
+*/
if(this.direction == "top-left"){
- this.toolTip.style.top = cursorY - this.verticalOffset - this.toolTipH;
- this.toolTip.style.left = cursorX - this.horizontalOffset - this.toolTipW;
+ this.toolTip.style.top = toolTipY - this.verticalOffset - this.toolTipH;
+ this.toolTip.style.left = toolTipX - this.horizontalOffset - this.toolTipW;
/*
if(cursorY - this.verticalOffset - this.toolTipH < 0){
this.toolTip.style.top = cursorY + this.verticalOffset - this.toolTipH;
@@ -197,8 +248,8 @@
}
*/
} else if(this.direction == "bottom-left"){
- this.toolTip.style.top = cursorY + this.verticalOffset;
- this.toolTip.style.left = cursorX - this.horizontalOffset - this.toolTipW;
+ this.toolTip.style.top = toolTipY + this.verticalOffset;
+ this.toolTip.style.left = toolTipX - this.horizontalOffset - this.toolTipW;
/*
if(cursorY + this.verticalOffset + this.toolTipH > windowDim[1]){
this.toolTip.style.top = cursorY - this.verticalOffset - this.toolTipH;
@@ -212,8 +263,8 @@
}
*/
} else if(this.direction == "top-right"){
- this.toolTip.style.top = cursorY - this.verticalOffset - this.toolTipH;
- this.toolTip.style.left = cursorX + this.horizontalOffset;
+ this.toolTip.style.top = toolTipY - this.verticalOffset - this.toolTipH;
+ this.toolTip.style.left = toolTipX + this.horizontalOffset;
/*
if(cursorY - this.verticalOffset - this.toolTipH < 0){
this.toolTip.style.top = cursorY + this.verticalOffset;
@@ -228,8 +279,8 @@
*/
} else {
// bottom-right is default
- this.toolTip.style.top = cursorY + this.verticalOffset;
- this.toolTip.style.left = cursorX + this.horizontalOffset;
+ this.toolTip.style.top = toolTipY + this.verticalOffset;
+ this.toolTip.style.left = toolTipX + this.horizontalOffset;
/*
if(cursorY + this.verticalOffset - this.toolTip.clientHeight > windowDim[1]){
this.toolTip.style.top = cursorY - this.verticalOffset - this.toolTipH;
@@ -264,7 +315,7 @@
return [wWidth,wHeight];
},
- displayDiv: function(e){
+ displayDiv: function(){
if(this.isMouseOvered){
this.toolTip.style.display = "block";
if(this.iframe){
@@ -272,6 +323,21 @@
this.iframe.style.left = parseInt(this.toolTip.style.left) - this.toolTipBorderWidth;
this.iframe.style.display = "block";
}
+ if(this.mode != 'ajax' && this.oncomplete){
+ eval(this.oncomplete);
+ }
}
- }
+ },
+ cumCumOffset: function(element) {
+ var valueT = 0, valueL = 0;
+ do {
+ var p = Element.getStyle(element, 'position');
+ if (p == 'relative'){
+ valueT += element.offsetTop || 0;
+ valueL += element.offsetLeft || 0;
+ }
+ element = element.offsetParent;
+ } while (element);
+ return [valueL, valueT];
+ }
}
\ No newline at end of file
17 years, 5 months
JBoss Rich Faces SVN: r1831 - trunk/samples/richfaces-demo/src/main/webapp/images.
by richfaces-svn-commits@lists.jboss.org
Author: SergeySmirnov
Date: 2007-07-24 14:04:01 -0400 (Tue, 24 Jul 2007)
New Revision: 1831
Added:
trunk/samples/richfaces-demo/src/main/webapp/images/cn_actionParameter.gif
trunk/samples/richfaces-demo/src/main/webapp/images/cn_ajaxAttributes.gif
trunk/samples/richfaces-demo/src/main/webapp/images/cn_ajaxForm.gif
trunk/samples/richfaces-demo/src/main/webapp/images/cn_ajaxListener.gif
trunk/samples/richfaces-demo/src/main/webapp/images/cn_ajaxRegion.gif
trunk/samples/richfaces-demo/src/main/webapp/images/cn_ajaxSupport.gif
trunk/samples/richfaces-demo/src/main/webapp/images/cn_commandButton.gif
trunk/samples/richfaces-demo/src/main/webapp/images/cn_commandLink.gif
Log:
renaming
Copied: trunk/samples/richfaces-demo/src/main/webapp/images/cn_actionParameter.gif (from rev 1826, trunk/samples/richfaces-demo/src/main/webapp/images/cn_action_parameter.gif)
===================================================================
(Binary files differ)
Copied: trunk/samples/richfaces-demo/src/main/webapp/images/cn_ajaxAttributes.gif (from rev 1826, trunk/samples/richfaces-demo/src/main/webapp/images/cn_ajax_attributes.gif)
===================================================================
(Binary files differ)
Copied: trunk/samples/richfaces-demo/src/main/webapp/images/cn_ajaxForm.gif (from rev 1826, trunk/samples/richfaces-demo/src/main/webapp/images/cn_ajax_form.gif)
===================================================================
(Binary files differ)
Copied: trunk/samples/richfaces-demo/src/main/webapp/images/cn_ajaxListener.gif (from rev 1826, trunk/samples/richfaces-demo/src/main/webapp/images/cn_ajax_listener.gif)
===================================================================
(Binary files differ)
Copied: trunk/samples/richfaces-demo/src/main/webapp/images/cn_ajaxRegion.gif (from rev 1826, trunk/samples/richfaces-demo/src/main/webapp/images/cn_ajax_region.gif)
===================================================================
(Binary files differ)
Copied: trunk/samples/richfaces-demo/src/main/webapp/images/cn_ajaxSupport.gif (from rev 1826, trunk/samples/richfaces-demo/src/main/webapp/images/cn_ajax_support.gif)
===================================================================
(Binary files differ)
Copied: trunk/samples/richfaces-demo/src/main/webapp/images/cn_commandButton.gif (from rev 1826, trunk/samples/richfaces-demo/src/main/webapp/images/cn_command_button.gif)
===================================================================
(Binary files differ)
Copied: trunk/samples/richfaces-demo/src/main/webapp/images/cn_commandLink.gif (from rev 1826, trunk/samples/richfaces-demo/src/main/webapp/images/cn_command_link.gif)
===================================================================
(Binary files differ)
17 years, 5 months
JBoss Rich Faces SVN: r1830 - trunk/samples/richfaces-demo/src/main/webapp/images.
by richfaces-svn-commits@lists.jboss.org
Author: SergeySmirnov
Date: 2007-07-24 14:03:40 -0400 (Tue, 24 Jul 2007)
New Revision: 1830
Removed:
trunk/samples/richfaces-demo/src/main/webapp/images/cn_action_parameter.gif
trunk/samples/richfaces-demo/src/main/webapp/images/cn_ajax_attributes.gif
trunk/samples/richfaces-demo/src/main/webapp/images/cn_ajax_form.gif
trunk/samples/richfaces-demo/src/main/webapp/images/cn_ajax_listener.gif
trunk/samples/richfaces-demo/src/main/webapp/images/cn_ajax_region.gif
trunk/samples/richfaces-demo/src/main/webapp/images/cn_ajax_support.gif
trunk/samples/richfaces-demo/src/main/webapp/images/cn_command_button.gif
trunk/samples/richfaces-demo/src/main/webapp/images/cn_command_link.gif
Log:
renaming
Deleted: trunk/samples/richfaces-demo/src/main/webapp/images/cn_action_parameter.gif
===================================================================
(Binary files differ)
Deleted: trunk/samples/richfaces-demo/src/main/webapp/images/cn_ajax_attributes.gif
===================================================================
(Binary files differ)
Deleted: trunk/samples/richfaces-demo/src/main/webapp/images/cn_ajax_form.gif
===================================================================
(Binary files differ)
Deleted: trunk/samples/richfaces-demo/src/main/webapp/images/cn_ajax_listener.gif
===================================================================
(Binary files differ)
Deleted: trunk/samples/richfaces-demo/src/main/webapp/images/cn_ajax_region.gif
===================================================================
(Binary files differ)
Deleted: trunk/samples/richfaces-demo/src/main/webapp/images/cn_ajax_support.gif
===================================================================
(Binary files differ)
Deleted: trunk/samples/richfaces-demo/src/main/webapp/images/cn_command_button.gif
===================================================================
(Binary files differ)
Deleted: trunk/samples/richfaces-demo/src/main/webapp/images/cn_command_link.gif
===================================================================
(Binary files differ)
17 years, 5 months
JBoss Rich Faces SVN: r1829 - in trunk/sandbox/ui/message/src/main: java/org/richfaces/component and 2 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: abelevich
Date: 2007-07-24 13:56:41 -0400 (Tue, 24 Jul 2007)
New Revision: 1829
Added:
trunk/sandbox/ui/message/src/main/java/org/richfaces/component/UIRichMessages.java
trunk/sandbox/ui/message/src/main/java/org/richfaces/renderkit/html/RichMessagesHtmlBaseRenderer.java
trunk/sandbox/ui/message/src/main/resources/org/richfaces/renderkit/html/css/msgs.css
Modified:
trunk/sandbox/ui/message/src/main/config/component/message.xml
trunk/sandbox/ui/message/src/main/java/org/richfaces/renderkit/html/RichMessageBaseRenderer.java
trunk/sandbox/ui/message/src/main/java/org/richfaces/renderkit/html/RichMessageHtmlBaseRenderer.java
Log:
add new component richfaces messages, move renderLabel and renderMarker methods to RichMessageBaseRenderer.java
Modified: trunk/sandbox/ui/message/src/main/config/component/message.xml
===================================================================
--- trunk/sandbox/ui/message/src/main/config/component/message.xml 2007-07-24 17:14:02 UTC (rev 1828)
+++ trunk/sandbox/ui/message/src/main/config/component/message.xml 2007-07-24 17:56:41 UTC (rev 1829)
@@ -137,11 +137,16 @@
</property>
<property>
- <name>MarkerClass</name>
+ <name>markerClass</name>
<classname>java.lang.String</classname>
- </property>
+ </property>
<property>
+ <name>markerStyle</name>
+ <classname>java.lang.String</classname>
+ </property>
+
+ <property>
<name>errorLabelClass</name>
<classname>java.lang.String</classname>
</property>
@@ -162,7 +167,7 @@
</property>
<property>
- <name>LabelClass</name>
+ <name>labelClass</name>
<classname>java.lang.String</classname>
</property>
@@ -173,5 +178,206 @@
&ui_component_attributes;
</component>
+
+ <component>
+ <name>org.richfaces.component.RichMessages</name>
+ <family>org.richfaces.component.RichMessages</family>
+ <classname>
+ org.richfaces.component.html.HtmlRichMessages
+ </classname>
+ <superclass>org.richfaces.component.UIRichMessages</superclass>
+
+ <test>
+ <classname>org.richfaces.component.html.HtmlRichMessagesTest</classname>
+ <superclassname>org.ajax4jsf.tests.AbstractAjax4JsfTestCase</superclassname>
+ </test>
+ <description>
+ <![CDATA[ richfaces Messages Component ]]>
+ </description>
+
+ <renderer generate="false" override="true">
+ <name>org.richfaces.renderkit.html.RichMessagesBaseRenderer</name>
+ <classname>org.richfaces.renderkit.html.RichMessagesHtmlBaseRenderer</classname>
+ <superclass>org.richfaces.renderkit.html.RichMessageBaseRenderer</superclass>
+ </renderer>
+
+ <tag>
+ <name>messages</name>
+ <classname>org.richfaces.taglib.RichMessagesTag</classname>
+ <superclass>
+ org.ajax4jsf.webapp.taglib.HtmlComponentTagBase
+ </superclass>
+
+ <test>
+ <classname>org.richfaces.taglib.RichMessagesTagTest</classname>
+ <superclassname>org.ajax4jsf.tests.AbstractAjax4JsfTestCase</superclassname>
+ </test>
+ </tag>
+
+ <property attachedstate="true">
+ <name>passedLabel</name>
+ <classname>java.lang.String</classname>
+ <defaultvalue>"passed"</defaultvalue>
+ <description>
+ Attribute should define the label to be displayed when no message appears
+ </description>
+ </property>
+
+ <property>
+ <name>var</name>
+ <classname>java.lang.String</classname>
+ </property>
+
+ <property>
+ <name>layout</name>
+ <classname>java.lang.String</classname>
+ <defaultvalue>"List"</defaultvalue>
+ </property>
+
+ <property>
+ <name>headerLocation</name>
+ <classname>java.lang.String</classname>
+ </property>
+
+ <property>
+ <name>globalOnly</name>
+ <classname>boolean</classname>
+ <defaultvalue>false</defaultvalue>
+ </property>
+
+ <property>
+ <name>showDetail</name>
+ <classname>boolean</classname>
+ <defaultvalue>true</defaultvalue>
+ </property>
+
+ <property>
+ <name>showSummary</name>
+ <classname>boolean</classname>
+ <defaultvalue>false</defaultvalue>
+ </property>
+
+ <property>
+ <name>title</name>
+ <classname>java.lang.String</classname>
+ </property>
+
+ <property>
+ <name>tooltip</name>
+ <classname>boolean</classname>
+ </property>
+
+ <property>
+ <name>headerClass</name>
+ <classname>java.lang.String</classname>
+ </property>
+
+ <property>
+ <name>headerStyle</name>
+ <classname>java.lang.String</classname>
+ </property>
+
+ <property>
+ <name>errorClass</name>
+ <classname>java.lang.String</classname>
+ </property>
+
+ <property>
+ <name>fatalClass</name>
+ <classname>java.lang.String</classname>
+ </property>
+
+ <property>
+ <name>infoClass</name>
+ <classname>java.lang.String</classname>
+ </property>
+
+ <property>
+ <name>styleClass</name>
+ <classname>java.lang.String</classname>
+ </property>
+
+ <property>
+ <name>style</name>
+ <classname>java.lang.String</classname>
+ </property>
+ <property>
+ <name>warnClass</name>
+ <classname>java.lang.String</classname>
+ </property>
+
+ <property>
+ <name>errorMarkerClass</name>
+ <classname>java.lang.String</classname>
+ </property>
+
+ <property>
+ <name>warnClass</name>
+ <classname>java.lang.String</classname>
+ </property>
+
+ <property>
+ <name>errorMarkerClass</name>
+ <classname>java.lang.String</classname>
+ </property>
+
+ <property>
+ <name>fatalMarkerClass</name>
+ <classname>java.lang.String</classname>
+ </property>
+
+ <property>
+ <name>infoMarkerClass</name>
+ <classname>java.lang.String</classname>
+ </property>
+
+ <property>
+ <name>warnMarkerClass</name>
+ <classname>java.lang.String</classname>
+ </property>
+
+ <property>
+ <name>markerClass</name>
+ <classname>java.lang.String</classname>
+ </property>
+
+ <property>
+ <name>markerStyle</name>
+ <classname>java.lang.String</classname>
+ </property>
+
+ <property>
+ <name>errorLabelClass</name>
+ <classname>java.lang.String</classname>
+ </property>
+
+ <property>
+ <name>fatalLabelClass</name>
+ <classname>java.lang.String</classname>
+ </property>
+
+ <property>
+ <name>infoLabelClass</name>
+ <classname>java.lang.String</classname>
+ </property>
+
+ <property>
+ <name>warnLabelClass</name>
+ <classname>java.lang.String</classname>
+ </property>
+
+ <property>
+ <name>labelClass</name>
+ <classname>java.lang.String</classname>
+ </property>
+
+ <property attachedstate="true" hidden="true">
+ <name>binding</name>
+ <classname>javax.faces.component.UIComponent</classname>
+ </property>
+
+ &ui_component_attributes;
+ </component>
+
</components>
\ No newline at end of file
Added: trunk/sandbox/ui/message/src/main/java/org/richfaces/component/UIRichMessages.java
===================================================================
--- trunk/sandbox/ui/message/src/main/java/org/richfaces/component/UIRichMessages.java (rev 0)
+++ trunk/sandbox/ui/message/src/main/java/org/richfaces/component/UIRichMessages.java 2007-07-24 17:56:41 UTC (rev 1829)
@@ -0,0 +1,42 @@
+/**
+ *
+ */
+package org.richfaces.component;
+
+import javax.faces.component.UIMessages;
+
+import org.ajax4jsf.component.AjaxOutput;
+
+/**
+ * @author Anton Belevich
+ *
+ */
+public abstract class UIRichMessages extends UIMessages implements AjaxOutput {
+
+ private boolean wroteTable = false;
+
+
+ public boolean isWroteTable() {
+ return wroteTable;
+ }
+
+ public void setWroteTable(boolean wroteTable) {
+ this.wroteTable = wroteTable;
+ }
+
+ /* (non-Javadoc)
+ * @see org.ajax4jsf.component.AjaxOutput#isAjaxRendered()
+ */
+ public boolean isAjaxRendered() {
+ return true;
+ }
+
+ /* (non-Javadoc)
+ * @see org.ajax4jsf.component.AjaxOutput#setAjaxRendered(boolean)
+ */
+ public void setAjaxRendered(boolean ajaxRendered) {
+ if(!ajaxRendered){
+ new IllegalArgumentException();
+ }
+ }
+}
Modified: trunk/sandbox/ui/message/src/main/java/org/richfaces/renderkit/html/RichMessageBaseRenderer.java
===================================================================
--- trunk/sandbox/ui/message/src/main/java/org/richfaces/renderkit/html/RichMessageBaseRenderer.java 2007-07-24 17:14:02 UTC (rev 1828)
+++ trunk/sandbox/ui/message/src/main/java/org/richfaces/renderkit/html/RichMessageBaseRenderer.java 2007-07-24 17:56:41 UTC (rev 1829)
@@ -4,17 +4,19 @@
import java.util.Iterator;
import java.util.List;
+import javax.faces.application.FacesMessage;
+import javax.faces.application.FacesMessage.Severity;
import javax.faces.component.NamingContainer;
import javax.faces.component.UIComponent;
-import javax.faces.component.UIMessage;
import javax.faces.context.FacesContext;
+import javax.faces.context.ResponseWriter;
import org.ajax4jsf.renderkit.HeaderResourcesRendererBase;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
-public class RichMessageBaseRenderer extends HeaderResourcesRendererBase{
+public abstract class RichMessageBaseRenderer extends HeaderResourcesRendererBase{
protected static final Log log = LogFactory.getLog(RichMessageHtmlBaseRenderer.class);
@@ -43,6 +45,114 @@
return msgIter;
}
+ protected void renderMarkerFacet(UIComponent uiMsg, FacesContext context, ResponseWriter writer,FacesMessage facesMsg) throws IOException{
+
+ UIComponent marker = null;
+
+ String markerClass = null;
+
+ String markerStyle = null;
+
+ Severity severity = null;
+
+
+ if(facesMsg != null){
+
+ severity = facesMsg.getSeverity();
+
+ if(severity == FacesMessage.SEVERITY_ERROR){
+
+ markerClass = (String)uiMsg.getAttributes().get("errorMarkerClass");
+ markerStyle = (String)uiMsg.getAttributes().get("errorMarkerStyle");
+ marker = uiMsg.getFacet("errorMarker");
+
+ }else if (severity == FacesMessage.SEVERITY_FATAL) {
+
+ markerClass = (String)uiMsg.getAttributes().get("fatalMarkerClass");
+ markerStyle = (String)uiMsg.getAttributes().get("fatalMarkerStyle");
+ marker = uiMsg.getFacet("fatalMarker");
+
+ }else if (severity == FacesMessage.SEVERITY_INFO) {
+
+ markerClass = (String)uiMsg.getAttributes().get("infoMarkerClass");
+ markerStyle = (String)uiMsg.getAttributes().get("infoMarkerStyle");
+ marker = uiMsg.getFacet("infoMarker");
+
+ }else if (severity == FacesMessage.SEVERITY_WARN) {
+
+ markerClass = (String)uiMsg.getAttributes().get("warnMarkerClass");
+ markerStyle = (String)uiMsg.getAttributes().get("warnMarkerStyle");
+ marker = uiMsg.getFacet("infoMarker");
+
+ }
+
+ }else if(uiMsg.getFacet("passedMarker") != null){
+
+ marker = uiMsg.getFacet("passedMarker");
+ markerClass = (String) uiMsg.getAttributes().get("markerClass");
+ markerStyle = (String) uiMsg.getAttributes().get("markerStyle");
+
+ }
+
+ if(marker == null){
+ return;
+ }
+
+ if(!marker.isRendered()){
+ return;
+ }
+
+ renderMarkerHtml(uiMsg, marker, context, writer, markerClass, markerStyle);
+ }
+
+ protected void renderLabel(UIComponent component, FacesContext context, ResponseWriter writer,FacesMessage facesMsg) throws IOException{
+
+ String labelClass = null;
+
+ String labelStyle = null;
+
+ String passLabel = null;
+
+ Severity severity = null;
+
+
+ if(facesMsg != null){
+
+ severity = facesMsg.getSeverity();
+
+ if(severity == FacesMessage.SEVERITY_ERROR){
+
+ labelClass = (String)component.getAttributes().get("errorLabelClass");
+ labelStyle = (String)component.getAttributes().get("errorLabelStyle");
+
+ }else if(severity == FacesMessage.SEVERITY_FATAL){
+
+ labelClass = (String)component.getAttributes().get("fatalLabelClass");
+ labelStyle = (String)component.getAttributes().get("fatalLabelStyle");
+
+ }else if(severity == FacesMessage.SEVERITY_WARN){
+
+ labelClass = (String)component.getAttributes().get("warnLabelClass");
+ labelStyle = (String)component.getAttributes().get("warnLabelStyle");
+
+ }else if(severity == FacesMessage.SEVERITY_INFO){
+
+ labelClass = (String)component.getAttributes().get("infoLabelClass");
+ labelStyle = (String)component.getAttributes().get("infoLabelStyle");
+
+ }
+
+ }else if(component.getAttributes().get("passedLabel") != null){
+
+ passLabel = (String) component.getAttributes().get("passedLabel");
+ labelClass = (String) component.getAttributes().get("labelClass");
+ labelStyle = (String) component.getAttributes().get("labelStyle");
+
+ }
+
+ renderLabelHtml(component, context, writer, facesMsg, labelClass, labelStyle, passLabel);
+ }
+
protected UIComponent findForComponent(FacesContext context, String forClientId, UIComponent component) throws IOException{
if(null == forClientId || forClientId.length() == 0){
@@ -104,9 +214,9 @@
return retComp;
};
- protected Class getComponentClass() {
+ public abstract void renderMarkerHtml(UIComponent component, UIComponent markerFacet, FacesContext context, ResponseWriter writer,
+ String markerClass, String markerStyle) throws IOException;
- return UIMessage.class;
- }
-
+ public abstract void renderLabelHtml(UIComponent component, FacesContext context, ResponseWriter writer,
+ FacesMessage facesMsg, String labelClass, String labelStyle, String passLabel) throws IOException;
}
Modified: trunk/sandbox/ui/message/src/main/java/org/richfaces/renderkit/html/RichMessageHtmlBaseRenderer.java
===================================================================
--- trunk/sandbox/ui/message/src/main/java/org/richfaces/renderkit/html/RichMessageHtmlBaseRenderer.java 2007-07-24 17:14:02 UTC (rev 1828)
+++ trunk/sandbox/ui/message/src/main/java/org/richfaces/renderkit/html/RichMessageHtmlBaseRenderer.java 2007-07-24 17:56:41 UTC (rev 1829)
@@ -2,10 +2,12 @@
import java.io.IOException;
import java.util.Iterator;
+import java.util.Set;
import javax.faces.application.FacesMessage;
import javax.faces.application.FacesMessage.Severity;
import javax.faces.component.UIComponent;
+import javax.faces.component.UIMessage;
import javax.faces.context.FacesContext;
import javax.faces.context.ResponseWriter;
@@ -25,30 +27,33 @@
private InternetResource[] stylesAll = null;
- protected InternetResource[] getStyles() {
- synchronized (this) {
- if (stylesAll == null) {
+ protected InternetResource[] getStyles(){
+ synchronized (this){
+ if(stylesAll == null){
+
InternetResource[] rsrcs = super.getStyles();
boolean ignoreSuper = rsrcs == null || rsrcs.length == 0;
boolean ignoreThis = styles == null || styles.length == 0;
- if (ignoreSuper) {
+ if(ignoreSuper){
+
if (ignoreThis) {
stylesAll = new InternetResource[0];
} else {
stylesAll = styles;
}
- } else {
- if (ignoreThis) {
+
+ }else{
+ if(ignoreThis){
stylesAll = rsrcs;
- } else {
- java.util.Set rsrcsSet = new java.util.LinkedHashSet();
+ }else{
+ Set rsrcsSet = new java.util.LinkedHashSet();
- for (int i = 0; i < rsrcs.length; i++ ) {
+ for(int i = 0; i < rsrcs.length; i++ ){
rsrcsSet.add(rsrcs[i]);
}
- for (int i = 0; i < styles.length; i++ ) {
+ for(int i = 0; i < styles.length; i++ ){
rsrcsSet.add(styles[i]);
}
@@ -61,28 +66,11 @@
return stylesAll;
}
- public void encodeEnd(FacesContext context, UIComponent component) throws IOException {
+
+ protected void doEncodeEnd(ResponseWriter writer, FacesContext context, UIComponent component) throws IOException {
Iterator msgIter = null;
- if(component == null || context == null){
- throw new NullPointerException(NULL_PARAMETER_ERROR_MESSAGE);
- }
-
- if(log.isTraceEnabled()){
- log.trace("begin encoding component: " + component.getId());
- }
-
- if (!component.isRendered()){
-
- if(log.isTraceEnabled()){
- log.trace("stop encoding component: "
- + component.getId() + " 'rendered' attribute is set to false");
- }
-
- return;
- }
-
UIRichMessage msgComponent = (UIRichMessage)component;
String forClientId = msgComponent.getFor();
@@ -95,8 +83,7 @@
}else{
msgIter = getMessageIterator(context, forClientId, msgComponent);
- ResponseWriter writer = context.getResponseWriter();
-
+
if(!msgIter.hasNext() && msgComponent.isPassed()){
encodingUIContent(msgComponent, context, null);
@@ -107,12 +94,9 @@
encodingUIContent(msgComponent, context, message);
}
-
- doEncodeEnd(writer, context, msgComponent);
-
}
}
-
+
protected void encodingUIContent(UIRichMessage uiMsg, FacesContext context, FacesMessage facesMsg) throws IOException{
ResponseWriter writer = context.getResponseWriter();
@@ -129,110 +113,55 @@
protected void renderOuterStyle(UIRichMessage uiMsg, FacesContext context, ResponseWriter writer,FacesMessage facesMsg) throws IOException{
- String outerClass = null;
+ String outerClass = null;
- String outerStyle = null;
+ String outerStyle = null;
- Severity severity = null;
+ Severity severity = null;
- if(facesMsg != null){
+ if(facesMsg != null){
- severity = facesMsg.getSeverity();
-
- if(severity == FacesMessage.SEVERITY_ERROR){
+ severity = facesMsg.getSeverity();
+ if(severity == FacesMessage.SEVERITY_ERROR){
- outerClass = (String)uiMsg.getAttributes().get("errorClass");
- outerStyle = (String)uiMsg.getAttributes().get("errorStyle");
+ outerClass = (String)uiMsg.getAttributes().get("errorClass");
+ outerStyle = (String)uiMsg.getAttributes().get("errorStyle");
- }else if(severity == FacesMessage.SEVERITY_FATAL){
+ }else if(severity == FacesMessage.SEVERITY_FATAL){
- outerClass = (String)uiMsg.getAttributes().get("fatalClass");
- outerStyle = (String)uiMsg.getAttributes().get("fatalStyle");
+ outerClass = (String)uiMsg.getAttributes().get("fatalClass");
+ outerStyle = (String)uiMsg.getAttributes().get("fatalStyle");
- }else if(severity == FacesMessage.SEVERITY_WARN){
+ }else if(severity == FacesMessage.SEVERITY_WARN){
- outerClass = (String)uiMsg.getAttributes().get("warnClass");
- outerStyle = (String)uiMsg.getAttributes().get("warnStyle");
+ outerClass = (String)uiMsg.getAttributes().get("warnClass");
+ outerStyle = (String)uiMsg.getAttributes().get("warnStyle");
- }else if(severity == FacesMessage.SEVERITY_INFO){
+ }else if(severity == FacesMessage.SEVERITY_INFO){
- outerClass = (String)uiMsg.getAttributes().get("infoClass");
- outerStyle = (String)uiMsg.getAttributes().get("infoStyle");
- }
- }
+ outerClass = (String)uiMsg.getAttributes().get("infoClass");
+ outerStyle = (String)uiMsg.getAttributes().get("infoStyle");
+ }
+ }
- String parentStyle = (String)uiMsg.getAttributes().get("style");
- String parentClass = (String)uiMsg.getAttributes().get("styleClass");
+ String parentStyle = (String)uiMsg.getAttributes().get("style");
+ String parentClass = (String)uiMsg.getAttributes().get("styleClass");
- String richMessageClass = "rich-message" + (null != outerClass ? (outerClass + " ") : "");
- String richMessageStyle = (null != outerStyle ? outerClass + " ," : "");
+ String richMessageClass = "rich-message" + (null != outerClass ? (outerClass + " ") : "");
+ String richMessageStyle = (null != outerStyle ? outerClass + " ," : "");
- parentStyle = parentStyle != null ? (richMessageStyle + parentStyle) : richMessageStyle;
- parentClass = parentClass != null ? (richMessageClass + parentClass) : richMessageClass;
+ parentStyle = parentStyle != null ? (richMessageStyle + parentStyle) : richMessageStyle;
+ parentClass = parentClass != null ? (richMessageClass + parentClass) : richMessageClass;
- getUtils().writeAttribute(writer, HTML.class_ATTRIBUTE, parentClass);
- getUtils().writeAttribute(writer, HTML.style_ATTRIBUTE, parentStyle);
-
+ getUtils().writeAttribute(writer, HTML.class_ATTRIBUTE, parentClass);
+ getUtils().writeAttribute(writer, HTML.style_ATTRIBUTE, parentStyle);
+
}
- protected void renderMarkerFacet(UIRichMessage uiMsg, FacesContext context, ResponseWriter writer,FacesMessage facesMsg) throws IOException{
-
- UIComponent marker = null;
+ public void renderMarkerHtml(UIComponent uiMsg,UIComponent marker, FacesContext context,
+ ResponseWriter writer,String markerClass, String markerStyle) throws IOException{
- String markerClass = null;
-
- String markerStyle = null;
-
- Severity severity = null;
-
-
- if(facesMsg != null){
-
- severity = facesMsg.getSeverity();
-
- if(severity == FacesMessage.SEVERITY_ERROR){
-
- markerClass = (String)uiMsg.getAttributes().get("errorMarkerClass");
- markerStyle = (String)uiMsg.getAttributes().get("errorMarkerStyle");
- marker = uiMsg.getFacet("errorMarker");
-
- }else if (severity == FacesMessage.SEVERITY_FATAL) {
-
- markerClass = (String)uiMsg.getAttributes().get("fatalMarkerClass");
- markerStyle = (String)uiMsg.getAttributes().get("fatalMarkerStyle");
- marker = uiMsg.getFacet("fatalMarker");
-
- }else if (severity == FacesMessage.SEVERITY_INFO) {
-
- markerClass = (String)uiMsg.getAttributes().get("infoMarkerClass");
- markerStyle = (String)uiMsg.getAttributes().get("infoMarkerStyle");
- marker = uiMsg.getFacet("infoMarker");
-
- }else if (severity == FacesMessage.SEVERITY_WARN) {
-
- markerClass = (String)uiMsg.getAttributes().get("warnMarkerClass");
- markerStyle = (String)uiMsg.getAttributes().get("warnMarkerStyle");
- marker = uiMsg.getFacet("infoMarker");
-
- }
-
- }else if(uiMsg.getFacet("passedMarker") != null){
-
- marker = uiMsg.getFacet("passedMarker");
- markerClass = (String) uiMsg.getAttributes().get("markerClass");
- markerStyle = (String) uiMsg.getAttributes().get("markerStyle");
-
- }
-
- if(marker == null){
- return;
- }
-
- if(!marker.isRendered()){
- return;
- }
-
writer.startElement(HTML.SPAN_ELEM, uiMsg);
String classes = markerClass == null ? "rich-message-marker" : "rich-message-marker " + markerClass;
@@ -243,111 +172,74 @@
renderChild(context, marker);
writer.endElement(HTML.SPAN_ELEM);
-
+
}
- protected void renderLabel(UIRichMessage uiMsg, FacesContext context, ResponseWriter writer,FacesMessage facesMsg) throws IOException{
+ public void renderLabelHtml(UIComponent component, FacesContext context, ResponseWriter writer,
+ FacesMessage facesMsg, String labelClass, String labelStyle, String passLabel) throws IOException{
+
+ String summary = null;
- String summary = null;
-
- String detail = null;
-
- String labelClass = null;
-
- String labelStyle = null;
-
- String passLabel = null;
-
- Severity severity = null;
-
- String title = null;
-
- boolean isTooltip = getUtils().isBooleanAttribute(uiMsg, "tooltip");
-
- boolean showSummary = uiMsg.isShowSummary();
+ String detail = null;
- boolean showDetail = uiMsg.isShowDetail();
-
- boolean isPassLabel = false;
-
-
- if(facesMsg != null){
-
- severity = facesMsg.getSeverity();
+ String title = null;
+
+ UIRichMessage uiMsg = (UIRichMessage)component;
+
+ boolean isTooltip = getUtils().isBooleanAttribute(uiMsg, "tooltip");
+ boolean showSummary = uiMsg.isShowSummary();
+
+ boolean showDetail = uiMsg.isShowDetail();
+
+
+ if(facesMsg != null){
+ summary = (null != (summary = facesMsg.getSummary())) ? summary : "";
+ detail = (null != (detail = facesMsg.getDetail())) ? detail : "";
+ }
- if(severity == FacesMessage.SEVERITY_ERROR){
-
- labelClass = (String)uiMsg.getAttributes().get("errorLabelClass");
- labelStyle = (String)uiMsg.getAttributes().get("errorLabelStyle");
-
- }else if(severity == FacesMessage.SEVERITY_FATAL){
-
- labelClass = (String)uiMsg.getAttributes().get("fatalLabelClass");
- labelStyle = (String)uiMsg.getAttributes().get("fatalLabelStyle");
-
- }else if(severity == FacesMessage.SEVERITY_WARN){
-
- labelClass = (String)uiMsg.getAttributes().get("warnLabelClass");
- labelStyle = (String)uiMsg.getAttributes().get("warnLabelStyle");
-
- }else if(severity == FacesMessage.SEVERITY_INFO){
-
- labelClass = (String)uiMsg.getAttributes().get("infoLabelClass");
- labelStyle = (String)uiMsg.getAttributes().get("infoLabelStyle");
-
+ String classes = labelClass == null ? "rich-message-label" : "rich-message-label " + labelClass;
+
+ writer.startElement(HTML.SPAN_ELEM, uiMsg);
+
+ getUtils().writeAttribute(writer, HTML.class_ATTRIBUTE,classes);
+ getUtils().writeAttribute(writer, HTML.style_ATTRIBUTE, labelStyle);
+
+ if(facesMsg != null){
+ if(isTooltip){
+ title = (String) uiMsg.getAttributes().get("title");
+ if(title != null){
+ getUtils().writeAttribute(writer, HTML.title_ATTRIBUTE, title);
+ }else{
+ getUtils().writeAttribute(writer, HTML.title_ATTRIBUTE, summary);
+ }
}
- }else if(uiMsg.getPassedLabel() != null){
+ if(showDetail){
+ writer.writeText(detail, null);
+ writer.writeText("\t", null);
+ }
+
+ if(showSummary){
+ writer.writeText(summary, null);
+ writer.writeText("\t", null);
+ }
+ }else {
+
+ if(passLabel != null){
+ writer.writeText(passLabel, null);
+ writer.writeText("\t", null);
+ }
+
+ }
+
+ writer.endElement(HTML.SPAN_ELEM);
- passLabel = (String) uiMsg.getPassedLabel();
- labelClass = (String) uiMsg.getAttributes().get("labelClass");
- labelStyle = (String) uiMsg.getAttributes().get("labelStyle");
- isPassLabel = true;
-
- }
-
- if(facesMsg != null){
- summary = (null != (summary = facesMsg.getSummary())) ? summary : "";
- detail = (null != (detail = facesMsg.getDetail())) ? detail : "";
- }
-
-
- String classes = labelClass == null ? "rich-message-label" : "rich-message-label " + labelClass;
-
- writer.startElement(HTML.SPAN_ELEM, uiMsg);
-
- getUtils().writeAttribute(writer, HTML.class_ATTRIBUTE,classes);
- getUtils().writeAttribute(writer, HTML.style_ATTRIBUTE, labelStyle);
+ }
- if(facesMsg != null){
- if(isTooltip){
- title = (String) uiMsg.getAttributes().get("title");
- if(title != null){
- getUtils().writeAttribute(writer, HTML.title_ATTRIBUTE, title);
- }else{
- getUtils().writeAttribute(writer, HTML.title_ATTRIBUTE, summary);
- }
- }
-
- if(showDetail){
- writer.writeText(detail, null);
- writer.writeText("\t", null);
- }
-
- if(showSummary){
- writer.writeText(summary, null);
- writer.writeText("\t", null);
- }
- }else {
- if(isPassLabel){
- writer.writeText(passLabel, null);
- writer.writeText("\t", null);
- }
- }
-
- writer.endElement(HTML.SPAN_ELEM);
-
+ protected Class getComponentClass() {
+
+ return UIMessage.class;
}
}
\ No newline at end of file
Added: trunk/sandbox/ui/message/src/main/java/org/richfaces/renderkit/html/RichMessagesHtmlBaseRenderer.java
===================================================================
--- trunk/sandbox/ui/message/src/main/java/org/richfaces/renderkit/html/RichMessagesHtmlBaseRenderer.java (rev 0)
+++ trunk/sandbox/ui/message/src/main/java/org/richfaces/renderkit/html/RichMessagesHtmlBaseRenderer.java 2007-07-24 17:56:41 UTC (rev 1829)
@@ -0,0 +1,247 @@
+/**
+ *
+ */
+package org.richfaces.renderkit.html;
+
+import java.io.IOException;
+import java.util.Iterator;
+import java.util.Set;
+
+import javax.faces.application.FacesMessage;
+import javax.faces.component.UIComponent;
+import javax.faces.component.UIMessages;
+import javax.faces.context.FacesContext;
+import javax.faces.context.ResponseWriter;
+
+import org.ajax4jsf.renderkit.RendererUtils.HTML;
+import org.ajax4jsf.resource.InternetResource;
+import org.richfaces.component.UIRichMessage;
+import org.richfaces.component.UIRichMessages;
+
+/**
+ * @author Anton Belevich
+ *
+ */
+public class RichMessagesHtmlBaseRenderer extends RichMessageBaseRenderer {
+
+ private final InternetResource[] styles = {getResource("/org/richfaces/renderkit/html/css/msgs.css")};
+
+ private InternetResource[] stylesAll = null;
+
+
+ protected InternetResource[] getStyles(){
+ synchronized (this){
+ if(stylesAll == null){
+
+ InternetResource[] rsrcs = super.getStyles();
+ boolean ignoreSuper = rsrcs == null || rsrcs.length == 0;
+ boolean ignoreThis = styles == null || styles.length == 0;
+
+ if(ignoreSuper){
+
+ if (ignoreThis) {
+ stylesAll = new InternetResource[0];
+ } else {
+ stylesAll = styles;
+ }
+
+ }else{
+ if(ignoreThis){
+ stylesAll = rsrcs;
+ }else{
+ Set rsrcsSet = new java.util.LinkedHashSet();
+
+ for(int i = 0; i < rsrcs.length; i++ ){
+ rsrcsSet.add(rsrcs[i]);
+ }
+
+ for(int i = 0; i < styles.length; i++ ){
+ rsrcsSet.add(styles[i]);
+ }
+
+ stylesAll = (InternetResource[]) rsrcsSet.toArray(new InternetResource[rsrcsSet.size()]);
+ }
+ }
+ }
+ }
+
+ return stylesAll;
+ }
+
+ protected void doEncodeEnd(ResponseWriter writer, FacesContext context, UIComponent component) throws IOException {
+
+ Iterator messagesIter = null;
+
+ String forIds = null;
+
+ String layout = null;
+
+
+ UIRichMessages uiMessages = (UIRichMessages)component;
+
+ if(uiMessages.isGlobalOnly()){
+ forIds = "";
+ }
+
+ messagesIter = getMessageIterator(context, forIds, component);
+
+ if((layout != null) && (layout.equals("table"))){
+
+ writer.startElement("table", component);
+ getUtils().writeAttribute(writer, HTML.id_ATTRIBUTE, uiMessages.getClientId(context));
+ renderHeaderFacet(writer, context, uiMessages);
+ writer.startElement("tbody", uiMessages);
+ uiMessages.setWroteTable(true);
+
+ }else if((layout != null) && (layout.equals("iterator"))){
+ // TODO will implement this behaviour soon!!!
+ }else{
+ writer.startElement("ul", component);
+ }
+
+ while(messagesIter.hasNext()){
+
+ FacesMessage facesMsg = (FacesMessage)(messagesIter.next());
+
+ writer.startElement(HTML.TR_ELEMENT, component);
+
+ renderMarkerFacet(uiMessages, context, writer, facesMsg);
+ renderLabel(uiMessages, context, writer, facesMsg);
+
+ writer.endElement(HTML.TR_ELEMENT);
+ }
+
+ if(uiMessages.isWroteTable()){
+ writer.endElement("tbody");
+ writer.endElement("table");
+ }else{
+ writer.endElement("ul");
+ }
+
+ }
+
+ public void renderLabelHtml(UIComponent component, FacesContext context, ResponseWriter writer,
+ FacesMessage facesMsg, String labelClass, String labelStyle, String passLabel) throws IOException {
+
+ String summary = null;
+
+ String detail = null;
+
+ String title = null;
+
+ UIRichMessage uiMsg = (UIRichMessage)component;
+
+ boolean isTooltip = getUtils().isBooleanAttribute(uiMsg, "tooltip");
+
+ boolean showSummary = uiMsg.isShowSummary();
+
+ boolean showDetail = uiMsg.isShowDetail();
+
+
+ if(facesMsg != null){
+ summary = (null != (summary = facesMsg.getSummary())) ? summary : "";
+ detail = (null != (detail = facesMsg.getDetail())) ? detail : "";
+ }
+
+ String classes = labelClass == null ? "rich-messages-label" : "rich-messages-label " + labelClass;
+
+
+ writer.startElement(HTML.td_ELEM, component);
+
+ getUtils().writeAttribute(writer, HTML.class_ATTRIBUTE,classes);
+ getUtils().writeAttribute(writer, HTML.style_ATTRIBUTE, labelStyle);
+
+ if(facesMsg != null){
+ if(isTooltip){
+ title = (String) uiMsg.getAttributes().get("title");
+ if(title != null){
+ getUtils().writeAttribute(writer, HTML.title_ATTRIBUTE, title);
+ }else{
+ getUtils().writeAttribute(writer, HTML.title_ATTRIBUTE, summary);
+ }
+ }
+
+ if(showDetail){
+ writer.writeText(detail, null);
+ writer.writeText("\t", null);
+ }
+
+ if(showSummary){
+ writer.writeText(summary, null);
+ writer.writeText("\t", null);
+ }
+ }else {
+
+ if(passLabel != null){
+ writer.writeText(passLabel, null);
+ writer.writeText("\t", null);
+ }
+
+ }
+
+ writer.endElement(HTML.td_ELEM);
+
+ }
+
+ public void renderMarkerHtml(UIComponent component, UIComponent markerFacet, FacesContext context,
+ ResponseWriter writer, String markerClass, String markerStyle)throws IOException {
+
+ UIRichMessages uiMessages = (UIRichMessages)component;
+ if(uiMessages.isWroteTable()){
+
+ writer.startElement(HTML.td_ELEM, component);
+
+ String classes = markerClass == null ? "rich-messages-marker" : "rich-messages-marker " + markerClass;
+ getUtils().writeAttribute(writer, HTML.class_ATTRIBUTE, classes);
+ getUtils().writeAttribute(writer, HTML.style_ATTRIBUTE, markerStyle);
+
+ renderChild(context, markerFacet);
+
+ writer.endElement(HTML.td_ELEM);
+
+ }else{
+
+ }
+ }
+
+ public void renderHeaderFacet(ResponseWriter writer, FacesContext context, UIRichMessages uiMessages) throws IOException{
+
+ UIComponent facet = null;
+
+ String headerClass = null;
+
+ String headerStyle = null;
+
+
+ headerClass = (String)uiMessages.getAttributes().get("headerClass");
+
+ headerStyle = (String)uiMessages.getAttributes().get("headerStyle");
+
+ if(uiMessages.getFacet("header") != null){
+
+ facet = uiMessages.getFacet("header");
+
+ if(!facet.isRendered()){
+ return;
+ }
+
+ writer.startElement(HTML.THEAD_ELEMENT, uiMessages);
+ writer.startElement(HTML.TR_ELEMENT, uiMessages);
+ writer.startElement(HTML.td_ELEM, uiMessages);
+
+ getUtils().writeAttribute(writer, HTML.class_ATTRIBUTE, headerClass);
+ getUtils().writeAttribute(writer,HTML.style_ATTRIBUTE, headerStyle);
+
+ renderChild(context, facet);
+
+ writer.endElement(HTML.td_ELEM);
+ writer.endElement(HTML.TR_ELEMENT);
+ writer.endElement(HTML.THEAD_ELEMENT);
+ }
+ }
+
+ protected Class getComponentClass() {
+ return UIMessages.class;
+ }
+
+}
Added: trunk/sandbox/ui/message/src/main/resources/org/richfaces/renderkit/html/css/msgs.css
===================================================================
--- trunk/sandbox/ui/message/src/main/resources/org/richfaces/renderkit/html/css/msgs.css (rev 0)
+++ trunk/sandbox/ui/message/src/main/resources/org/richfaces/renderkit/html/css/msgs.css 2007-07-24 17:56:41 UTC (rev 1829)
@@ -0,0 +1,11 @@
+.rich-messages-marker{
+}
+
+.rich-messages{
+}
+
+.rich-messages-label{
+}
+
+.rich-messages-header{
+}
17 years, 5 months
JBoss Rich Faces SVN: r1828 - in trunk/ui: tree/src/main/resources/org/richfaces/renderkit/html/scripts and 1 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: sergeyhalipov
Date: 2007-07-24 13:14:02 -0400 (Tue, 24 Jul 2007)
New Revision: 1828
Modified:
trunk/ui/drag-drop/src/main/java/org/richfaces/renderkit/DragIndicatorRendererBase.java
trunk/ui/tree/src/main/resources/org/richfaces/renderkit/html/scripts/tree.js
trunk/ui/tree/src/main/templates/htmlTree.jspx
Log:
http://jira.jboss.com/jira/browse/RF-488
http://jira.jboss.com/jira/browse/RF-500
Restoring tree after refactoring in repository.
Modified: trunk/ui/drag-drop/src/main/java/org/richfaces/renderkit/DragIndicatorRendererBase.java
===================================================================
--- trunk/ui/drag-drop/src/main/java/org/richfaces/renderkit/DragIndicatorRendererBase.java 2007-07-24 17:09:24 UTC (rev 1827)
+++ trunk/ui/drag-drop/src/main/java/org/richfaces/renderkit/DragIndicatorRendererBase.java 2007-07-24 17:14:02 UTC (rev 1828)
@@ -30,6 +30,7 @@
import javax.faces.context.FacesContext;
import javax.faces.context.ResponseWriter;
+import org.ajax4jsf.javascript.JSEncoder;
import org.richfaces.component.UIDragIndicator;
import org.richfaces.component.nsutils.NSUtils;
//import org.richfaces.org.apache.commons.lang.StringEscapeUtils;
@@ -102,8 +103,20 @@
protected String getPredefinedMarker(FacesContext context, Object facetName) {
if (MARKERS_PREDEFINED.contains(facetName)) {
- //return StringEscapeUtils.escapeJavaScript("<img alt=\"\" border=\"0\" width=\"16\" height=\"16\" src=\"" +
- // getResource("/org/richfaces/renderkit/html/images/" + facetName + ".gif").getUri(context, null) +"\" />");
+ StringBuffer buff = new StringBuffer();
+ JSEncoder encoder = new JSEncoder();
+ String source = "<img alt=\"\" border=\"0\" width=\"16\" height=\"16\" src=\"" +
+ getResource("/org/richfaces/renderkit/html/images/" + facetName + ".gif").getUri(context, null) +"\" />";
+ char chars[] = source.toString().toCharArray();
+ for (int i = 0; i < chars.length; i++) {
+ char c = chars[i];
+ if (!encoder.compile(c)) {
+ buff.append(encoder.encode(c));
+ } else {
+ buff.append(c);
+ }
+ }
+ return buff.toString();
}
throw new IllegalArgumentException("No predefined marker with [" + facetName + "] name exists!");
Modified: trunk/ui/tree/src/main/resources/org/richfaces/renderkit/html/scripts/tree.js
===================================================================
--- trunk/ui/tree/src/main/resources/org/richfaces/renderkit/html/scripts/tree.js 2007-07-24 17:09:24 UTC (rev 1827)
+++ trunk/ui/tree/src/main/resources/org/richfaces/renderkit/html/scripts/tree.js 2007-07-24 17:14:02 UTC (rev 1828)
@@ -109,7 +109,7 @@
},
getElements: function() {
- var contentId = this.id + Tree.ID_DEVIDER + Tree.ID_CHILDS_ROW + Tree.ID_DEVIDER + Tree.ID_CHILDS_TD;
+ var contentId = this.id;
this.elements.contentTd = $(contentId);
Modified: trunk/ui/tree/src/main/templates/htmlTree.jspx
===================================================================
--- trunk/ui/tree/src/main/templates/htmlTree.jspx 2007-07-24 17:09:24 UTC (rev 1827)
+++ trunk/ui/tree/src/main/templates/htmlTree.jspx 2007-07-24 17:14:02 UTC (rev 1828)
@@ -17,7 +17,7 @@
new org.ajax4jsf.javascript.PrototypeScript(),
new org.ajax4jsf.javascript.AjaxScript(),
/org/richfaces/renderkit/html/scripts/utils.js,
- /org/ajax4jsf/renderkit/html/scripts/form.js,
+ /org/ajax4jsf/javascript/scripts/form.js,
/org/richfaces/renderkit/html/scripts/form.js,
/org/richfaces/renderkit/html/scripts/events.js,
/org/richfaces/renderkit/html/scripts/tree.js,
17 years, 5 months