JBoss Rich Faces SVN: r69 - trunk/richfaces/inputnumber-slider/src/main/resources/org/richfaces/renderkit/html/script.
by richfaces-svn-commits@lists.jboss.org
Author: F.antonov
Date: 2007-03-14 10:30:41 -0400 (Wed, 14 Mar 2007)
New Revision: 69
Modified:
trunk/richfaces/inputnumber-slider/src/main/resources/org/richfaces/renderkit/html/script/SliderScript.js
Log:
Fix for bug RFA-291.
Modified: trunk/richfaces/inputnumber-slider/src/main/resources/org/richfaces/renderkit/html/script/SliderScript.js
===================================================================
--- trunk/richfaces/inputnumber-slider/src/main/resources/org/richfaces/renderkit/html/script/SliderScript.js 2007-03-14 14:21:26 UTC (rev 68)
+++ trunk/richfaces/inputnumber-slider/src/main/resources/org/richfaces/renderkit/html/script/SliderScript.js 2007-03-14 14:30:41 UTC (rev 69)
@@ -1,7 +1,7 @@
if(!Exadel) var Exadel = {};
Exadel.Slider = Class.create();
Exadel.Slider.prototype = {
- initialize: function(handle, track, tip, table, options) {
+ initialize: function(handle, track, tip, table, handleSelectedClass, options) {
var slider = this;
this.handle = $( handle );
this.tip = $( tip );
@@ -15,6 +15,7 @@
this.classes.arrowSelected = "dr-insldr-handler-sel rich-inslider-handler-selected";
this.classes.temp = this.handle.className;
this.classes.base = " " + this.trim(this.classes.temp.replace("dr-insldr-handler rich-inslider-handler",""));
+ this.classes.handleSelected = " " + handleSelectedClass;
this.table = this.findTableForTrack(this.track);
//this.table.onmouseup = this.fireEditEvent.bindAsEventListener(this);
@@ -91,7 +92,7 @@
Event.observe(window, "load", this.setInitialValue.bindAsEventListener(this)); //FIX RFA-190
//Event.observe($(input), "propertychange", this.setInitialValue.bindAsEventListener(this));
},
-
+
setInitialValue: function(){
this.setValue(parseFloat(this.options.sliderValue || this.range.start));
this.handle.style.visibility="visible";
@@ -212,7 +213,7 @@
if(Event.isLeftClick(event)) {
if(!this.disabled){
- this.handle.className = this.classes.arrowSelected + this.classes.base;
+ this.handle.className = this.classes.arrowSelected + this.classes.base + this.classes.handleSelected;
if (this.options.currValue){
this.tip.style.display = "block";
}
@@ -258,7 +259,7 @@
if (this.eventChanged && this.isValueChanged()){
this.eventChanged(event);
}
- this.handle.className = this.classes.arrow + this.classes.base;
+ this.handle.className = this.classes.arrow + this.classes.base;
if(this.active && this.dragging) {
this.active = false;
this.dragging = false;
19 years, 1 month
JBoss Rich Faces SVN: r68 - trunk/richfaces/inputnumber-spinner/src/main/templates.
by richfaces-svn-commits@lists.jboss.org
Author: a.izobov
Date: 2007-03-14 10:21:26 -0400 (Wed, 14 Mar 2007)
New Revision: 68
Modified:
trunk/richfaces/inputnumber-spinner/src/main/templates/inputNumberSpinner.jspx
Log:
RFA-271 fixed
Modified: trunk/richfaces/inputnumber-spinner/src/main/templates/inputNumberSpinner.jspx
===================================================================
--- trunk/richfaces/inputnumber-spinner/src/main/templates/inputNumberSpinner.jspx 2007-03-14 14:14:30 UTC (rev 67)
+++ trunk/richfaces/inputnumber-spinner/src/main/templates/inputNumberSpinner.jspx 2007-03-14 14:21:26 UTC (rev 68)
@@ -20,13 +20,13 @@
<h:scripts>new org.ajax4jsf.framework.resource.PrototypeScript(),script/SpinnerScript.js,/org/richfaces/renderkit/html/scripts/browser_info.js</h:scripts>
<h:styles>css/spinner.xcss</h:styles>
-<table class="dr-spnr-c rich-spinner-c #{component.attributes['styleClass']}" id="#{clientId}" cellspacing="0" cellpadding="0" border="0" style="#{component.attributes['style']}">
+<table width="2%" class="dr-spnr-c rich-spinner-c #{component.attributes['styleClass']}" id="#{clientId}" cellspacing="0" cellpadding="0" border="0" style="#{component.attributes['style']}">
<tbody>
<tr>
- <td class="dr-spnr-e rich-spinner-input-container" id="#{clientId}Edit">
+ <td width="1%" class="dr-spnr-e rich-spinner-input-container" id="#{clientId}Edit">
<input onchange="#{component.attributes['onchange']}" onselect="#{component.attributes['onselect']}" type="text" accesskey="#{component.attributes['accesskey']}" size="#{component.attributes['inputSize']}" name="#{clientId}" class="dr-spnr-i rich-spinner-input #{component.attributes['inputClass']}" style="#{component.attributes['inputStyle']}" value="#{this:getInputValue(context, component)}"/>
</td>
- <td id="#{clientId}For" class="dr-spnr-b">
+ <td id="#{clientId}For" class="dr-spnr-b" width="1%">
<table id="#{clientId}Buttons" border="0" cellspacing="0" cellpadding="0">
<tbody>
<tr>
@@ -36,11 +36,11 @@
if (! disabled) {
]]></jsp:scriptlet>
<input type="image" src="#{up_arrow}" class="dr-spnr-bn rich-spinner-button" border="0" onclick="return false"
- onmousedown="this.className='dr-spnr-bp'" onmouseup="this.className='dr-spnr-bn'" onmouseout="this.className='dr-spnr-bn'" />
+ onmousedown="this.className='dr-spnr-bp rich-spinner-button'" onmouseup="this.className='dr-spnr-bn rich-spinner-button'" onmouseout="this.className='dr-spnr-bn rich-spinner-button'" />
<jsp:scriptlet><![CDATA[
} else {
]]></jsp:scriptlet>
- <input type="image" src="#{up_arrow}" class="dr-spnr-bn rich-spinner-button" border="0" onclick="return false" />
+ <input type="image" src="#{up_arrow}" class="dr-spnr-bn rich-spinner-button" border="0" onclick="return false" />
<jsp:scriptlet><![CDATA[
}
]]></jsp:scriptlet>
@@ -52,7 +52,7 @@
if (! disabled) {
]]></jsp:scriptlet>
<input type="image" src="#{down_arrow}" class="dr-spnr-bn rich-spinner-button" border="0" onclick="return false"
- onmousedown="this.className='dr-spnr-bp'" onmouseup="this.className='dr-spnr-bn'" onmouseout="this.className='dr-spnr-bn'" />
+ onmousedown="this.className='dr-spnr-bp rich-spinner-button'" onmouseup="this.className='dr-spnr-bn rich-spinner-button'" onmouseout="this.className='dr-spnr-bn rich-spinner-button'" />
<jsp:scriptlet><![CDATA[
} else {
]]></jsp:scriptlet>
19 years, 1 month
JBoss Rich Faces SVN: r67 - trunk/richfaces/inputnumber-slider/src/main/templates.
by richfaces-svn-commits@lists.jboss.org
Author: F.antonov
Date: 2007-03-14 10:14:30 -0400 (Wed, 14 Mar 2007)
New Revision: 67
Modified:
trunk/richfaces/inputnumber-slider/src/main/templates/inputNumberSlider.jspx
Log:
Fix for bug RFA-291.
Modified: trunk/richfaces/inputnumber-slider/src/main/templates/inputNumberSlider.jspx
===================================================================
--- trunk/richfaces/inputnumber-slider/src/main/templates/inputNumberSlider.jspx 2007-03-14 14:12:33 UTC (rev 66)
+++ trunk/richfaces/inputnumber-slider/src/main/templates/inputNumberSlider.jspx 2007-03-14 14:14:30 UTC (rev 67)
@@ -86,7 +86,7 @@
<div style="position : relative">
<div id="#{clientId}Tip" class="dr-insldr-tip rich-inslider-tip #{component.attributes['tipClass']}" style="display: none;#{component.attributes['tipStyle']}">
</div>
- <div class="dr-insldr-handler rich-inslider-handler #{component.attributes['handleClass']}" style="#{component.attributes['handleStyle']}" id="#{clientId}Handle"></div>
+ <div class="dr-insldr-handler rich-inslider-handler #{component.attributes['handleClass']}" style="#{component.attributes['handleStyle']}" id="#{clientId}Handle"></div>
</div>
<div class="dr-insldr-track rich-inslider-track #{component.attributes['barClass']}" style="#{component.attributes['barStyle']}">
<table class="dr-insldr-track-decor-1" cellpadding="0" cellspacing="0">
@@ -99,10 +99,11 @@
</div>
<script type="text/javascript">
new Exadel.Slider(
- "#{clientId}Handle",
+ "#{clientId}Handle",
"#{clientId}Track",
"#{clientId}Tip",
"#{clientId}",
+ "#{component.attributes['handleSelectedClass']}",
{
range : $R(#{component.attributes['minValue']},#{component.attributes['maxValue']}),
step : "#{component.attributes['step']}",
19 years, 1 month
JBoss Rich Faces SVN: r66 - trunk/richfaces/inputnumber-slider/src/main/config/component.
by richfaces-svn-commits@lists.jboss.org
Author: F.antonov
Date: 2007-03-14 10:12:33 -0400 (Wed, 14 Mar 2007)
New Revision: 66
Modified:
trunk/richfaces/inputnumber-slider/src/main/config/component/inputNumberSlider.xml
Log:
Fix for bug RFA-291.
Modified: trunk/richfaces/inputnumber-slider/src/main/config/component/inputNumberSlider.xml
===================================================================
--- trunk/richfaces/inputnumber-slider/src/main/config/component/inputNumberSlider.xml 2007-03-14 13:38:13 UTC (rev 65)
+++ trunk/richfaces/inputnumber-slider/src/main/config/component/inputNumberSlider.xml 2007-03-14 14:12:33 UTC (rev 66)
@@ -169,16 +169,15 @@
<defaultvalue><![CDATA[""]]></defaultvalue>
</property>
<property>
- <name> handleStyle </name>
+ <name> handleClass </name>
<classname>java.lang.String</classname>
- <description>A style for control handle element.
- </description>
+ <description>A name of CSS class for a control handle element.</description>
<defaultvalue><![CDATA[""]]></defaultvalue>
</property>
<property>
- <name> handleClass </name>
+ <name> handleSelectedClass </name>
<classname>java.lang.String</classname>
- <description>A name of CSS class </description>
+ <description>A name of CSS class for a selected control handle element.</description>
<defaultvalue><![CDATA[""]]></defaultvalue>
</property>
<property>
19 years, 1 month
JBoss Rich Faces SVN: r65 - trunk/richfaces/drag-drop/src/main/resources/org/richfaces/renderkit/html/scripts.
by richfaces-svn-commits@lists.jboss.org
Author: sergeyhalipov
Date: 2007-03-14 09:38:13 -0400 (Wed, 14 Mar 2007)
New Revision: 65
Modified:
trunk/richfaces/drag-drop/src/main/resources/org/richfaces/renderkit/html/scripts/drag-indicator.js
Log:
Fix initial styling when mouse was released on dropZone that doesn't accept drag.
Modified: trunk/richfaces/drag-drop/src/main/resources/org/richfaces/renderkit/html/scripts/drag-indicator.js
===================================================================
--- trunk/richfaces/drag-drop/src/main/resources/org/richfaces/renderkit/html/scripts/drag-indicator.js 2007-03-13 22:08:43 UTC (rev 64)
+++ trunk/richfaces/drag-drop/src/main/resources/org/richfaces/renderkit/html/scripts/drag-indicator.js 2007-03-14 13:38:13 UTC (rev 65)
@@ -34,6 +34,7 @@
Element.hide(this);
this.style.position = '';
this.offsets = undefined;
+ this.leave();
},
position: function(x, y) {
19 years, 1 month
JBoss Rich Faces SVN: r64 - trunk/richfaces-samples/panel-sample/src/main/webapp.
by richfaces-svn-commits@lists.jboss.org
Author: ishabalov
Date: 2007-03-13 18:08:43 -0400 (Tue, 13 Mar 2007)
New Revision: 64
Modified:
trunk/richfaces-samples/panel-sample/src/main/webapp/panel.xhtml
Log:
Add sample of form inside of panel
Modified: trunk/richfaces-samples/panel-sample/src/main/webapp/panel.xhtml
===================================================================
--- trunk/richfaces-samples/panel-sample/src/main/webapp/panel.xhtml 2007-03-13 20:58:44 UTC (rev 63)
+++ trunk/richfaces-samples/panel-sample/src/main/webapp/panel.xhtml 2007-03-13 22:08:43 UTC (rev 64)
@@ -46,7 +46,9 @@
Test<br/>
Test<br/>
</a4j:facet>
- Body text
+ <h:form>
+ <h:outputText value="inside the form"/>
+ </h:form>
</panel:panel>
</body>
</html>
19 years, 1 month
JBoss Rich Faces SVN: r63 - in trunk/richfaces-samples/dragDropDemo/src/main: webapp/pages and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2007-03-13 16:58:44 -0400 (Tue, 13 Mar 2007)
New Revision: 63
Modified:
trunk/richfaces-samples/dragDropDemo/src/main/java/org/richfaces/Bean.java
trunk/richfaces-samples/dragDropDemo/src/main/webapp/pages/index.jsp
Log:
Test cases updated to comply with new DnD supports
Modified: trunk/richfaces-samples/dragDropDemo/src/main/java/org/richfaces/Bean.java
===================================================================
--- trunk/richfaces-samples/dragDropDemo/src/main/java/org/richfaces/Bean.java 2007-03-13 20:58:09 UTC (rev 62)
+++ trunk/richfaces-samples/dragDropDemo/src/main/java/org/richfaces/Bean.java 2007-03-13 20:58:44 UTC (rev 63)
@@ -66,8 +66,8 @@
return null;
}
- public String action() {
- System.out.println("Bean.action()");
+ public String dropAction() {
+ System.out.println("Bean.dropAction()");
return null;
}
Modified: trunk/richfaces-samples/dragDropDemo/src/main/webapp/pages/index.jsp
===================================================================
--- trunk/richfaces-samples/dragDropDemo/src/main/webapp/pages/index.jsp 2007-03-13 20:58:09 UTC (rev 62)
+++ trunk/richfaces-samples/dragDropDemo/src/main/webapp/pages/index.jsp 2007-03-13 20:58:44 UTC (rev 63)
@@ -3,7 +3,7 @@
<%@ taglib uri="https://ajax4jsf.dev.java.net/ajax" prefix="a4j" %>
-<%@ taglib uri="http://richfaces.ajax4jsf.org/drag-drop" prefix="dnd" %>
+<%@ taglib uri="http://labs.jboss.com/jbossrichfaces/drag-drop" prefix="dnd" %>
<html>
<head>
@@ -30,7 +30,7 @@
<h:panelGrid styleClass="dropzoneDecoration" id="drop1">
<h:outputText value="#{type} - drop" />
- <dnd:dropSupport reRender="dragValueText" action="#{bean.action}" acceptedTypes="#{type}" dropListener="#{bean.processDrop}" dropValue="#{type} - value">
+ <dnd:dropSupport reRender="dragValueText" action="#{bean.dropAction}" acceptedTypes="#{type}" dropListener="#{bean.processDrop}" dropValue="#{type} - value">
<a4j:actionparam value="#{type} - test drop param" assignTo="#{bean.testParam}" />
</dnd:dropSupport>
</h:panelGrid>
@@ -54,7 +54,7 @@
<h:panelGrid styleClass="dropzoneDecoration" id="drop2">
<h:outputText value="#{type} - drop" />
- <dnd:dropSupport reRender="dragValueText" action="#{bean.action}" acceptedTypes="#{type}" dropListener="#{bean.processDrop}" dropValue="#{type} - value">
+ <dnd:dropSupport reRender="dragValueText" action="#{bean.dropAction}" acceptedTypes="#{type}" dropListener="#{bean.processDrop}" dropValue="#{type} - value">
</dnd:dropSupport>
</h:panelGrid>
</h:column>
@@ -194,10 +194,19 @@
</f:verbatim>
</h:panelGrid>
- <h:panelGrid id="renderedIdII">
+ <h:panelGroup id="group">
+ <f:verbatim>
+ PanelGroup
+ </f:verbatim>
<dnd:dropSupport acceptedTypes="file" dropListener="#{bean.processDrop}" />
+ </h:panelGroup>
+
+ <h:panelGrid id="renderedIdII" style="border: 1px solid red;">
+ <dnd:dropSupport acceptedTypes="file" dropListener="#{bean.processDrop}" />
<f:verbatim>
- dropSupport
+ <div style="margin: 40px; border: 1px solid green;">
+ dropSupport
+ </div>
</f:verbatim>
</h:panelGrid>
@@ -206,6 +215,14 @@
<h:messages />
</a4j:outputPanel>
+ <h:outputText>
+ <dnd:dropSupport acceptedTypes="file" />
+ </h:outputText>
+
+ <h:outputText>
+ <dnd:dragSupport dragType="file" />
+ </h:outputText>
+
<iframe src="pages/test.html"></iframe>
</h:form>
</f:view>
19 years, 1 month
JBoss Rich Faces SVN: r62 - in trunk/richfaces/drag-drop/src/main: java/org/richfaces/component and 3 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2007-03-13 16:58:09 -0400 (Tue, 13 Mar 2007)
New Revision: 62
Removed:
trunk/richfaces/drag-drop/src/main/java/org/richfaces/taglib/EventInjectionSupportHandler.java
Modified:
trunk/richfaces/drag-drop/src/main/config/component/dragSupport.xml
trunk/richfaces/drag-drop/src/main/config/component/dropSupport.xml
trunk/richfaces/drag-drop/src/main/java/org/richfaces/component/UIDragSupport.java
trunk/richfaces/drag-drop/src/main/java/org/richfaces/component/UIDropSupport.java
trunk/richfaces/drag-drop/src/main/java/org/richfaces/renderkit/html/DragSupportRenderer.java
trunk/richfaces/drag-drop/src/main/java/org/richfaces/renderkit/html/DropSupportRenderer.java
trunk/richfaces/drag-drop/src/main/java/org/richfaces/taglib/DragSupportHandler.java
trunk/richfaces/drag-drop/src/main/java/org/richfaces/taglib/DropSupportHandler.java
trunk/richfaces/drag-drop/src/main/resources/org/richfaces/renderkit/html/scripts/simple-draggable.js
trunk/richfaces/drag-drop/src/main/resources/org/richfaces/renderkit/html/scripts/simple-dropzone.js
Log:
DnD supports switched from attributes a4j:support mechanism to rendering <script> elements registering evt. listeners
Modified: trunk/richfaces/drag-drop/src/main/config/component/dragSupport.xml
===================================================================
--- trunk/richfaces/drag-drop/src/main/config/component/dragSupport.xml 2007-03-13 20:56:05 UTC (rev 61)
+++ trunk/richfaces/drag-drop/src/main/config/component/dragSupport.xml 2007-03-13 20:58:09 UTC (rev 62)
@@ -17,11 +17,12 @@
<tag>
<name>dragSupport</name>
<classname>org.richfaces.taglib.DragSupportTag</classname>
- <superclass>org.ajax4jsf.taglib.ajax.AjaxSupport</superclass>
+ <superclass>org.ajax4jsf.framework.taglib.HtmlComponentTagBase</superclass>
</tag>
<taghandler>
<classname>org.richfaces.taglib.DragSupportHandler</classname>
</taghandler>
+
&draggable_attributes;
&ui_component_attributes;
<!--
@@ -35,22 +36,22 @@
-->
</component>
- <listener>
- <name>dragListener</name>
- <listenerclass>
- org.ajax4jsf.dnd.event.DragListener
- </listenerclass>
- <componentclass>
- org.ajax4jsf.dnd.Draggable
- </componentclass>
- <eventclass>
- org.ajax4jsf.dnd.event.DragEvent
- </eventclass>
- <methodname>addDropListener</methodname>
- <taghandler generate="true">
- <classname>
- org.richfaces.taglib.DragListenerHandler
- </classname>
- </taghandler>
- </listener>
+
+ <listener>
+ <name>dragListener</name>
+ <listenerclass>
+ org.ajax4jsf.dnd.event.DragListener
+ </listenerclass>
+ <componentclass>
+ org.ajax4jsf.dnd.Draggable
+ </componentclass>
+ <eventclass>
+ org.ajax4jsf.dnd.event.DragEvent
+ </eventclass>
+ <taghandler generate="true">
+ <classname>
+ org.richfaces.taglib.DragListenerHandler
+ </classname>
+ </taghandler>
+ </listener>
</components>
Modified: trunk/richfaces/drag-drop/src/main/config/component/dropSupport.xml
===================================================================
--- trunk/richfaces/drag-drop/src/main/config/component/dropSupport.xml 2007-03-13 20:56:05 UTC (rev 61)
+++ trunk/richfaces/drag-drop/src/main/config/component/dropSupport.xml 2007-03-13 20:58:09 UTC (rev 62)
@@ -18,7 +18,7 @@
<tag>
<name>dropSupport</name>
<classname>org.richfaces.taglib.DropSupportTag</classname>
- <superclass>org.ajax4jsf.taglib.ajax.AjaxSupport</superclass>
+ <superclass>org.ajax4jsf.framework.taglib.HtmlComponentTagBase</superclass>
</tag>
<taghandler>
<classname>org.richfaces.taglib.DropSupportHandler</classname>
Modified: trunk/richfaces/drag-drop/src/main/java/org/richfaces/component/UIDragSupport.java
===================================================================
--- trunk/richfaces/drag-drop/src/main/java/org/richfaces/component/UIDragSupport.java 2007-03-13 20:56:05 UTC (rev 61)
+++ trunk/richfaces/drag-drop/src/main/java/org/richfaces/component/UIDragSupport.java 2007-03-13 20:58:09 UTC (rev 62)
@@ -21,35 +21,23 @@
package org.richfaces.component;
-import java.io.IOException;
-
-import javax.faces.FacesException;
-import javax.faces.component.UIComponent;
-import javax.faces.context.FacesContext;
import javax.faces.el.MethodBinding;
import javax.faces.event.AbortProcessingException;
import javax.faces.event.ActionEvent;
import javax.faces.event.FacesEvent;
import javax.faces.event.PhaseId;
-import org.ajax4jsf.ajax.UIAjaxSupport;
import org.ajax4jsf.dnd.Draggable;
import org.ajax4jsf.dnd.event.DragEvent;
import org.ajax4jsf.dnd.event.DragListener;
+import org.ajax4jsf.framework.ajax.AjaxActionComponent;
import org.ajax4jsf.framework.ajax.AjaxEvent;
-import org.ajax4jsf.framework.ajax.AjaxSupport;
-import org.ajax4jsf.framework.ajax.EventValueBinding;
-import org.ajax4jsf.framework.util.javascript.JSFunction;
-import org.richfaces.renderkit.DnDParametersEncoder;
-import org.richfaces.renderkit.DraggableRendererContributor;
-import org.richfaces.renderkit.RendererContributor;
-import org.richfaces.renderkit.ScriptOptions;
/**
* JSF component class
*
*/
-public abstract class UIDragSupport extends UIAjaxSupport implements AjaxSupport, Draggable {
+public abstract class UIDragSupport extends AjaxActionComponent implements Draggable {
private static final String COMPONENT_TYPE = "org.richfaces.DragSupport";
@@ -80,10 +68,6 @@
}
}
- public void setParentProperties(UIComponent component) {
- component.setValueBinding(getEvent(), new EventValueBinding(this));
- }
-
public void queueEvent(FacesEvent event) {
super.queueEvent(event);
if (event instanceof DragEvent) {
@@ -94,48 +78,4 @@
}
}
}
-
- public void setEvent(String event) {
- //TODO nick - exception message
- throw new UnsupportedOperationException();
- }
-
- public String getEventHandler(FacesContext context) {
- // Due to JSF RI 1.1 bug, clear cached clientId
- setId(getId());
-
- try {
- StringBuffer buffer = new StringBuffer("if (this.draggable) { this.draggable.eventMouseDown(event); return ;} this.draggable = ");
- JSFunction function = new JSFunction("new DnD.SimpleDraggable");
- function.addParameter(this.getParent().getClientId(context));
- RendererContributor contributor = DraggableRendererContributor.getInstance();
- ScriptOptions dragOptions = contributor.buildOptions(context, this);
-
- DnDParametersEncoder parametersEncoder = DnDParametersEncoder.getInstance();
- dragOptions.addOption("dndParams", parametersEncoder.doEncodeAsString(context, this));
-
- function.addParameter(dragOptions);
- function.appendScript(buffer);
-
- String scriptContribution = contributor.getScriptContribution(context, this);
- if (scriptContribution != null && scriptContribution.length() != 0) {
- buffer.append("; this.draggable" + scriptContribution);
- }
-
- buffer.append("; this.draggable.eventMouseDown(event);");
-
- return buffer.toString();
- } catch (IOException e) {
- throw new FacesException(e);
- }
- }
-
- public String getEventString() {
- FacesContext context = FacesContext.getCurrentInstance();
- return getEventHandler(context);
- }
-
- public String getEvent() {
- return "onmousedown";
- }
}
Modified: trunk/richfaces/drag-drop/src/main/java/org/richfaces/component/UIDropSupport.java
===================================================================
--- trunk/richfaces/drag-drop/src/main/java/org/richfaces/component/UIDropSupport.java 2007-03-13 20:56:05 UTC (rev 61)
+++ trunk/richfaces/drag-drop/src/main/java/org/richfaces/component/UIDropSupport.java 2007-03-13 20:58:09 UTC (rev 62)
@@ -21,35 +21,23 @@
package org.richfaces.component;
-import java.io.IOException;
-
-import javax.faces.FacesException;
-import javax.faces.component.UIComponent;
-import javax.faces.context.FacesContext;
import javax.faces.el.MethodBinding;
import javax.faces.event.AbortProcessingException;
import javax.faces.event.ActionEvent;
import javax.faces.event.FacesEvent;
import javax.faces.event.PhaseId;
-import org.ajax4jsf.ajax.UIAjaxSupport;
import org.ajax4jsf.dnd.Dropzone;
import org.ajax4jsf.dnd.event.DropEvent;
import org.ajax4jsf.dnd.event.DropListener;
+import org.ajax4jsf.framework.ajax.AjaxActionComponent;
import org.ajax4jsf.framework.ajax.AjaxEvent;
-import org.ajax4jsf.framework.ajax.AjaxSupport;
-import org.ajax4jsf.framework.ajax.EventValueBinding;
-import org.ajax4jsf.framework.util.javascript.JSFunction;
-import org.richfaces.renderkit.DnDParametersEncoder;
-import org.richfaces.renderkit.DropzoneRendererContributor;
-import org.richfaces.renderkit.RendererContributor;
-import org.richfaces.renderkit.ScriptOptions;
/**
* JSF component class
*
*/
-public abstract class UIDropSupport extends UIAjaxSupport implements AjaxSupport, Dropzone {
+public abstract class UIDropSupport extends AjaxActionComponent implements Dropzone {
private static final String COMPONENT_TYPE = "org.richfaces.DropSupport";
@@ -67,10 +55,6 @@
return (DropListener[]) getFacesListeners(DropListener.class);
}
- public void setParentProperties(UIComponent component) {
- component.setValueBinding(getEvent(), new EventValueBinding(this));
- }
-
public void broadcast(FacesEvent event) throws AbortProcessingException {
super.broadcast(event);
if (event instanceof DropEvent) {
@@ -95,44 +79,4 @@
}
}
}
-
- public String getEventString() {
- // Due to JSF RI 1.1 bug, clear cached clientId
- setId(getId());
-
- try {
- FacesContext context = FacesContext.getCurrentInstance();
-
- RendererContributor contributor = DropzoneRendererContributor.getInstance();
- StringBuffer buffer = new StringBuffer("if (this.dropZone) { this.dropZone.mouseoverBound(event); return ;} this.dropZone = ");
- JSFunction function = new JSFunction("new DnD.SimpleDropZone");
- function.addParameter(this.getParent().getClientId(context));
- ScriptOptions dropOptions = contributor.buildOptions(context, this);
-
- DnDParametersEncoder parametersEncoder = DnDParametersEncoder.getInstance();
- dropOptions.addOption("dndParams", parametersEncoder.doEncodeAsString(context, this));
-
- function.addParameter(dropOptions);
- function.appendScript(buffer);
-
- String scriptContribution = contributor.getScriptContribution(context, this);
- if (scriptContribution != null && scriptContribution.length() != 0) {
- buffer.append("; this.dropZone" + scriptContribution);
- }
-
- return buffer.toString() + "; this.dropZone.mouseoverBound(event);";
- } catch (IOException e) {
- throw new FacesException(e);
- }
- }
-
- public void setEvent(String event) {
- //TODO nick - exception message
- throw new UnsupportedOperationException();
- }
-
- public String getEvent() {
- return "onmouseover";
- }
-
}
Modified: trunk/richfaces/drag-drop/src/main/java/org/richfaces/renderkit/html/DragSupportRenderer.java
===================================================================
--- trunk/richfaces/drag-drop/src/main/java/org/richfaces/renderkit/html/DragSupportRenderer.java 2007-03-13 20:56:05 UTC (rev 61)
+++ trunk/richfaces/drag-drop/src/main/java/org/richfaces/renderkit/html/DragSupportRenderer.java 2007-03-13 20:58:09 UTC (rev 62)
@@ -21,10 +21,21 @@
package org.richfaces.renderkit.html;
+import java.io.IOException;
+
+import javax.faces.component.UIComponent;
+import javax.faces.context.FacesContext;
+import javax.faces.context.ResponseWriter;
+
+import org.ajax4jsf.framework.renderer.RendererUtils.HTML;
import org.ajax4jsf.framework.resource.InternetResource;
+import org.ajax4jsf.framework.util.javascript.JSFunction;
import org.richfaces.component.UIDragSupport;
import org.richfaces.renderkit.CompositeRenderer;
+import org.richfaces.renderkit.DnDParametersEncoder;
import org.richfaces.renderkit.DraggableRendererContributor;
+import org.richfaces.renderkit.RendererContributor;
+import org.richfaces.renderkit.ScriptOptions;
/**
* @author Nick Belaevski - nbelaevski(a)exadel.com
@@ -45,7 +56,7 @@
protected Class getComponentClass() {
return UIDragSupport.class;
}
-
+
protected InternetResource[] getScripts() {
InternetResource[] resources = super.getScripts();
InternetResource[] result = new InternetResource[resources.length + 1];
@@ -53,4 +64,32 @@
result[result.length - 1] = getResource("/org/richfaces/renderkit/html/scripts/simple-draggable.js");
return result;
}
+
+ public void encodeEnd(FacesContext context, UIComponent component)
+ throws IOException {
+ super.encodeEnd(context, component);
+ StringBuffer buffer = new StringBuffer();
+ JSFunction function = new JSFunction("new DnD.SimpleDraggable");
+ function.addParameter(component.getParent().getClientId(context));
+ RendererContributor contributor = DraggableRendererContributor.getInstance();
+ ScriptOptions dragOptions = contributor.buildOptions(context, component);
+
+ DnDParametersEncoder parametersEncoder = DnDParametersEncoder.getInstance();
+ dragOptions.addOption("dndParams", parametersEncoder.doEncodeAsString(context, component));
+
+ function.addParameter(dragOptions);
+ function.appendScript(buffer);
+
+ String scriptContribution = contributor.getScriptContribution(context, component);
+ if (scriptContribution != null && scriptContribution.length() != 0) {
+ buffer.append(scriptContribution);
+ }
+
+ ResponseWriter writer = context.getResponseWriter();
+
+ writer.startElement(HTML.SCRIPT_ELEM, component);
+ writer.writeAttribute("id", component.getClientId(context), "id");
+ writer.write(buffer.toString());
+ writer.endElement(HTML.SCRIPT_ELEM);
+ }
}
Modified: trunk/richfaces/drag-drop/src/main/java/org/richfaces/renderkit/html/DropSupportRenderer.java
===================================================================
--- trunk/richfaces/drag-drop/src/main/java/org/richfaces/renderkit/html/DropSupportRenderer.java 2007-03-13 20:56:05 UTC (rev 61)
+++ trunk/richfaces/drag-drop/src/main/java/org/richfaces/renderkit/html/DropSupportRenderer.java 2007-03-13 20:58:09 UTC (rev 62)
@@ -21,10 +21,21 @@
package org.richfaces.renderkit.html;
+import java.io.IOException;
+
+import javax.faces.component.UIComponent;
+import javax.faces.context.FacesContext;
+import javax.faces.context.ResponseWriter;
+
+import org.ajax4jsf.framework.renderer.RendererUtils.HTML;
import org.ajax4jsf.framework.resource.InternetResource;
+import org.ajax4jsf.framework.util.javascript.JSFunction;
import org.richfaces.component.UIDropSupport;
import org.richfaces.renderkit.CompositeRenderer;
+import org.richfaces.renderkit.DnDParametersEncoder;
import org.richfaces.renderkit.DropzoneRendererContributor;
+import org.richfaces.renderkit.RendererContributor;
+import org.richfaces.renderkit.ScriptOptions;
/**
* @author Nick Belaevski - nbelaevski(a)exadel.com
@@ -53,5 +64,33 @@
result[result.length - 1] = getResource("/org/richfaces/renderkit/html/scripts/simple-dropzone.js");
return result;
}
-
+
+ public void encodeEnd(FacesContext context, UIComponent component)
+ throws IOException {
+ super.encodeEnd(context, component);
+
+ RendererContributor contributor = DropzoneRendererContributor.getInstance();
+ StringBuffer buffer = new StringBuffer();
+ JSFunction function = new JSFunction("new DnD.SimpleDropZone");
+ function.addParameter(component.getParent().getClientId(context));
+ ScriptOptions dropOptions = contributor.buildOptions(context, component);
+
+ DnDParametersEncoder parametersEncoder = DnDParametersEncoder.getInstance();
+ dropOptions.addOption("dndParams", parametersEncoder.doEncodeAsString(context, component));
+
+ function.addParameter(dropOptions);
+ function.appendScript(buffer);
+
+ String scriptContribution = contributor.getScriptContribution(context, component);
+ if (scriptContribution != null && scriptContribution.length() != 0) {
+ buffer.append(scriptContribution);
+ }
+
+ ResponseWriter writer = context.getResponseWriter();
+
+ writer.startElement(HTML.SCRIPT_ELEM, component);
+ writer.writeAttribute("id", component.getClientId(context), "id");
+ writer.write(buffer.toString());
+ writer.endElement(HTML.SCRIPT_ELEM);
+ }
}
Modified: trunk/richfaces/drag-drop/src/main/java/org/richfaces/taglib/DragSupportHandler.java
===================================================================
--- trunk/richfaces/drag-drop/src/main/java/org/richfaces/taglib/DragSupportHandler.java 2007-03-13 20:56:05 UTC (rev 61)
+++ trunk/richfaces/drag-drop/src/main/java/org/richfaces/taglib/DragSupportHandler.java 2007-03-13 20:58:09 UTC (rev 62)
@@ -38,7 +38,12 @@
* created 01.03.2007
*
*/
-public class DragSupportHandler extends EventInjectionSupportHandler {
+public class DragSupportHandler extends AjaxComponentHandler {
+
+ public DragSupportHandler(ComponentConfig config) {
+ super(config);
+ }
+
public static class DragHandler extends AjaxComponentHandler {
private static final DragSupportHandlerMetaRule metaRule = new DragSupportHandlerMetaRule();
@@ -110,15 +115,4 @@
}
- public DragSupportHandler(ComponentConfig componentConfig) {
- super(componentConfig, new DragHandler(componentConfig));
- }
-
- /* (non-Javadoc)
- * @see org.richfaces.taglib.EventInjectionSupportHandler#getEventName()
- */
- protected String getEventName() {
- return "onmousedown";
- }
-
}
Modified: trunk/richfaces/drag-drop/src/main/java/org/richfaces/taglib/DropSupportHandler.java
===================================================================
--- trunk/richfaces/drag-drop/src/main/java/org/richfaces/taglib/DropSupportHandler.java 2007-03-13 20:56:05 UTC (rev 61)
+++ trunk/richfaces/drag-drop/src/main/java/org/richfaces/taglib/DropSupportHandler.java 2007-03-13 20:58:09 UTC (rev 62)
@@ -37,7 +37,12 @@
* @author Nick - mailto:nbelaevski@exadel.com created 01.03.2007
*
*/
-public class DropSupportHandler extends EventInjectionSupportHandler {
+public class DropSupportHandler extends AjaxComponentHandler {
+
+ public DropSupportHandler(ComponentConfig config) {
+ super(config);
+ }
+
public static class DropHandler extends AjaxComponentHandler {
private static final DropSupportHandlerMetaRule metaRule = new DropSupportHandlerMetaRule();
@@ -108,18 +113,4 @@
}
}
-
- public DropSupportHandler(ComponentConfig componentConfig) {
- super(componentConfig, new DropHandler(componentConfig));
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.richfaces.taglib.EventInjectionSupportHandler#getEventName()
- */
- protected String getEventName() {
- return "onmouseover";
- }
-
}
Deleted: trunk/richfaces/drag-drop/src/main/java/org/richfaces/taglib/EventInjectionSupportHandler.java
===================================================================
--- trunk/richfaces/drag-drop/src/main/java/org/richfaces/taglib/EventInjectionSupportHandler.java 2007-03-13 20:56:05 UTC (rev 61)
+++ trunk/richfaces/drag-drop/src/main/java/org/richfaces/taglib/EventInjectionSupportHandler.java 2007-03-13 20:58:09 UTC (rev 62)
@@ -1,85 +0,0 @@
-/**
- * License Agreement.
- *
- * JBoss RichFaces 3.0 - Ajax4jsf Component Library
- *
- * Copyright (C) 2007 Exadel, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License version 2.1 as published by the Free Software Foundation.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-package org.richfaces.taglib;
-
-import java.io.IOException;
-
-import javax.el.ELException;
-import javax.faces.FacesException;
-import javax.faces.component.UIComponent;
-import javax.faces.component.UIComponentBase;
-
-import org.ajax4jsf.taglib.html.facelets.AjaxSupportHandler;
-
-import com.sun.facelets.FaceletContext;
-import com.sun.facelets.FaceletException;
-import com.sun.facelets.tag.TagHandler;
-import com.sun.facelets.tag.jsf.ComponentConfig;
-
-/**
- * @author Nick - mailto:nbelaevski@exadel.com
- * created 24.02.2007
- *
- * Higher abstraction of {@link AjaxSupportHandler}
- */
-public abstract class EventInjectionSupportHandler extends TagHandler {
-
- private TagHandler baseHandler;
-
- private static final class EventInjectionSupportFacet extends UIComponentBase {
-
- public String getFamily() {
- return null;
- }
- }
-
- protected abstract String getEventName();
-
- public EventInjectionSupportHandler(ComponentConfig componentConfig, TagHandler tagHandler) {
- super(componentConfig);
-
- this.baseHandler = tagHandler;
- }
-
- public void apply(FaceletContext faceletContext, UIComponent parent)
- throws IOException, FacesException, FaceletException, ELException {
- String eventName = getEventName();
- // our id
-// String id = ctx.generateUniqueId(this.tagId);
- EventInjectionSupportFacet facet = new EventInjectionSupportFacet();
- // Find facet for support component
- String facetName = EventInjectionSupportHandler.class.getName() + "_" + eventName;
- UIComponent c = parent.getFacet(facetName);
- if (null != c) {
- parent.getFacets().remove(facetName);
- facet.getChildren().add(c);
- }
- this.baseHandler.apply(faceletContext, facet);
-
- c = (UIComponent) facet.getChildren().get(0);
- parent.getFacets().put(facetName, c);
- // Fix for possible incompabilites in different frameworks.
-// c.setParentProperties(parent);
-
- }
-
-}
Modified: trunk/richfaces/drag-drop/src/main/resources/org/richfaces/renderkit/html/scripts/simple-draggable.js
===================================================================
--- trunk/richfaces/drag-drop/src/main/resources/org/richfaces/renderkit/html/scripts/simple-draggable.js 2007-03-13 20:56:05 UTC (rev 61)
+++ trunk/richfaces/drag-drop/src/main/resources/org/richfaces/renderkit/html/scripts/simple-draggable.js 2007-03-13 20:58:09 UTC (rev 62)
@@ -4,13 +4,19 @@
Object.extend(DnD.SimpleDraggable.prototype, {
initialize: function(id, options) {
this.id = $(id);
+
+ if (!this.id) {
+ alert("drag: Element with [" + id + "] ID was not found in the DOM tree. Probably element has no client ID or client ID hasn't been written. DnD's disabled. Check please!");
+ return ;
+ }
+
this.options = options;
this.dragIndicatorId = this.options.dragIndicator;
this.eventMouseDown = this.initDrag.bindAsEventListener(this);
- //Event.observe(this.id, "mousedown", this.eventMouseDown);
+ Event.observe(this.id, "mousedown", this.eventMouseDown);
},
getDnDDragParams: function() {
Modified: trunk/richfaces/drag-drop/src/main/resources/org/richfaces/renderkit/html/scripts/simple-dropzone.js
===================================================================
--- trunk/richfaces/drag-drop/src/main/resources/org/richfaces/renderkit/html/scripts/simple-dropzone.js 2007-03-13 20:56:05 UTC (rev 61)
+++ trunk/richfaces/drag-drop/src/main/resources/org/richfaces/renderkit/html/scripts/simple-dropzone.js 2007-03-13 20:58:09 UTC (rev 62)
@@ -4,6 +4,12 @@
initialize: function(id, options) {
this.id = id;
var element = $(id);
+
+ if (!element) {
+ alert("drop: Element with [" + id + "] ID was not found in the DOM tree. Probably element has no client ID or client ID hasn't been written. DnD's disabled. Check please!");
+ return ;
+ }
+
this.element = element;
if (options.acceptedTypes) {
this.acceptedTypes = options.acceptedTypes;
@@ -21,7 +27,7 @@
this.mouseoutBound = this.mouseout.bindAsEventListener(this);
this.mouseupBound = this.mouseup.bindAsEventListener(this);
- //Event.observe(element, "mouseover", this.mouseoverBound);
+ Event.observe(element, "mouseover", this.mouseoverBound);
Event.observe(element, "mouseout", this.mouseoutBound);
Event.observe(element, "mouseup", this.mouseupBound);
19 years, 1 month
JBoss Rich Faces SVN: r61 - in trunk/richfaces/drag-drop/src/main: templates/org/richfaces and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2007-03-13 16:56:05 -0400 (Tue, 13 Mar 2007)
New Revision: 61
Modified:
trunk/richfaces/drag-drop/src/main/java/org/richfaces/renderkit/DragIndicatorRendererBase.java
trunk/richfaces/drag-drop/src/main/templates/org/richfaces/htmlDragIndicator.jspx
Log:
CDATA sectioning corrected
Modified: trunk/richfaces/drag-drop/src/main/java/org/richfaces/renderkit/DragIndicatorRendererBase.java
===================================================================
--- trunk/richfaces/drag-drop/src/main/java/org/richfaces/renderkit/DragIndicatorRendererBase.java 2007-03-13 20:39:09 UTC (rev 60)
+++ trunk/richfaces/drag-drop/src/main/java/org/richfaces/renderkit/DragIndicatorRendererBase.java 2007-03-13 20:56:05 UTC (rev 61)
@@ -135,6 +135,9 @@
throws IOException {
ResponseWriter responseWriter = context.getResponseWriter();
+ //surround by CDATAs
+ responseWriter.write("/*<![CDATA[*/");
+
for (Iterator iterator = MARKERS_PREDEFINED.iterator(); iterator.hasNext();) {
String markerName = (String) iterator.next();
@@ -172,5 +175,8 @@
responseWriter.write(result + ";\n new Insertion.Top(element, content);\n");
responseWriter.write("};");
}
+
+ //surround by CDATAs
+ responseWriter.write("/*]]>*/");
}
}
Modified: trunk/richfaces/drag-drop/src/main/templates/org/richfaces/htmlDragIndicator.jspx
===================================================================
--- trunk/richfaces/drag-drop/src/main/templates/org/richfaces/htmlDragIndicator.jspx 2007-03-13 20:39:09 UTC (rev 60)
+++ trunk/richfaces/drag-drop/src/main/templates/org/richfaces/htmlDragIndicator.jspx 2007-03-13 20:56:05 UTC (rev 61)
@@ -22,15 +22,15 @@
<div id="#{clientId}" class="drgind_fly drgind_default drag_indicator #{component.attributes['styleClass']}" style="display: none; #{component.attributes['style']}">
<script type="text/javascript">
- //<![CDATA[
+ /*<![CDATA[*/
var elt = $("#{clientId}");
elt.markers = {};
elt.indicatorTemplates = {};
- //]]>
+ /*]]>*/
<f:call name="encodeChildScripts" />
- //<![CDATA[
+ /*<![CDATA[*/
createDragIndicator(elt);
- //]]>
+ /*]]>*/
</script>
<vcp:body />
</div>
19 years, 1 month
JBoss Rich Faces SVN: r60 - trunk/richfaces-samples/simpleTogglePanel-sample/src/main/webapp/pages.
by richfaces-svn-commits@lists.jboss.org
Author: ishabalov
Date: 2007-03-13 16:39:09 -0400 (Tue, 13 Mar 2007)
New Revision: 60
Modified:
trunk/richfaces-samples/simpleTogglePanel-sample/src/main/webapp/pages/index.jsp
Log:
Added sample for client switch type without form
Modified: trunk/richfaces-samples/simpleTogglePanel-sample/src/main/webapp/pages/index.jsp
===================================================================
--- trunk/richfaces-samples/simpleTogglePanel-sample/src/main/webapp/pages/index.jsp 2007-03-13 20:38:30 UTC (rev 59)
+++ trunk/richfaces-samples/simpleTogglePanel-sample/src/main/webapp/pages/index.jsp 2007-03-13 20:39:09 UTC (rev 60)
@@ -150,6 +150,15 @@
</stp:simpleTogglePanel>
<h:commandLink value="apply!"/>
</h:form>
+ <stp:simpleTogglePanel opened="true" switchType="client" id="p11" label="panel 11 panel" headerClass="customHeader">
+ <stp:simpleTogglePanel opened="true" switchType="client" id="p22" label="panel1">
+ <h:outputText style="font: 18px;font-weight: bold;" value="Test"/>
+ <stp:simpleTogglePanel opened="true" switchType="client" id="p3" label="panel2">
+ <h:outputText style="font: 18px;font-weight: bold;" value="Test"/>
+ </stp:simpleTogglePanel>
+ </stp:simpleTogglePanel>
+ </stp:simpleTogglePanel>
+
</f:view>
</body>
</html>
19 years, 1 month