JBoss Rich Faces SVN: r1785 - trunk/samples/tooltip-sample/src/main/webapp/pages.
by richfaces-svn-commits@lists.jboss.org
Author: dbiatenia
Date: 2007-07-23 10:20:09 -0400 (Mon, 23 Jul 2007)
New Revision: 1785
Modified:
trunk/samples/tooltip-sample/src/main/webapp/pages/index.jsp
Log:
Modified: trunk/samples/tooltip-sample/src/main/webapp/pages/index.jsp
===================================================================
--- trunk/samples/tooltip-sample/src/main/webapp/pages/index.jsp 2007-07-23 14:19:27 UTC (rev 1784)
+++ trunk/samples/tooltip-sample/src/main/webapp/pages/index.jsp 2007-07-23 14:20:09 UTC (rev 1785)
@@ -1,7 +1,9 @@
<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %>
<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
-<%@ taglib uri="http://labs.jboss.com/jbossrichfaces/ui/tooltip" prefix="tt"%>
+<%--@ taglib uri="https://ajax4jsf.dev.java.net/ajax" prefix="a4j"--%>
<%@ taglib uri="http://richfaces.org/ajax" prefix="a4j"%>
+<%@ taglib uri="http://labs.jboss.com/jbossrichfaces/ui/tooltip" prefix="rich"%>
+
<html>
<head>
<title></title>
@@ -13,31 +15,35 @@
<h:commandLink action="#{skinBean.change}" value="set skin" />
<f:verbatim>
<br/><br/>
+ <div style="position:relative;top:100px;left:100px;">
</f:verbatim>
- <h:panelGrid columns="1">
- <h:commandButton value="Tooltip with followMouse mode" id="btn3">
- <tt:toolTip followMouse="false" direction="top-left" mode="ajax" value="#{bean.toolTipContent}" horizontalOffset="20" verticalOffset="20">
- <f:facet name="defaultContent">
- <h:outputText value="Some text will be here soon" />
+ <h:commandButton value="Tooltip with followMouse mode" id="btn">
+ <rich:toolTip id="tt" followMouse="true" direction="top-right" mode="ajax" value="#{bean.toolTipContent}" horizontalOffset="5" verticalOffset="5" layout="block">
+ <f:facet name="defaultContent"><f:verbatim>DEFAULT CONTENT</f:verbatim>
</f:facet>
- <h:outputText value="Final content" />
- </tt:toolTip>
- </h:commandButton>
- <h:inputText value="Ajax mode Tooltip with default content" id="inp1" size="50">
- <tt:toolTip id="tt" followMouse="false" direction="top-right" mode="ajax" value="#{bean.toolTipContent}" horizontalOffset="20" verticalOffset="20">
- <f:facet name="defaultContent">
- <h:outputText value="Some text will be here soon" />
- </f:facet>
<h:outputText id="ot" value="#{bean.toolTipContent}"></h:outputText>
- <h:commandLink value="Click here to close window..."></h:commandLink>
- </tt:toolTip>
- </h:inputText>
-
- <h:commandButton value="Tooltip with followMouse mode" id="btn">
- <tt:toolTip value="Tooltip text" followMouse="true"></tt:toolTip>
+ <h:commandLink value="You can click here..."></h:commandLink>
+ </rich:toolTip>
</h:commandButton>
+ <f:verbatim>
+ </div>
+ </f:verbatim>
+ <h:commandLink value="Simple Link" id="link">
+ <rich:toolTip id="toolTipForLink" followMouse="false" direction="top-right" mode="ajax" value="#{bean.toolTipContent}" horizontalOffset="5" verticalOffset="5" layout="block">
+ <f:facet name="defaultContent"><f:verbatim>DEFAULT LINK CONTENT</f:verbatim>
+ </f:facet>
+ <h:outputText id="outText" value="#{bean.toolTipContent}"></h:outputText>
+ </rich:toolTip>
- </h:panelGrid>
+ </h:commandLink>
+ <h:outputText id="text" value="Text with tooltip">
+ <rich:toolTip id="toolTipForText" followMouse="false" direction="top-right" mode="ajax" value="#{bean.toolTipContent}" horizontalOffset="5" verticalOffset="5" layout="inline">
+ </rich:toolTip>
+ </h:outputText>
+ <%-- h:commandButton value="Tooltip with followMouse mode" id="btn">
+ <tt:toolTip value="Tooltip text" followMouse="false" onclick="alert('onlcick');" direction="bottom-left"></tt:toolTip>
+ </h:commandButton--%>
+
<%--a4j:log popup="false" level="ALL"></a4j:log--%>
</h:form>
17 years, 5 months
JBoss Rich Faces SVN: r1784 - in trunk/ui/tooltip/src/main: java/org/richfaces/component and 3 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: dbiatenia
Date: 2007-07-23 10:19:27 -0400 (Mon, 23 Jul 2007)
New Revision: 1784
Modified:
trunk/ui/tooltip/src/main/config/component/toolTip.xml
trunk/ui/tooltip/src/main/java/org/richfaces/component/UIToolTip.java
trunk/ui/tooltip/src/main/java/org/richfaces/renderkit/html/ToolTipRenderer.java
trunk/ui/tooltip/src/main/resources/org/richfaces/renderkit/html/scripts/tooltip.js
trunk/ui/tooltip/src/main/templates/org/richfaces/htmltooltip.jspx
Log:
Modified: trunk/ui/tooltip/src/main/config/component/toolTip.xml
===================================================================
--- trunk/ui/tooltip/src/main/config/component/toolTip.xml 2007-07-23 14:19:02 UTC (rev 1783)
+++ trunk/ui/tooltip/src/main/config/component/toolTip.xml 2007-07-23 14:19:27 UTC (rev 1784)
@@ -4,8 +4,6 @@
<!DOCTYPE components PUBLIC "-//EXADEL//Generator config/EN" "http://exadel.com/dtds/component-config.dtd" >
-->
-
-
<components>
<component>
<name>org.richfaces.component.ToolTip</name>
@@ -18,10 +16,15 @@
<superclassname>org.ajax4jsf.tests.AbstractAjax4JsfTestCase</superclassname>
</test>
- <renderer generate="true" override="true">
+ <!--renderer generate="true" override="true">
<name>org.richfaces.renderkit.html.ToolTipRenderer</name>
<template>org/richfaces/htmltooltip.jspx</template>
+ </renderer-->
+ <renderer override="true">
+ <name>org.richfaces.renderkit.html.ToolTipRenderer</name>
+ <classname>org.richfaces.renderkit.html.ToolTipRenderer</classname>
</renderer>
+
<tag>
<name>toolTip</name>
<classname>org.richfaces.taglib.HtmlToolTipTag</classname>
@@ -33,6 +36,13 @@
</tag>
<property>
+ <name>layout</name>
+ <classname>java.lang.String</classname>
+ <description>Allowed values: "inline" or "block". Block/inline mode flag. Tooltip will contain div/span elements accordingly.</description>
+ <defaultvalue><![CDATA["inline"]]></defaultvalue>
+ </property>
+
+ <property>
<name>oncomplete</name>
<classname>java.lang.String</classname>
<description></description>
@@ -148,4 +158,14 @@
<defaultvalue><![CDATA[""]]></defaultvalue>
</property>
</component>
-</components>
+ <renderer generate="true">
+ <template>org/richfaces/htmltooltipblock.jspx</template>
+ </renderer>
+ <!--renderer generate="true" override="true">
+ <name>org.richfaces.renderkit.html.ToolTipRenderer</name>
+ <template>org/richfaces/htmltooltip.jspx</template>
+ </renderer-->
+ <renderer generate="true">
+ <template>org/richfaces/htmltooltip.jspx</template>
+ </renderer>
+</components>
\ No newline at end of file
Modified: trunk/ui/tooltip/src/main/java/org/richfaces/component/UIToolTip.java
===================================================================
--- trunk/ui/tooltip/src/main/java/org/richfaces/component/UIToolTip.java 2007-07-23 14:19:02 UTC (rev 1783)
+++ trunk/ui/tooltip/src/main/java/org/richfaces/component/UIToolTip.java 2007-07-23 14:19:27 UTC (rev 1784)
@@ -1,9 +1,19 @@
package org.richfaces.component;
+import java.io.IOException;
+import java.util.Set;
+
import javax.faces.component.UIComponentBase;
+import javax.faces.context.FacesContext;
+import javax.faces.event.AbortProcessingException;
+import javax.faces.event.FacesEvent;
-public abstract class UIToolTip extends UIComponentBase{
+import org.ajax4jsf.context.AjaxContext;
+import org.ajax4jsf.event.AjaxEvent;
+import org.richfaces.renderkit.html.ToolTipRenderer;
+public abstract class UIToolTip extends UIComponentBase implements org.ajax4jsf.component.AjaxChildrenEncoder{
+
public static final String COMPONENT_TYPE = "org.richfaces.toolTip";
public static final String CONTENT_FACET_NAME = "defaultContent";
@@ -11,6 +21,10 @@
public abstract void setValue(String value);
+ public abstract String getLayout();
+
+ public abstract void setLayout(String layout);
+
public abstract String getEvent();
public abstract void setEvent(String event);
@@ -47,17 +61,17 @@
public abstract void setStyleClass(String styleClass);
- public abstract String getOnactivate();
+ public abstract String getOncomplete();
- public abstract void setOnactivate(String onactivate);
+ public abstract void setOncomplete(String oncomplete);
public abstract String getOnshow();
public abstract void setOnshow(String onshow);
- public abstract String getOndeactivate();
+ public abstract String getOnhide();
- public abstract void setOndeactivate(String ondeactivate);
+ public abstract void setOnhide(String onhide);
public abstract String getOnclick();
@@ -79,9 +93,37 @@
public abstract void setOnmouseover(String onmouseover);
- public abstract String getOncomplete();
- public abstract void setOncomplete(String oncomplete);
+ public String getUsedElementType(){
+ return getLayout().equals("block") ? "div" : "span";
+ }
+
+ public void broadcast(FacesEvent event) throws AbortProcessingException {
- public abstract String getOnhide();
- public abstract void setOnhide(String onhide);
+ super.broadcast(event);
+
+ if (event instanceof AjaxEvent) {
+ FacesContext facesContext = FacesContext.getCurrentInstance();
+ AjaxContext ajaxContext = AjaxContext.getCurrentInstance(facesContext);
+ ajaxContext.getAjaxAreasToRender().add(this.getClientId(facesContext) + "content");
+ ajaxContext.addRegionsFromComponent(this);
+ }
+ }
+
+ public void encodeAjaxChild(FacesContext context, String path, Set ids,
+ Set renderedAreas) throws IOException {
+
+ if(ids.contains(this.getClientId(context) + "content")){
+ AjaxContext ajaxContext = AjaxContext.getCurrentInstance(context);
+ ToolTipRenderer r = (ToolTipRenderer)getRenderer(context);
+ r.encodeTooltipText(context, this);
+ ajaxContext.getAjaxRenderedAreas().add(this.getClientId(context) + "content");
+ } else {
+ // todo
+// AjaxContext ajaxContext = AjaxContext.getCurrentInstance(context);
+// ajaxContext.e
+
+ }
+
+ }
+
}
Modified: trunk/ui/tooltip/src/main/java/org/richfaces/renderkit/html/ToolTipRenderer.java
===================================================================
--- trunk/ui/tooltip/src/main/java/org/richfaces/renderkit/html/ToolTipRenderer.java 2007-07-23 14:19:02 UTC (rev 1783)
+++ trunk/ui/tooltip/src/main/java/org/richfaces/renderkit/html/ToolTipRenderer.java 2007-07-23 14:19:27 UTC (rev 1784)
@@ -3,22 +3,143 @@
import java.io.IOException;
import java.util.Map;
+import javax.faces.FacesException;
import javax.faces.component.UIComponent;
import javax.faces.context.FacesContext;
import javax.faces.context.ResponseWriter;
-
+/*
+import org.ajax4jsf.framework.ajax.AjaxEvent;
+import org.ajax4jsf.framework.renderer.AjaxComponentRendererBase;
+import org.ajax4jsf.framework.renderer.AjaxRendererUtils;
+import org.ajax4jsf.framework.resource.InternetResource;
+import org.ajax4jsf.framework.skin.Skin;
+import org.ajax4jsf.framework.util.javascript.JSFunction;
+import org.ajax4jsf.framework.util.javascript.JSFunctionDefinition;
+import org.ajax4jsf.framework.util.javascript.JSReference;
+*/
import org.ajax4jsf.event.AjaxEvent;
import org.ajax4jsf.javascript.JSFunction;
import org.ajax4jsf.javascript.JSFunctionDefinition;
import org.ajax4jsf.javascript.JSReference;
import org.ajax4jsf.renderkit.AjaxComponentRendererBase;
import org.ajax4jsf.renderkit.AjaxRendererUtils;
+import org.ajax4jsf.resource.InternetResource;
import org.richfaces.component.UIToolTip;
import org.richfaces.skin.Skin;
public class ToolTipRenderer extends AjaxComponentRendererBase{
+ //
+ // Declarations
+ //
+ private final InternetResource[] styles = {
+ getResource("/org/richfaces/renderkit/html/css/tooltip.xcss")
+ };
+
+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 {
+ java.util.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;
+}
+ private final InternetResource[] scripts = {
+ new org.ajax4jsf.javascript.PrototypeScript()
+ ,
+ new org.ajax4jsf.javascript.AjaxScript()
+ ,
+ getResource("/org/richfaces/renderkit/html/scripts/utils.js")
+ ,
+ getResource("/org/richfaces/renderkit/html/scripts/tooltip.js")
+ };
+
+private InternetResource[] scriptsAll = null;
+
+protected InternetResource[] getScripts() {
+ synchronized (this) {
+ if (scriptsAll == null) {
+ InternetResource[] rsrcs = super.getScripts();
+ boolean ignoreSuper = rsrcs == null || rsrcs.length == 0;
+ boolean ignoreThis = scripts == null || scripts.length == 0;
+
+ if (ignoreSuper) {
+ if (ignoreThis) {
+ scriptsAll = new InternetResource[0];
+ } else {
+ scriptsAll = scripts;
+ }
+ } else {
+ if (ignoreThis) {
+ scriptsAll = rsrcs;
+ } else {
+ java.util.Set rsrcsSet = new java.util.LinkedHashSet();
+
+ for (int i = 0; i < rsrcs.length; i++ ) {
+ rsrcsSet.add(rsrcs[i]);
+ }
+
+ for (int i = 0; i < scripts.length; i++ ) {
+ rsrcsSet.add(scripts[i]);
+ }
+
+ scriptsAll = (InternetResource[]) rsrcsSet.toArray(new InternetResource[rsrcsSet.size()]);
+ }
+ }
+ }
+ }
+
+ return scriptsAll;
+}
+ //
+ //
+ //
+
+
+ private String convertToString(Object obj ) {
+ return ( obj == null ? "" : obj.toString() );
+ }
+ private String convertToString(boolean b ) {
+ return String.valueOf(b);
+ }
+ private String convertToString(int b ) {
+ return b!=Integer.MIN_VALUE?String.valueOf(b):"";
+ }
+ private String convertToString(long b ) {
+ return b!=Long.MIN_VALUE?String.valueOf(b):"";
+ }
+
+
+
protected Class getComponentClass() {
return org.richfaces.component.UIToolTip.class;
}
@@ -36,6 +157,7 @@
}
+
public void insertValue(FacesContext context, UIComponent component) throws IOException {
Object value = component.getAttributes().get("value");
if (value!=null){
@@ -57,6 +179,10 @@
String showNewToolTip = ";" + getJsVarName(context, component) + ".displayDiv();";
+ String fireOnComplete = null;
+ if(((UIToolTip)component).getOncomplete() != null){
+
+ }
//enable ajaxSingle mode, i.e. we do not need to submit all form controls to get tooltip content
eventOptions.put("control", JSReference.THIS);
@@ -141,12 +267,87 @@
public void encodeTooltipText(FacesContext context, UIToolTip component) throws IOException {
ResponseWriter responseWriter = context.getResponseWriter();
- responseWriter.startElement("span", component);
+ responseWriter.startElement(component.getUsedElementType(), component);
responseWriter.writeAttribute("id", component.getClientId(context) + "content", null);
responseWriter.write(component.getValue() != null ? component.getValue() : "");
super.renderChildren(context, component);
- responseWriter.endElement("span");
+ responseWriter.endElement(component.getUsedElementType());
}
+
+ protected void doEncodeBegin(ResponseWriter writer, FacesContext context,
+ UIComponent component) throws IOException {
+
+ UIToolTip toolTip = (UIToolTip)component;
+ Class rendererClass = null;
+ try{
+ if("block".equals(toolTip.getLayout())){
+ rendererClass = Class.forName("org.richfaces.renderkit.html.HtmlToolTipRendererBlock");
+ } else if("inline".equals(toolTip.getLayout())){
+ rendererClass = Class.forName("org.richfaces.renderkit.html.HtmlToolTipRenderer");
+ } else {
+ throw new FacesException("Only \"block\" or \"inline\" values can be established to attribute \"layout\".");
+ }
+ ToolTipRenderer renderer = (ToolTipRenderer)rendererClass.newInstance();
+ renderer.doEncodeBegin(writer, context, component);
+
+ } catch(Exception e){
+ throw new FacesException(e.getMessage(), e);
+ }
+ }
+
+
+ protected void doEncodeChildren(ResponseWriter writer,
+ FacesContext context, UIComponent component) throws IOException {
+
+ UIToolTip toolTip = (UIToolTip)component;
+ Class rendererClass = null;
+ try{
+ if("block".equals(toolTip.getLayout())){
+ rendererClass = Class.forName("org.richfaces.renderkit.html.HtmlToolTipRendererBlock");
+ } else {
+ rendererClass = Class.forName("org.richfaces.renderkit.html.HtmlToolTipRenderer");
+ }
+
+ ToolTipRenderer renderer = null;
+
+ renderer = (ToolTipRenderer)rendererClass.newInstance();
+
+ renderer.doEncodeChildren(writer, context, component);
+ } catch(Exception e){
+ throw new FacesException(e.getMessage(), e);
+ }
+
+
+ }
+
+
+ protected void doEncodeEnd(ResponseWriter writer, FacesContext context,
+ UIComponent component) throws IOException {
+
+ UIToolTip toolTip = (UIToolTip)component;
+ Class rendererClass = null;
+ try{
+ if("block".equals(toolTip.getLayout())){
+ rendererClass = Class.forName("org.richfaces.renderkit.html.HtmlToolTipRendererBlock");
+ } else {
+ rendererClass = Class.forName("org.richfaces.renderkit.html.HtmlToolTipRenderer");
+ }
+ ToolTipRenderer renderer = (ToolTipRenderer)rendererClass.newInstance();
+ renderer.doEncodeEnd(writer, context, component);
+ } catch (Exception e) {
+ throw new FacesException(e.getMessage(), e);
+ }
+ }
+
+
+ /* (non-Javadoc)
+ * @see javax.faces.render.Renderer#getRendersChildren()
+ */
+ public boolean getRendersChildren() {
+ return true;
+ }
+
+
}
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-23 14:19:02 UTC (rev 1783)
+++ trunk/ui/tooltip/src/main/resources/org/richfaces/renderkit/html/scripts/tooltip.js 2007-07-23 14:19:27 UTC (rev 1784)
@@ -104,6 +104,11 @@
doShow: function(e){
+
+ if(this.onshow){
+ eval(this.onshow);
+ }
+
this.isMouseOvered = true;
if (e.target)
this.hintParentElement = e.target;
@@ -120,6 +125,9 @@
eval(this.ajaxExecuteString);
}
this.displayDiv(e);
+ if(this.mode != 'ajax' && this.oncomplete){
+ eval(this.oncomplete);
+ }
},
doHide: function(e){
@@ -137,7 +145,9 @@
this.hintParentElement = null;
this.isMouseOvered = false;
}
-
+ if(this.onhide){
+ eval(this.onhide);
+ }
},
doEnable: function(){
@@ -148,15 +158,33 @@
},
setToolTipPosition: function(e){
+
var windowDim = this.windowSize();
var cursorX = e.clientX + document.body.scrollLeft;
var cursorY = e.clientY + document.body.scrollTop;
- this.toolTipH = this.toolTip.getHeight();
- this.toolTipW = this.toolTip.getWidth();
+ if(this.toolTip.style.display != 'none'){
+ this.toolTipH = this.toolTip.getHeight();
+ this.toolTipW = this.toolTip.getWidth();
+ }
+
+ var offsets = Position.cumulativeOffset(this.parent);
+ cursorX -= offsets[0];
+ cursorY -= offsets[1];
+
+ 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;
+ /*
if(cursorY - this.verticalOffset - this.toolTipH < 0){
this.toolTip.style.top = cursorY + this.verticalOffset - this.toolTipH;
} else {
@@ -167,8 +195,11 @@
} else {
this.toolTip.style.left = cursorX - this.horizontalOffset - this.toolTipW;
}
-
+ */
} else if(this.direction == "bottom-left"){
+ this.toolTip.style.top = cursorY + this.verticalOffset;
+ this.toolTip.style.left = cursorX - this.horizontalOffset - this.toolTipW;
+ /*
if(cursorY + this.verticalOffset + this.toolTipH > windowDim[1]){
this.toolTip.style.top = cursorY - this.verticalOffset - this.toolTipH;
} else {
@@ -179,7 +210,11 @@
} else {
this.toolTip.style.left = cursorX - this.horizontalOffset - this.toolTipW;
}
+ */
} else if(this.direction == "top-right"){
+ this.toolTip.style.top = cursorY - this.verticalOffset - this.toolTipH;
+ this.toolTip.style.left = cursorX + this.horizontalOffset;
+ /*
if(cursorY - this.verticalOffset - this.toolTipH < 0){
this.toolTip.style.top = cursorY + this.verticalOffset;
} else {
@@ -190,9 +225,12 @@
} else {
this.toolTip.style.left = cursorX + this.horizontalOffset;
}
-
+ */
} else {
// bottom-right is default
+ this.toolTip.style.top = cursorY + this.verticalOffset;
+ this.toolTip.style.left = cursorX + this.horizontalOffset;
+ /*
if(cursorY + this.verticalOffset - this.toolTip.clientHeight > windowDim[1]){
this.toolTip.style.top = cursorY - this.verticalOffset - this.toolTipH;
} else {
@@ -203,7 +241,9 @@
} else {
this.toolTip.style.left = cursorX + this.horizontalOffset;
}
+ */
}
+
},
windowSize: function() {
Modified: trunk/ui/tooltip/src/main/templates/org/richfaces/htmltooltip.jspx
===================================================================
--- trunk/ui/tooltip/src/main/templates/org/richfaces/htmltooltip.jspx 2007-07-23 14:19:02 UTC (rev 1783)
+++ trunk/ui/tooltip/src/main/templates/org/richfaces/htmltooltip.jspx 2007-07-23 14:19:27 UTC (rev 1784)
@@ -11,31 +11,33 @@
baseclass="org.richfaces.renderkit.html.ToolTipRenderer"
component="org.richfaces.component.UIToolTip" >
- <h:styles>
+ <!-- h:styles>
/org/richfaces/renderkit/html/css/tooltip.xcss
</h:styles>
<h:scripts>
- new org.ajax4jsf.javascript.PrototypeScript(),
- new org.ajax4jsf.javascript.AjaxScript(),
+ new org.ajax4jsf.framework.resource.PrototypeScript(),
+ new org.ajax4jsf.framework.ajax.AjaxScript(),
/org/richfaces/renderkit/html/scripts/utils.js,
/org/richfaces/renderkit/html/scripts/tooltip.js
- </h:scripts>
+ </h:scripts-->
<f:clientid var="clientId"/>
+ <span id="#{clientId}" style="position: absolute; display : none;z-index:99; #{component.attributes['style']}" class="dr-rich-tool-tip rich-tool-tip #{component.attributes['styleClass']}">
+ <f:call name="utils.encodePassThru" />
+ <span id="#{clientId}defaultContent" style="display:none">
+ <u:insertFacet name="defaultContent" />
+ </span>
+ <vcp:body>
+ <f:call name="encodeTooltipText"/>
+ </vcp:body>
+ <f:clientid var="clientId"/>
+ <span id="#{clientId}script" style="display:none">
+ <f:call name="insertScript"/>
+ </span>
+ </span>
+
- <div id="#{clientId}" style="position: absolute; display : none;z-index:99; #{component.attributes['style']}" class="dr-rich-tool-tip rich-tool-tip #{component.attributes['styleClass']}">
- <f:call name="utils.encodePassThru" />
- <span id="#{clientId}defaultContent" style="display:none">
- <u:insertFacet name="defaultContent" />
- </span>
- <vcp:body>
- <f:call name="encodeTooltipText"/>
- </vcp:body>
- <f:clientid var="clientId"/>
- <span id="#{clientId}script" style="display:none">
- <f:call name="insertScript"/>
- </span>
-
- </div>
+
+
<!-- f:call name="utils.encodeEndFormIfNessesary"/-->
</f:root>
17 years, 5 months
JBoss Rich Faces SVN: r1783 - in trunk/ui/tooltip/src/test/java/org/richfaces: renderkit and 1 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: dbiatenia
Date: 2007-07-23 10:19:02 -0400 (Mon, 23 Jul 2007)
New Revision: 1783
Added:
trunk/ui/tooltip/src/test/java/org/richfaces/renderkit/
trunk/ui/tooltip/src/test/java/org/richfaces/renderkit/html/
trunk/ui/tooltip/src/test/java/org/richfaces/renderkit/html/ToolTipRendererTest.java
Log:
Added: trunk/ui/tooltip/src/test/java/org/richfaces/renderkit/html/ToolTipRendererTest.java
===================================================================
--- trunk/ui/tooltip/src/test/java/org/richfaces/renderkit/html/ToolTipRendererTest.java (rev 0)
+++ trunk/ui/tooltip/src/test/java/org/richfaces/renderkit/html/ToolTipRendererTest.java 2007-07-23 14:19:02 UTC (rev 1783)
@@ -0,0 +1,40 @@
+package org.richfaces.renderkit.html;
+
+import java.io.IOException;
+
+import org.ajax4jsf.tests.AbstractAjax4JsfTestCase;
+
+public class ToolTipRendererTest extends AbstractAjax4JsfTestCase{
+
+ public ToolTipRendererTest(String name) {
+ super(name);
+ // TODO Auto-generated constructor stub
+ }
+
+
+ public void setUp() throws Exception {
+ // TODO Auto-generated method stub
+
+ super.setUp();
+ }
+
+
+ protected void setupResponseWriter() throws IOException {
+ // TODO Auto-generated method stub
+ super.setupResponseWriter();
+ }
+
+
+ protected void setupWebClient() {
+ // TODO Auto-generated method stub
+ super.setupWebClient();
+ }
+
+
+ public void tearDown() throws Exception {
+ // TODO Auto-generated method stub
+ super.tearDown();
+ }
+
+
+}
17 years, 5 months
JBoss Rich Faces SVN: r1782 - trunk/ui/tooltip/src/main/templates/org/richfaces.
by richfaces-svn-commits@lists.jboss.org
Author: dbiatenia
Date: 2007-07-23 10:18:45 -0400 (Mon, 23 Jul 2007)
New Revision: 1782
Added:
trunk/ui/tooltip/src/main/templates/org/richfaces/htmltooltipblock.jspx
Log:
Added: trunk/ui/tooltip/src/main/templates/org/richfaces/htmltooltipblock.jspx
===================================================================
--- trunk/ui/tooltip/src/main/templates/org/richfaces/htmltooltipblock.jspx (rev 0)
+++ trunk/ui/tooltip/src/main/templates/org/richfaces/htmltooltipblock.jspx 2007-07-23 14:18:45 UTC (rev 1782)
@@ -0,0 +1,39 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<f:root
+ xmlns:f="http:/jsf.exadel.com/template"
+ xmlns:h=" http://ajax4jsf.org/cdk/headers"
+ xmlns:c=" http://java.sun.com/jsf/core"
+ xmlns:ui=" http://ajax4jsf.org/cdk/ui"
+ xmlns:u=" http://ajax4jsf.org/cdk/u"
+ xmlns:x=" http://ajax4jsf.org/cdk/x"
+ xmlns:vcp="http://ajax4jsf.org/cdk/vcp"
+ class="org.richfaces.renderkit.html.HtmlToolTipRendererBlock"
+ baseclass="org.richfaces.renderkit.html.ToolTipRenderer"
+ component="org.richfaces.component.UIToolTip" >
+
+ <!-- h:styles>
+ /org/richfaces/renderkit/html/css/tooltip.xcss
+ </h:styles>
+ <h:scripts>
+ new org.ajax4jsf.framework.resource.PrototypeScript(),
+ new org.ajax4jsf.framework.ajax.AjaxScript(),
+ /org/richfaces/renderkit/html/scripts/utils.js,
+ /org/richfaces/renderkit/html/scripts/tooltip.js
+ </h:scripts-->
+
+ <f:clientid var="clientId"/>
+ <div id="#{clientId}" style="position: absolute; display : none;z-index:99; #{component.attributes['style']}" class="dr-rich-tool-tip rich-tool-tip #{component.attributes['styleClass']}">
+ <f:call name="utils.encodePassThru" />
+ <div id="#{clientId}defaultContent" style="display:none">
+ <u:insertFacet name="defaultContent" />
+ </div>
+ <vcp:body>
+ <f:call name="encodeTooltipText"/>
+ </vcp:body>
+ <f:clientid var="clientId"/>
+ <span id="#{clientId}script" style="display:none">
+ <f:call name="insertScript"/>
+ </span>
+ </div>
+ <!-- f:call name="utils.encodeEndFormIfNessesary"/-->
+</f:root>
17 years, 5 months
JBoss Rich Faces SVN: r1781 - in trunk/sandbox: ui/calendar/src/main/java/org/richfaces/component and 1 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2007-07-23 10:14:43 -0400 (Mon, 23 Jul 2007)
New Revision: 1781
Modified:
trunk/sandbox/samples/calendar-sample/src/main/java/org/richfaces/CalendarBean.java
trunk/sandbox/ui/calendar/src/main/java/org/richfaces/component/UICalendar.java
trunk/sandbox/ui/calendar/src/main/java/org/richfaces/renderkit/CalendarRendererBase.java
Log:
Scroll submit made ajax-single
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-23 13:56:20 UTC (rev 1780)
+++ trunk/sandbox/samples/calendar-sample/src/main/java/org/richfaces/CalendarBean.java 2007-07-23 14:14:43 UTC (rev 1781)
@@ -37,6 +37,7 @@
private static final String[] WEEK_DAY_LABELS = new String[] {"Sun *", "Mon +", "Tue +", "Wed +", "Thu +", "Fri +", "Sat *"};
private Locale locale;
+
private boolean popup;
private String pattern;
private Date currentDate;
@@ -80,9 +81,11 @@
public void selectLocale(ValueChangeEvent event){
String tLocale = (String) event.getNewValue();
- String lang = tLocale.substring(0,2);
- String country = tLocale.substring(3);
- locale = new Locale(lang,country,"");
+ if (tLocale != null) {
+ String lang = tLocale.substring(0,2);
+ String country = tLocale.substring(3);
+ locale = new Locale(lang,country,"");
+ }
}
public boolean isUseCustomDayLabels() {
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-23 13:56:20 UTC (rev 1780)
+++ trunk/sandbox/ui/calendar/src/main/java/org/richfaces/component/UICalendar.java 2007-07-23 14:14:43 UTC (rev 1781)
@@ -107,8 +107,6 @@
// currentDate processing -------------------------------------------------
- private Date currentDate = null;
-
public String getValueAsString(FacesContext context, UIComponent component)
throws IOException {
UICalendar calendar = (UICalendar) component;
@@ -155,24 +153,14 @@
}
}
-
- private int getLastDayOfWeek(Calendar calendar) {
- int i = calendar.getFirstDayOfWeek();
- if (i == calendar.getActualMinimum(Calendar.DAY_OF_WEEK)) {
- i = calendar.getActualMaximum(Calendar.DAY_OF_WEEK);
- } else {
- i--;
- }
-
- return i;
- }
-
public Date getCurrentDateOrDefault() {
Date date = getCurrentDate();
if (date != null) {
return date;
} else {
- return getCalendar().getTime();
+ Calendar calendar = getCalendar();
+ calendar.set(Calendar.DATE, 1);
+ return calendar.getTime();
}
}
Modified: trunk/sandbox/ui/calendar/src/main/java/org/richfaces/renderkit/CalendarRendererBase.java
===================================================================
--- trunk/sandbox/ui/calendar/src/main/java/org/richfaces/renderkit/CalendarRendererBase.java 2007-07-23 13:56:20 UTC (rev 1780)
+++ trunk/sandbox/ui/calendar/src/main/java/org/richfaces/renderkit/CalendarRendererBase.java 2007-07-23 14:14:43 UTC (rev 1781)
@@ -187,9 +187,10 @@
ajaxFunction.addParameter(JSReference.NULL);
Map options = AjaxRendererUtils.buildEventOptions(context, calendar);
options.put("calendar", JSReference.THIS);
+ options.put("single", JSReference.TRUE);
// ajax single
- options.put("control", new JSReference(JSReference.THIS.toScript(),
- "id"));
+ //options.put("control", new JSReference(JSReference.THIS.toScript(),
+ // "id"));
String oncomplete = AjaxRendererUtils.getAjaxOncomplete(calendar);
JSFunctionDefinition oncompleteDefinition = new JSFunctionDefinition();
17 years, 5 months
JBoss Rich Faces SVN: r1780 - trunk/framework/impl/src/main/java/org/ajax4jsf/component.
by richfaces-svn-commits@lists.jboss.org
Author: maksimkaszynski
Date: 2007-07-23 09:56:20 -0400 (Mon, 23 Jul 2007)
New Revision: 1780
Modified:
trunk/framework/impl/src/main/java/org/ajax4jsf/component/UIDataAdaptor.java
Log:
persisted state of child inputs of data adaptor. reset after updates
Modified: trunk/framework/impl/src/main/java/org/ajax4jsf/component/UIDataAdaptor.java
===================================================================
--- trunk/framework/impl/src/main/java/org/ajax4jsf/component/UIDataAdaptor.java 2007-07-23 13:26:10 UTC (rev 1779)
+++ trunk/framework/impl/src/main/java/org/ajax4jsf/component/UIDataAdaptor.java 2007-07-23 13:56:20 UTC (rev 1780)
@@ -925,7 +925,6 @@
protected void processDecodes(FacesContext faces, Object argument) {
if (!this.isRendered())
return;
- this.resetComponent(faces);
this.iterate(faces, decodeVisitor, argument);
this.decode(faces);
}
@@ -964,10 +963,13 @@
SerializableDataModel serializableModel = (SerializableDataModel) dataModel;
serializableModel.update();
}
+
+
}
public void processUpdates(FacesContext faces) {
processUpdates(faces, null);
+ resetComponent(faces);
}
protected void processValidators(FacesContext faces, Object argument) {
@@ -1223,6 +1225,9 @@
public String rowKeyVar;
public String stateVar;
+
+ private Map childStates;
+
}
@@ -1259,6 +1264,7 @@
this._statesMap = new HashMap();
this._rowKeyVar = state.rowKeyVar;
this._stateVar = state.stateVar;
+ this.childState = state.childStates;
// Restore serializable models and component states for all rows of
// parent UIData ( single if this
// component not child of iterable )
@@ -1288,6 +1294,7 @@
state.ajaxKeys = this._ajaxKeys;
state.rowKeyVar = this._rowKeyVar;
state.stateVar = this._stateVar;
+ state.childStates = this.childState;
Set encodedIds = getEncodedIds();
// Save all states of component and data model for all valies of
// clientId, encoded in this request.
17 years, 5 months
JBoss Rich Faces SVN: r1779 - trunk/docs/userguide/en/src/main/docbook/modules.
by richfaces-svn-commits@lists.jboss.org
Author: vkorluzhenko
Date: 2007-07-23 09:26:10 -0400 (Mon, 23 Jul 2007)
New Revision: 1779
Modified:
trunk/docs/userguide/en/src/main/docbook/modules/RFCfaq.xml
Log:
http://jira.jboss.com/jira/browse/RF-389
Modified: trunk/docs/userguide/en/src/main/docbook/modules/RFCfaq.xml
===================================================================
--- trunk/docs/userguide/en/src/main/docbook/modules/RFCfaq.xml 2007-07-23 12:22:59 UTC (rev 1778)
+++ trunk/docs/userguide/en/src/main/docbook/modules/RFCfaq.xml 2007-07-23 13:26:10 UTC (rev 1779)
@@ -394,7 +394,7 @@
<para> For necessary information you can see discussion about this problem on the
<ulink
url="http://www.jboss.com/index.html?module=bb&op=viewtopic&t=111761"
- >RichFaces Users Forum</ulink></para>
+ >RichFaces Users Forum</ulink>.</para>
</section>
<section>
17 years, 5 months
JBoss Rich Faces SVN: r1778 - in trunk/sandbox/ui/calendar/src: main/templates/org/richfaces and 1 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: akushunin
Date: 2007-07-23 08:22:59 -0400 (Mon, 23 Jul 2007)
New Revision: 1778
Modified:
trunk/sandbox/ui/calendar/src/main/java/org/richfaces/renderkit/CalendarRendererBase.java
trunk/sandbox/ui/calendar/src/main/templates/org/richfaces/htmlCalendar.jspx
trunk/sandbox/ui/calendar/src/test/java/org/richfaces/component/CalendarComponentTest.java
Log:
.getInstance(locale) changet to new DateFormatSymbols(locale)
Updated Calendar JUnit test
Addad ClientId to teplate for CalendarInput
Modified: trunk/sandbox/ui/calendar/src/main/java/org/richfaces/renderkit/CalendarRendererBase.java
===================================================================
--- trunk/sandbox/ui/calendar/src/main/java/org/richfaces/renderkit/CalendarRendererBase.java 2007-07-23 12:06:03 UTC (rev 1777)
+++ trunk/sandbox/ui/calendar/src/main/java/org/richfaces/renderkit/CalendarRendererBase.java 2007-07-23 12:22:59 UTC (rev 1778)
@@ -272,7 +272,8 @@
int minimum = cal.getActualMinimum(Calendar.DAY_OF_WEEK);
int firstDayOfWeek = cal.getFirstDayOfWeek();
- DateFormatSymbols symbols = DateFormatSymbols.getInstance(locale);
+ //.getInstance(locale) changet to new DateFormatSymbols(locale) by Alexej Kushunin ;
+ DateFormatSymbols symbols = new DateFormatSymbols(locale);
String[] weekDayLabels = ComponentUtil.asArray(calendar.getWeekDayLabels());
if (weekDayLabels == null) {
weekDayLabels = symbols.getWeekdays();
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-23 12:06:03 UTC (rev 1777)
+++ trunk/sandbox/ui/calendar/src/main/templates/org/richfaces/htmlCalendar.jspx 2007-07-23 12:22:59 UTC (rev 1778)
@@ -56,7 +56,8 @@
if (popup) {]]>
</jsp:scriptlet>
<span> <input
- x:passThruWithExclusions="name,id"
+ x:passThruWithExclusions="name"
+ id="#{clientId}Input"
value="#{this:getInputValue(context,component)}"
type="text"
readonly="#{component.attributes['readonly']}"
Modified: trunk/sandbox/ui/calendar/src/test/java/org/richfaces/component/CalendarComponentTest.java
===================================================================
--- trunk/sandbox/ui/calendar/src/test/java/org/richfaces/component/CalendarComponentTest.java 2007-07-23 12:06:03 UTC (rev 1777)
+++ trunk/sandbox/ui/calendar/src/test/java/org/richfaces/component/CalendarComponentTest.java 2007-07-23 12:22:59 UTC (rev 1778)
@@ -5,127 +5,192 @@
import java.util.Calendar;
import java.util.Date;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.List;
import java.util.Locale;
+import java.util.Set;
import javax.faces.component.UIComponent;
import javax.faces.component.html.HtmlForm;
import org.ajax4jsf.tests.AbstractAjax4JsfTestCase;
+import org.apache.commons.lang.StringUtils;
+import com.gargoylesoftware.htmlunit.html.HtmlElement;
import com.gargoylesoftware.htmlunit.html.HtmlPage;
+import com.gargoylesoftware.htmlunit.html.HtmlScript;
/**
- * @author Nick Belaevski - mailto:nbelaevski@exadel.com
- * created 08.06.2007
- *
+ * @author Nick Belaevski - mailto:nbelaevski@exadel.com created 08.06.2007
+ *
*/
public class CalendarComponentTest extends AbstractAjax4JsfTestCase {
-
-
+
private UIComponent form;
+
private UICalendar calendar;
-
+ private static Set javaScripts = new HashSet();
+
+ static {
+ javaScripts.add("org.ajax4jsf.javascript.PrototypeScript");
+ javaScripts.add("org.ajax4jsf.javascript.AjaxScript");
+ javaScripts.add("org/richfaces/renderkit/html/scripts/utils.js");
+ javaScripts.add("org/richfaces/renderkit/html/scripts/json/json-dom.js");
+ javaScripts.add("org/richfaces/renderkit/html/scripts/calendar.js");
+ }
+
public CalendarComponentTest(String name) {
super(name);
}
-
- public void setUp()throws Exception{
-
+
+ public void setUp() throws Exception {
+
super.setUp();
-
+
form = new HtmlForm();
- form.setId("form");
- facesContext.getViewRoot().getChildren().add(form);
-
- calendar = (UICalendar) application.createComponent(UICalendar.COMPONENT_TYPE);
+ form.setId("form");
+ facesContext.getViewRoot().getChildren().add(form);
+
+ calendar = (UICalendar) application
+ .createComponent(UICalendar.COMPONENT_TYPE);
calendar.setLocale(Locale.CHINESE);
Calendar calendarObject = Calendar.getInstance();
calendarObject.set(2001, Calendar.SEPTEMBER, 11);
calendar.setId("calendar");
-
+
form.getChildren().add(calendar);
-
- }
-
-/* public void testTidy() throws Exception {
- UIViewRoot viewRoot = facesContext.getViewRoot();
- List children = viewRoot.getChildren();
- UIComponent calendar = application.createComponent(UICalendar.COMPONENT_TYPE);
- children.add(calendar);
- HtmlOutputText output = (HtmlOutputText) application.createComponent(HtmlOutputText.COMPONENT_TYPE);
- output.setValue("<br> &<a href='#'>");
- output.setEscape(false);
- calendar.getChildren().add(output);
-
- HtmlPage renderView = renderView();
- System.out.println(renderView.asXml());
+
}
-*/
+
+ /*
+ * public void testTidy() throws Exception { UIViewRoot viewRoot =
+ * facesContext.getViewRoot(); List children = viewRoot.getChildren();
+ * UIComponent calendar =
+ * application.createComponent(UICalendar.COMPONENT_TYPE);
+ * children.add(calendar); HtmlOutputText output = (HtmlOutputText)
+ * application.createComponent(HtmlOutputText.COMPONENT_TYPE);
+ * output.setValue("<br> &<a href='#'>");
+ * output.setEscape(false); calendar.getChildren().add(output);
+ *
+ * HtmlPage renderView = renderView();
+ * System.out.println(renderView.asXml()); }
+ */
public void testPreloadRanges() throws Exception {
- UICalendar calendar = (UICalendar) application.createComponent(UICalendar.COMPONENT_TYPE);
+ UICalendar calendar = (UICalendar) application
+ .createComponent(UICalendar.COMPONENT_TYPE);
calendar.setLocale(Locale.FRENCH);
Calendar calendarObject = Calendar.getInstance();
calendarObject.set(2007, Calendar.JUNE, 10);
-
- Calendar preloadRangeBegin = Calendar.getInstance();
- preloadRangeBegin.setTime(calendar.getDefaultPreloadBegin(calendarObject.getTime()));
+
+ Calendar preloadRangeBegin = Calendar.getInstance();
+ preloadRangeBegin.setTime(calendar
+ .getDefaultPreloadBegin(calendarObject.getTime()));
assertEquals(2007, preloadRangeBegin.get(Calendar.YEAR));
- assertEquals(Calendar.MAY, preloadRangeBegin.get(Calendar.MONTH));
- assertEquals(28, preloadRangeBegin.get(Calendar.DATE));
+ assertEquals(Calendar.JUNE, preloadRangeBegin.get(Calendar.MONTH));
+ assertEquals(1, preloadRangeBegin.get(Calendar.DATE));
- Calendar preloadRangeEnd = Calendar.getInstance();
- preloadRangeEnd.setTime(calendar.getDefaultPreloadEnd(calendarObject.getTime()));
+ Calendar preloadRangeEnd = Calendar.getInstance();
+ preloadRangeEnd.setTime(calendar.getDefaultPreloadEnd(calendarObject
+ .getTime()));
assertEquals(2007, preloadRangeEnd.get(Calendar.YEAR));
- assertEquals(Calendar.JULY, preloadRangeEnd.get(Calendar.MONTH));
- assertEquals(1, preloadRangeEnd.get(Calendar.DATE));
-
+ assertEquals(Calendar.JUNE, preloadRangeEnd.get(Calendar.MONTH));
+ assertEquals(30, preloadRangeEnd.get(Calendar.DATE));
+
calendarObject.set(2007, Calendar.JANUARY, 1);
- preloadRangeBegin.setTime(calendar.getDefaultPreloadBegin(calendarObject.getTime()));
+ preloadRangeBegin.setTime(calendar
+ .getDefaultPreloadBegin(calendarObject.getTime()));
assertEquals(2007, preloadRangeBegin.get(Calendar.YEAR));
assertEquals(Calendar.JANUARY, preloadRangeBegin.get(Calendar.MONTH));
assertEquals(1, preloadRangeBegin.get(Calendar.DATE));
-
calendarObject.set(2007, Calendar.JUNE, 10);
calendar.setLocale(Locale.US);
- preloadRangeBegin.setTime(calendar.getDefaultPreloadBegin(calendarObject.getTime()));
+ preloadRangeBegin.setTime(calendar
+ .getDefaultPreloadBegin(calendarObject.getTime()));
assertEquals(2007, preloadRangeBegin.get(Calendar.YEAR));
- assertEquals(Calendar.MAY, preloadRangeBegin.get(Calendar.MONTH));
- assertEquals(27, preloadRangeBegin.get(Calendar.DATE));
+ assertEquals(Calendar.JUNE, preloadRangeBegin.get(Calendar.MONTH));
+ assertEquals(1, preloadRangeBegin.get(Calendar.DATE));
- preloadRangeEnd.setTime(calendar.getDefaultPreloadEnd(calendarObject.getTime()));
+ preloadRangeEnd.setTime(calendar.getDefaultPreloadEnd(calendarObject
+ .getTime()));
assertEquals(2007, preloadRangeEnd.get(Calendar.YEAR));
assertEquals(Calendar.JUNE, preloadRangeEnd.get(Calendar.MONTH));
assertEquals(30, preloadRangeEnd.get(Calendar.DATE));
}
public void testGetPreloadDateRange() throws Exception {
- UICalendar calendar = (UICalendar) application.createComponent(UICalendar.COMPONENT_TYPE);
+ UICalendar calendar = (UICalendar) application
+ .createComponent(UICalendar.COMPONENT_TYPE);
calendar.setLocale(Locale.FRENCH);
Calendar calendarObject = Calendar.getInstance();
calendarObject.set(2007, Calendar.JUNE, 10);
calendar.setCurrentDate(calendarObject.getTime());
-
+
Date[] range = calendar.getPreloadDateRange();
assertEquals(calendar.getPreloadDateRangeBegin(), range[0]);
assertEquals(calendar.getPreloadDateRangeEnd(), range[range.length - 1]);
- assertEquals(35, range.length);
+ assertEquals(30, range.length);
}
-
- public void testCalendarRenderer()throws Exception{
+
+ public void testCalendarRenderer() throws Exception {
+
+ HtmlPage page = renderView();
+ assertNotNull(page);
+ //System.out.println(page.asXml());
+ HtmlElement htmlCalendar = page.getHtmlElementById(calendar.getClientId(facesContext));
+ assertNotNull(htmlCalendar);
+ //System.out.println(htmlCalendar.getAttributeValue("class"));
+ htmlCalendar.getAttributeValue("class");
+ HtmlElement htmlCalendarInput = page.getHtmlElementById(calendar.getClientId(facesContext)+"Input");
+ HtmlElement htmlCalendarButton = page.getHtmlElementById(calendar.getClientId(facesContext)+"Button");
+ assertNotNull(htmlCalendarInput);
+ assertNotNull(htmlCalendarButton);
+ assertTrue(htmlCalendarInput.getAttributeValue("class").contains("org.richfaces.component.html.HtmlCalendar"));
+ assertTrue(htmlCalendarButton.getAttributeValue("class").contains("org.richfaces.component.html.HtmlCalendar"));
+ }
+
+ public void testCalendarStyles() throws Exception {
HtmlPage page = renderView();
assertNotNull(page);
- System.out.println(page.asXml());
+ //System.out.println(page.asXml());
+ List links = page.getDocumentElement().getHtmlElementsByTagName("link");
+ assertEquals(1, links.size());
+ HtmlElement link = (HtmlElement) links.get(0);
+ assertTrue(link.getAttributeValue("href").contains("css/calendar.xcss"));
+ }
+ public void testCalendarScrits() throws Exception {
+ HtmlPage page = renderView();
+ assertNotNull(page);
+ List scripts = page.getDocumentElement().getHtmlElementsByTagName(
+ "script");
+ for (Iterator it = scripts.iterator(); it.hasNext();) {
+ HtmlScript item = (HtmlScript) it.next();
+ String srcAttr = item.getSrcAttribute();
+
+ if (StringUtils.isNotBlank(srcAttr)) {
+ boolean found = false;
+ for (Iterator srcIt = javaScripts.iterator(); srcIt.hasNext();) {
+ String src = (String) srcIt.next();
+
+ found = srcAttr.contains(src);
+ if (found) {
+ break;
+ }
+ }
+ assertTrue(found);
+ }
+ }
}
-
- public void tearDown() throws Exception {
- super.tearDown();
- form = null;
- calendar = null;
- }
+
+ public void tearDown() throws Exception {
+ super.tearDown();
+ form = null;
+ calendar = null;
+ }
}
17 years, 5 months
JBoss Rich Faces SVN: r1777 - in trunk/ui: panelbar/src/main/config/component and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: sergeyhalipov
Date: 2007-07-23 08:06:03 -0400 (Mon, 23 Jul 2007)
New Revision: 1777
Modified:
trunk/ui/drag-drop/src/main/config/component/dragSupport.xml
trunk/ui/drag-drop/src/main/config/component/dropSupport.xml
trunk/ui/panelbar/src/main/config/component/panelbar.xml
Log:
http://jira.jboss.com/jira/browse/RF-477
Modified: trunk/ui/drag-drop/src/main/config/component/dragSupport.xml
===================================================================
--- trunk/ui/drag-drop/src/main/config/component/dragSupport.xml 2007-07-23 10:03:32 UTC (rev 1776)
+++ trunk/ui/drag-drop/src/main/config/component/dragSupport.xml 2007-07-23 12:06:03 UTC (rev 1777)
@@ -61,7 +61,12 @@
<description>
JavaScript code for call before submission of ajax event
</description>
- </property>
+ </property>
+ <property hidden="true" >
+ <name>actionExpression</name>
+ <classname>java.lang.String</classname>
+ <description>The action method binding expression</description>
+ </property>
</component>
Modified: trunk/ui/drag-drop/src/main/config/component/dropSupport.xml
===================================================================
--- trunk/ui/drag-drop/src/main/config/component/dropSupport.xml 2007-07-23 10:03:32 UTC (rev 1776)
+++ trunk/ui/drag-drop/src/main/config/component/dropSupport.xml 2007-07-23 12:06:03 UTC (rev 1777)
@@ -63,7 +63,13 @@
</description>
<defaultvalue>"default"</defaultvalue>
</property>
- -->
+ -->
+
+ <property hidden="true" >
+ <name>actionExpression</name>
+ <classname>java.lang.String</classname>
+ <description>The action method binding expression</description>
+ </property>
</component>
<listener>
<name>dropListener</name>
Modified: trunk/ui/panelbar/src/main/config/component/panelbar.xml
===================================================================
--- trunk/ui/panelbar/src/main/config/component/panelbar.xml 2007-07-23 10:03:32 UTC (rev 1776)
+++ trunk/ui/panelbar/src/main/config/component/panelbar.xml 2007-07-23 12:06:03 UTC (rev 1777)
@@ -126,7 +126,12 @@
<taghandler>
<classname>org.ajax4jsf.tag.TestHandler</classname>
</taghandler>
- -->
+ -->
+
+ <property hidden="true">
+ <name>valid</name>
+ <classname>java.lang.String</classname>
+ </property>
</component>
<component>
17 years, 5 months
JBoss Rich Faces SVN: r1776 - trunk/docs/userguide/en/src/main/docbook/modules.
by richfaces-svn-commits@lists.jboss.org
Author: vkorluzhenko
Date: 2007-07-23 06:03:32 -0400 (Mon, 23 Jul 2007)
New Revision: 1776
Modified:
trunk/docs/userguide/en/src/main/docbook/modules/RFCfaq.xml
Log:
http://jira.jboss.com/jira/browse/RF-389 -added new question
Modified: trunk/docs/userguide/en/src/main/docbook/modules/RFCfaq.xml
===================================================================
--- trunk/docs/userguide/en/src/main/docbook/modules/RFCfaq.xml 2007-07-23 08:45:13 UTC (rev 1775)
+++ trunk/docs/userguide/en/src/main/docbook/modules/RFCfaq.xml 2007-07-23 10:03:32 UTC (rev 1776)
@@ -365,7 +365,7 @@
</section>
<section>
- <?dbhtml filename="Howtoremembercurrentselectedtab.html"?>
+ <?dbhtml filename="Howtodefinecurrentselectedtab.html"?>
<title>How to define the currently selected tab?</title>
<para> Simple code is placed below:</para>
@@ -387,6 +387,15 @@
...
]]></programlisting>
</section>
+
+ <section>
+ <?dbhtml filename="Howtoremembercurrentselectedtab.html"?>
+ <title>How to remember the current selected tab?</title>
+ <para> For necessary information you can see discussion about this problem on the
+ <ulink
+ url="http://www.jboss.com/index.html?module=bb&op=viewtopic&t=111761"
+ >RichFaces Users Forum</ulink></para>
+ </section>
<section>
<?dbhtml filename="Howtoretrievethecurrentvalue.html"?>
17 years, 5 months