JBoss Rich Faces SVN: r3926 - in branches/3.1.x: framework/impl/src/main/resources/org/richfaces/renderkit/html/scripts/dnd and 4 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2007-11-12 11:10:43 -0500 (Mon, 12 Nov 2007)
New Revision: 3926
Added:
branches/3.1.x/framework/api/src/main/java/org/richfaces/event/DnDEvent.java
Removed:
branches/3.1.x/framework/api/src/main/java/org/richfaces/event/DropListenerBinding.java
Modified:
branches/3.1.x/framework/api/src/main/java/org/richfaces/event/DragEvent.java
branches/3.1.x/framework/api/src/main/java/org/richfaces/event/DropEvent.java
branches/3.1.x/framework/impl/src/main/resources/org/richfaces/renderkit/html/scripts/dnd/dnd-dropzone.js
branches/3.1.x/samples/dragDropDemo/src/main/webapp/pages/index.jsp
branches/3.1.x/ui/drag-drop/src/main/java/org/richfaces/component/UIDragSupport.java
branches/3.1.x/ui/drag-drop/src/main/java/org/richfaces/component/UIDropSupport.java
branches/3.1.x/ui/drag-drop/src/main/java/org/richfaces/renderkit/DnDEventsExchangeMailer.java
branches/3.1.x/ui/drag-drop/src/main/java/org/richfaces/renderkit/DnDValidator.java
branches/3.1.x/ui/drag-drop/src/main/java/org/richfaces/renderkit/DraggableRendererContributor.java
branches/3.1.x/ui/drag-drop/src/main/java/org/richfaces/renderkit/DropzoneRendererContributor.java
branches/3.1.x/ui/tree/src/main/java/org/richfaces/component/events/TreeEvents.java
Log:
http://jira.jboss.com/jira/browse/RF-1330
Copied: branches/3.1.x/framework/api/src/main/java/org/richfaces/event/DnDEvent.java (from rev 3901, trunk/framework/api/src/main/java/org/richfaces/event/DnDEvent.java)
===================================================================
--- branches/3.1.x/framework/api/src/main/java/org/richfaces/event/DnDEvent.java (rev 0)
+++ branches/3.1.x/framework/api/src/main/java/org/richfaces/event/DnDEvent.java 2007-11-12 16:10:43 UTC (rev 3926)
@@ -0,0 +1,68 @@
+/**
+ * License Agreement.
+ *
+ * JBoss RichFaces - 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.event;
+
+import javax.faces.component.UIComponent;
+import javax.faces.event.FacesEvent;
+import javax.faces.event.FacesListener;
+
+/**
+ *
+ * <br /><br />
+ *
+ * Created 12.11.2007
+ * @author Nick Belaevski
+ * @since 3.2
+ */
+
+public abstract class DnDEvent extends FacesEvent {
+ /**
+ *
+ */
+ private static final long serialVersionUID = -2455016405742082110L;
+
+ public DnDEvent(UIComponent component) {
+ super(component);
+ }
+
+ protected Object value;
+
+ private boolean valid = true;
+
+ public boolean isAppropriateListener(FacesListener listener) {
+ return valid;
+ }
+
+ public void invalidate() {
+ valid = false;
+ }
+
+ public boolean isValid() {
+ return valid;
+ }
+
+ public void processListener(FacesListener listener) {
+ if (!valid) {
+ throw new IllegalStateException();
+ }
+ }
+}
Modified: branches/3.1.x/framework/api/src/main/java/org/richfaces/event/DragEvent.java
===================================================================
--- branches/3.1.x/framework/api/src/main/java/org/richfaces/event/DragEvent.java 2007-11-12 16:02:11 UTC (rev 3925)
+++ branches/3.1.x/framework/api/src/main/java/org/richfaces/event/DragEvent.java 2007-11-12 16:10:43 UTC (rev 3926)
@@ -22,7 +22,6 @@
package org.richfaces.event;
import javax.faces.component.UIComponent;
-import javax.faces.event.FacesEvent;
import javax.faces.event.FacesListener;
import org.richfaces.component.Draggable;
@@ -33,11 +32,10 @@
* created 27.12.2006
*
*/
-public class DragEvent extends FacesEvent {
+public class DragEvent extends DnDEvent {
private Dropzone dropTarget;
private Object acceptedTypes;
- private Object dropValue;
/**
*
*/
@@ -51,13 +49,14 @@
* @see javax.faces.event.FacesEvent#isAppropriateListener(javax.faces.event.FacesListener)
*/
public boolean isAppropriateListener(FacesListener faceslistener) {
- return faceslistener instanceof DragListener;
+ return super.isAppropriateListener(faceslistener) && faceslistener instanceof DragListener;
}
/* (non-Javadoc)
* @see javax.faces.event.FacesEvent#processListener(javax.faces.event.FacesListener)
*/
public void processListener(FacesListener faceslistener) {
+ super.processListener(faceslistener);
((DragListener) faceslistener).processDrag(this);
}
@@ -94,10 +93,10 @@
}
public Object getDropValue() {
- return dropValue;
+ return value;
}
public void setDropValue(Object dropValue) {
- this.dropValue = dropValue;
+ this.value = dropValue;
}
}
Modified: branches/3.1.x/framework/api/src/main/java/org/richfaces/event/DropEvent.java
===================================================================
--- branches/3.1.x/framework/api/src/main/java/org/richfaces/event/DropEvent.java 2007-11-12 16:02:11 UTC (rev 3925)
+++ branches/3.1.x/framework/api/src/main/java/org/richfaces/event/DropEvent.java 2007-11-12 16:10:43 UTC (rev 3926)
@@ -22,7 +22,6 @@
package org.richfaces.event;
import javax.faces.component.UIComponent;
-import javax.faces.event.FacesEvent;
import javax.faces.event.FacesListener;
import org.richfaces.component.Draggable;
@@ -32,7 +31,7 @@
* @author shura
*
*/
-public class DropEvent extends FacesEvent {
+public class DropEvent extends DnDEvent {
/**
*
@@ -41,7 +40,6 @@
private Draggable draggableSource;
private String dragType;
- private Object dragValue;
public DropEvent(UIComponent component) {
super(component);
@@ -51,19 +49,15 @@
* @see javax.faces.event.FacesEvent#isAppropriateListener(javax.faces.event.FacesListener)
*/
public boolean isAppropriateListener(FacesListener listener) {
-
- return listener instanceof DropListener;
+ return super.isAppropriateListener(listener) && listener instanceof DropListener;
}
/* (non-Javadoc)
* @see javax.faces.event.FacesEvent#processListener(javax.faces.event.FacesListener)
*/
public void processListener(FacesListener listener) {
- if (listener instanceof DropListener) {
- DropListener dropListener = (DropListener) listener;
- dropListener.processDrop(this);
- }
-
+ super.processListener(listener);
+ ((DropListener) listener).processDrop(this);
}
/**
@@ -104,10 +98,10 @@
}
public Object getDragValue() {
- return dragValue;
+ return value;
}
public void setDragValue(Object dragValue) {
- this.dragValue = dragValue;
+ this.value = dragValue;
}
}
Deleted: branches/3.1.x/framework/api/src/main/java/org/richfaces/event/DropListenerBinding.java
===================================================================
--- branches/3.1.x/framework/api/src/main/java/org/richfaces/event/DropListenerBinding.java 2007-11-12 16:02:11 UTC (rev 3925)
+++ branches/3.1.x/framework/api/src/main/java/org/richfaces/event/DropListenerBinding.java 2007-11-12 16:10:43 UTC (rev 3926)
@@ -1,104 +0,0 @@
-/**
- * License Agreement.
- *
- * Rich Faces - Natural Ajax for Java Server Faces (JSF)
- *
- * 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.event;
-
-import javax.faces.component.StateHolder;
-import javax.faces.component.UIComponentBase;
-import javax.faces.context.FacesContext;
-import javax.faces.el.ValueBinding;
-
-/**
- * Wrapper for bind DrolListener to EL expression.
- * @author shura
- *
- */
-public class DropListenerBinding implements DropListener, StateHolder {
-
- private ValueBinding _binding;
-
- private String _dragType;
-
- private ValueBinding _dragTypeBinding;
-
- private boolean _transient = false;
-
- public DropListenerBinding() {
- }
-
- /**
- * @param binding
- */
- public DropListenerBinding(ValueBinding binding) {
- super();
- _binding = binding;
- }
-
- private DropListener getHandler(FacesContext context) {
- return (DropListener) _binding.getValue(context);
- }
-
- public void processDrop(DropEvent event) {
- DropListener handler = getHandler(FacesContext.getCurrentInstance());
- handler.processDrop(event);
- }
-
- public boolean isTransient() {
- // TODO Auto-generated method stub
- return _transient;
- }
-
- public void restoreState(FacesContext context, Object state) {
- _binding = (ValueBinding) UIComponentBase.restoreAttachedState(context, state);
-
- }
-
- public Object saveState(FacesContext context) {
- return UIComponentBase.saveAttachedState(context, _binding);
- }
-
- public void setTransient(boolean newTransientValue) {
- _transient = newTransientValue;
-
- }
-
- /**
- * @return the dragType
- */
- public String getDragType() {
- return _dragType;
- }
-
- /**
- * @param dragType the dragType to set
- */
- public void setDragType(String dragType) {
- _dragType = dragType;
- }
-
- /**
- * @param dragTypeBinding the dragTypeBinding to set
- */
- public void setDragTypeBinding(ValueBinding dragTypeBinding) {
- _dragTypeBinding = dragTypeBinding;
- }
-
-}
Modified: branches/3.1.x/framework/impl/src/main/resources/org/richfaces/renderkit/html/scripts/dnd/dnd-dropzone.js
===================================================================
--- branches/3.1.x/framework/impl/src/main/resources/org/richfaces/renderkit/html/scripts/dnd/dnd-dropzone.js 2007-11-12 16:02:11 UTC (rev 3925)
+++ branches/3.1.x/framework/impl/src/main/resources/org/richfaces/renderkit/html/scripts/dnd/dnd-dropzone.js 2007-11-12 16:10:43 UTC (rev 3926)
@@ -30,7 +30,7 @@
* @return
*/
accept: function(drag) {
- return this.getAcceptedTypes().indexOf(drag.type) > -1 ;
+ return DnD.CLIENT_VALIDATION_OFF || this.getAcceptedTypes().indexOf(drag.type) > -1 ;
},
getAcceptedTypes: function() {
return [];
Modified: branches/3.1.x/samples/dragDropDemo/src/main/webapp/pages/index.jsp
===================================================================
--- branches/3.1.x/samples/dragDropDemo/src/main/webapp/pages/index.jsp 2007-11-12 16:02:11 UTC (rev 3925)
+++ branches/3.1.x/samples/dragDropDemo/src/main/webapp/pages/index.jsp 2007-11-12 16:10:43 UTC (rev 3926)
@@ -25,6 +25,10 @@
</style>
</head>
<body>
+ <script type="text/javascript">
+ // DnD.CLIENT_VALIDATION_OFF = true;
+ </script>
+
<f:view>
<h:form id="form">
<h:selectOneRadio binding="#{skinBean.component}" />
Modified: branches/3.1.x/ui/drag-drop/src/main/java/org/richfaces/component/UIDragSupport.java
===================================================================
--- branches/3.1.x/ui/drag-drop/src/main/java/org/richfaces/component/UIDragSupport.java 2007-11-12 16:02:11 UTC (rev 3925)
+++ branches/3.1.x/ui/drag-drop/src/main/java/org/richfaces/component/UIDragSupport.java 2007-11-12 16:10:43 UTC (rev 3926)
@@ -58,13 +58,16 @@
public void broadcast(FacesEvent event) throws AbortProcessingException {
super.broadcast(event);
if (event instanceof DragEvent) {
- MethodBinding binding = getDragListener();
- if (binding != null) {
- binding.invoke(getFacesContext(), new Object[] {event});
+ DragEvent dragEvent = (DragEvent) event;
+ if (dragEvent.isValid()) {
+ MethodBinding binding = getDragListener();
+ if (binding != null) {
+ binding.invoke(getFacesContext(), new Object[] {event});
+ }
+
+ new AjaxEvent(this).queue();
+ new ActionEvent(this).queue();
}
-
- new AjaxEvent(this).queue();
- new ActionEvent(this).queue();
}
}
Modified: branches/3.1.x/ui/drag-drop/src/main/java/org/richfaces/component/UIDropSupport.java
===================================================================
--- branches/3.1.x/ui/drag-drop/src/main/java/org/richfaces/component/UIDropSupport.java 2007-11-12 16:02:11 UTC (rev 3925)
+++ branches/3.1.x/ui/drag-drop/src/main/java/org/richfaces/component/UIDropSupport.java 2007-11-12 16:10:43 UTC (rev 3926)
@@ -57,14 +57,15 @@
public void broadcast(FacesEvent event) throws AbortProcessingException {
super.broadcast(event);
if (event instanceof DropEvent) {
- MethodBinding binding = getDropListener();
- if (binding != null) {
- binding.invoke(getFacesContext(), new Object[] {event});
+ if (((DropEvent) event).isValid()) {
+ MethodBinding binding = getDropListener();
+ if (binding != null) {
+ binding.invoke(getFacesContext(), new Object[] {event});
+ }
+
+ new AjaxEvent(this).queue();
+ new ActionEvent(this).queue();
}
-
- new AjaxEvent(this).queue();
- new ActionEvent(this).queue();
-
}
}
Modified: branches/3.1.x/ui/drag-drop/src/main/java/org/richfaces/renderkit/DnDEventsExchangeMailer.java
===================================================================
--- branches/3.1.x/ui/drag-drop/src/main/java/org/richfaces/renderkit/DnDEventsExchangeMailer.java 2007-11-12 16:02:11 UTC (rev 3925)
+++ branches/3.1.x/ui/drag-drop/src/main/java/org/richfaces/renderkit/DnDEventsExchangeMailer.java 2007-11-12 16:10:43 UTC (rev 3926)
@@ -28,11 +28,11 @@
import javax.faces.component.UIComponent;
import javax.faces.context.FacesContext;
-import javax.faces.event.FacesEvent;
import org.apache.commons.collections.MultiHashMap;
import org.richfaces.component.Draggable;
import org.richfaces.component.Dropzone;
+import org.richfaces.event.DnDEvent;
/**
* @author Nick Belaevski - nbelaevski(a)exadel.com
@@ -45,16 +45,16 @@
}
private static class EventInfoStructure {
- private FacesEvent facesEvent;
+ private DnDEvent dndEvent;
private EventCallback eventCallback;
private Object type;
private Object value;
- public EventInfoStructure(FacesEvent facesEvent,
+ public EventInfoStructure(DnDEvent dndEvent,
EventCallback eventCallback, Object type, Object value) {
super();
- this.facesEvent = facesEvent;
+ this.dndEvent = dndEvent;
this.eventCallback = eventCallback;
this.type = type;
this.value = value;
@@ -63,7 +63,7 @@
}
static abstract class EventCallback {
- abstract void processEvent(FacesEvent facesEvent, UIComponent source, FacesContext facesContext, Object type, Object value);
+ abstract void processEvent(DnDEvent dndEvent, UIComponent source, FacesContext facesContext, Object type, Object value);
}
static DnDEventsExchangeMailer getInstance(FacesContext facesContext) {
@@ -86,22 +86,25 @@
private Map components = new HashMap();
- private void processEvent(UIComponent source, FacesContext facesContext, FacesEvent facesEvent, EventCallback callback, Object type, Object value) {
+ private void processEvent(UIComponent source, FacesContext facesContext, DnDEvent dndEvent, EventCallback callback, Object type, Object value) {
if (callback != null) {
- callback.processEvent(facesEvent, source, facesContext, type, value);
+ callback.processEvent(dndEvent, source, facesContext, type, value);
}
}
- public void mailEvent(String sourceId, UIComponent target, FacesContext facesContext, FacesEvent facesEvent,
+ public void mailEvent(String sourceId, UIComponent target, FacesContext facesContext, DnDEvent dndEvent,
EventCallback callback, Object type, Object value, boolean isDraggable) {
- facesEvent.queue();
+ //we should queue event right now to preserve row key if its generator
+ //is nested in UIData...
+ dndEvent.queue();
+
UIComponent component = (UIComponent) components.get(sourceId);
String targetId = target.getClientId(facesContext);
if (component == null) {
//component with that sourceId have never mailed anything before - wait
- queuedMap.put(sourceId, new EventInfoStructure(facesEvent, callback, type, value));
+ queuedMap.put(sourceId, new EventInfoStructure(dndEvent, callback, type, value));
components.put(targetId, target);
} else {
//check queued mail lists for current component
@@ -131,15 +134,24 @@
dragType = eventInfo.type;
}
- DnDValidator.validateAcceptTypes(facesContext, draggable, dropzone, dragType, acceptedTypes);
+ if (DnDValidator.validateAcceptTypes(facesContext,
+ draggable, dropzone,
+ dragType, acceptedTypes)) {
+
- processEvent(target, facesContext, eventInfo.facesEvent, eventInfo.eventCallback,
- type, value);
+ processEvent(target, facesContext, eventInfo.dndEvent, eventInfo.eventCallback,
+ type, value);
- //we know the component - process event now
- processEvent(component, facesContext, facesEvent, callback,
- eventInfo.type, eventInfo.value);
+ //we know the component - process event now
+ processEvent(component, facesContext, dndEvent, callback,
+ eventInfo.type, eventInfo.value);
+ } else {
+ dndEvent.invalidate();
+
+ eventInfo.dndEvent.invalidate();
+ }
+
iterator.remove();
}
Modified: branches/3.1.x/ui/drag-drop/src/main/java/org/richfaces/renderkit/DnDValidator.java
===================================================================
--- branches/3.1.x/ui/drag-drop/src/main/java/org/richfaces/renderkit/DnDValidator.java 2007-11-12 16:02:11 UTC (rev 3925)
+++ branches/3.1.x/ui/drag-drop/src/main/java/org/richfaces/renderkit/DnDValidator.java 2007-11-12 16:10:43 UTC (rev 3926)
@@ -41,7 +41,7 @@
class DnDValidator {
private final static String MESSAGE_FORMAT = "Dropzone [{0}] with accepted types {1} cannot accept Draggable [{2}] with dragType [{3}]";
- static void validateAcceptTypes(FacesContext context, Draggable draggable, Dropzone dropzone, Object dragType, Object acceptedTypes) {
+ static boolean validateAcceptTypes(FacesContext context, Draggable draggable, Dropzone dropzone, Object dragType, Object acceptedTypes) {
Set set = AjaxRendererUtils.asSet(acceptedTypes);
if (set == null || !set.contains(dragType)) {
UIComponent component = (UIComponent) dropzone;
@@ -58,6 +58,10 @@
context.addMessage(component.getClientId(context), message);
context.renderResponse();
+
+ return false;
}
+
+ return true;
}
}
Modified: branches/3.1.x/ui/drag-drop/src/main/java/org/richfaces/renderkit/DraggableRendererContributor.java
===================================================================
--- branches/3.1.x/ui/drag-drop/src/main/java/org/richfaces/renderkit/DraggableRendererContributor.java 2007-11-12 16:02:11 UTC (rev 3925)
+++ branches/3.1.x/ui/drag-drop/src/main/java/org/richfaces/renderkit/DraggableRendererContributor.java 2007-11-12 16:10:43 UTC (rev 3926)
@@ -26,13 +26,13 @@
import javax.faces.component.UIComponent;
import javax.faces.context.FacesContext;
-import javax.faces.event.FacesEvent;
import org.ajax4jsf.javascript.DnDScript;
import org.ajax4jsf.javascript.PrototypeScript;
import org.ajax4jsf.renderkit.AjaxRendererUtils;
import org.richfaces.component.Draggable;
import org.richfaces.component.Dropzone;
+import org.richfaces.event.DnDEvent;
import org.richfaces.event.DragEvent;
import org.richfaces.renderkit.DnDEventsExchangeMailer.EventCallback;
@@ -46,10 +46,10 @@
private static final EventCallback dragEventsCallback = new EventCallback() {
- void processEvent(FacesEvent facesEvent, UIComponent source,
+ void processEvent(DnDEvent dndEvent, UIComponent source,
FacesContext facesContext, Object type, Object value) {
- DragEvent dragEvent = (DragEvent) facesEvent;
+ DragEvent dragEvent = (DragEvent) dndEvent;
dragEvent.setDropTarget((Dropzone) source);
dragEvent.setDropValue(value);
dragEvent.setAcceptedTypes(type);
Modified: branches/3.1.x/ui/drag-drop/src/main/java/org/richfaces/renderkit/DropzoneRendererContributor.java
===================================================================
--- branches/3.1.x/ui/drag-drop/src/main/java/org/richfaces/renderkit/DropzoneRendererContributor.java 2007-11-12 16:02:11 UTC (rev 3925)
+++ branches/3.1.x/ui/drag-drop/src/main/java/org/richfaces/renderkit/DropzoneRendererContributor.java 2007-11-12 16:10:43 UTC (rev 3926)
@@ -26,7 +26,6 @@
import javax.faces.FacesException;
import javax.faces.component.UIComponent;
import javax.faces.context.FacesContext;
-import javax.faces.event.FacesEvent;
import org.ajax4jsf.javascript.DnDScript;
import org.ajax4jsf.javascript.JSFunction;
@@ -37,6 +36,7 @@
import org.ajax4jsf.renderkit.AjaxRendererUtils;
import org.richfaces.component.Draggable;
import org.richfaces.component.Dropzone;
+import org.richfaces.event.DnDEvent;
import org.richfaces.event.DropEvent;
import org.richfaces.json.JSONCollection;
import org.richfaces.json.JSONException;
@@ -53,10 +53,10 @@
private static final EventCallback dropEventsCallback = new EventCallback() {
- void processEvent(FacesEvent facesEvent, UIComponent source,
+ void processEvent(DnDEvent dndEvent, UIComponent source,
FacesContext facesContext, Object type, Object value) {
- DropEvent dropEvent = (DropEvent) facesEvent;
+ DropEvent dropEvent = (DropEvent) dndEvent;
Draggable draggable = (Draggable) source;
dropEvent.setDraggableSource(draggable);
Modified: branches/3.1.x/ui/tree/src/main/java/org/richfaces/component/events/TreeEvents.java
===================================================================
--- branches/3.1.x/ui/tree/src/main/java/org/richfaces/component/events/TreeEvents.java 2007-11-12 16:02:11 UTC (rev 3925)
+++ branches/3.1.x/ui/tree/src/main/java/org/richfaces/component/events/TreeEvents.java 2007-11-12 16:10:43 UTC (rev 3926)
@@ -65,9 +65,13 @@
} else if (event instanceof NodeSelectedEvent) {
binding = eventsProducer.getNodeSelectListener();
} else if (event instanceof DropEvent) {
- binding = eventsProducer.getDropListener();
+ if (((DropEvent) event).isValid()) {
+ binding = eventsProducer.getDropListener();
+ }
} else if (event instanceof DragEvent) {
- binding = eventsProducer.getDragListener();
+ if (((DragEvent) event).isValid()) {
+ binding = eventsProducer.getDragListener();
+ }
}
if (binding != null) {
18 years, 5 months
JBoss Rich Faces SVN: r3924 - branches/3.1.x/ui/drag-drop/src/main/java/org/richfaces/component.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2007-11-12 11:00:19 -0500 (Mon, 12 Nov 2007)
New Revision: 3924
Modified:
branches/3.1.x/ui/drag-drop/src/main/java/org/richfaces/component/UIDragSupport.java
branches/3.1.x/ui/drag-drop/src/main/java/org/richfaces/component/UIDropSupport.java
Log:
Fix for http://jira.jboss.com/jira/browse/RF-1331 merged
Modified: branches/3.1.x/ui/drag-drop/src/main/java/org/richfaces/component/UIDragSupport.java
===================================================================
--- branches/3.1.x/ui/drag-drop/src/main/java/org/richfaces/component/UIDragSupport.java 2007-11-12 15:24:53 UTC (rev 3923)
+++ branches/3.1.x/ui/drag-drop/src/main/java/org/richfaces/component/UIDragSupport.java 2007-11-12 16:00:19 UTC (rev 3924)
@@ -69,7 +69,6 @@
}
public void queueEvent(FacesEvent event) {
- super.queueEvent(event);
if (event instanceof DragEvent) {
if (isImmediate()) {
event.setPhaseId(PhaseId.APPLY_REQUEST_VALUES);
@@ -77,6 +76,7 @@
event.setPhaseId(PhaseId.INVOKE_APPLICATION);
}
}
+ super.queueEvent(event);
}
public String getResolvedDragIndicator(FacesContext facesContext) {
Modified: branches/3.1.x/ui/drag-drop/src/main/java/org/richfaces/component/UIDropSupport.java
===================================================================
--- branches/3.1.x/ui/drag-drop/src/main/java/org/richfaces/component/UIDropSupport.java 2007-11-12 15:24:53 UTC (rev 3923)
+++ branches/3.1.x/ui/drag-drop/src/main/java/org/richfaces/component/UIDropSupport.java 2007-11-12 16:00:19 UTC (rev 3924)
@@ -69,7 +69,6 @@
}
public void queueEvent(FacesEvent event) {
- super.queueEvent(event);
if (event instanceof DropEvent) {
if (isImmediate()) {
event.setPhaseId(PhaseId.APPLY_REQUEST_VALUES);
@@ -77,5 +76,6 @@
event.setPhaseId(PhaseId.INVOKE_APPLICATION);
}
}
+ super.queueEvent(event);
}
}
18 years, 5 months
JBoss Rich Faces SVN: r3923 - trunk/docs/userguide/en/src/main/docbook/included.
by richfaces-svn-commits@lists.jboss.org
Author: artdaw
Date: 2007-11-12 10:24:53 -0500 (Mon, 12 Nov 2007)
New Revision: 3923
Added:
trunk/docs/userguide/en/src/main/docbook/included/listShuttle.xml
Log:
RF-1174 - Write Creating the Component with a Page Tag, Creating the Component Dynamically Using Java, Details of Usage, JavaScript API, Look-and-Feel Customization
Added: trunk/docs/userguide/en/src/main/docbook/included/listShuttle.xml
===================================================================
--- trunk/docs/userguide/en/src/main/docbook/included/listShuttle.xml (rev 0)
+++ trunk/docs/userguide/en/src/main/docbook/included/listShuttle.xml 2007-11-12 15:24:53 UTC (rev 3923)
@@ -0,0 +1,407 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<section>
+ <sectioninfo>
+ <keywordset>
+ <keyword>rich:listShuttle</keyword>
+ <keyword>listShuttle</keyword>
+ </keywordset>
+ </sectioninfo>
+ <section>
+ <title>Creating the Component with a Page Tag</title>
+ <para>Here is a simple example as it could be used on a page: </para>
+
+ <para>
+ <emphasis role="bold">Example:</emphasis>
+ </para>
+ <programlisting role="XML"><![CDATA[...
+<rich:listShuttle value=”#{bean.list}” var=”list” selection=”#{value.resultList}”>
+ <f:facet name=header>
+ <h:outputText value=”Header1”/>
+ </f:facet>
+ <rich:column>
+ <h:outputText value=”#{list.text}”>
+ </rich:column>
+<rich:listShuttle>
+...]]></programlisting>
+ </section>
+ <section>
+ <title>Creating the Component Dynamically Using Java</title>
+
+ <para>
+ <emphasis role="bold">Example:</emphasis>
+ </para>
+ <programlisting role="JAVA"><![CDATA[import org.richfaces.component.html.listShuttle;
+...
+HtmllistShuttle mylistShuttle = new HtmllistShuttle();
+...]]></programlisting>
+ </section>
+ <section>
+ <title>Details of Usage</title>
+
+ <para>The <emphasis role="bold">
+ <property><rich:listShuttle></property>
+ </emphasis> component is represented with the next tags: <itemizedlist>
+ <listitem><emphasis role="bold">
+ <property><rich:listShuttle></property>
+ </emphasis> - the tag defines all the component properties like list binding,
+ sorting possibility, ordering controls set, move/copy controls set, behavioral
+ and look and feel properties</listitem>
+ <listitem>facets with <emphasis>
+ <property>"source"</property>
+ </emphasis> and <emphasis>
+ <property>"target"</property>
+ </emphasis> names to build lists with different columns sets.</listitem>
+ <listitem><emphasis role="bold">
+ <property><rich:column></property>
+ </emphasis>, <emphasis role="bold">
+ <property><h:column></property>
+ </emphasis> is used to define columns for every row.</listitem>
+ </itemizedlist>
+ </para>
+ </section>
+ <section>
+ <title>JavaScript API</title>
+ <para> Controls are accessible for developer on client-side using controls attribute of
+ JavaScript component instance. The value of the attribute is an associative array of
+ controls keyed by the following strings: "top",
+ "up", "down", "bottom".</para>
+ <table>
+ <title>JavaScript API</title>
+ <tgroup cols="3">
+ <thead>
+ <row>
+ <entry>Function</entry>
+ <entry>Description</entry>
+ <entry>Element</entry>
+ </row>
+ </thead>
+ <tbody>
+ <!--Sorting API -->
+ <row>
+ <entry>doSortAscending()</entry>
+ <entry>Invert current sorting</entry>
+ <entry>Component</entry>
+ </row>
+ <row>
+ <entry>doSortDescending()</entry>
+ <entry/>
+ <entry>Component</entry>
+ </row>
+ <row>
+ <entry>doSort()</entry>
+ <entry/>
+ <entry>Component</entry>
+ </row>
+ <!--Controls common API -->
+ <row>
+ <entry>doHide()</entry>
+ <entry/>
+ <entry>Any Ordering control</entry>
+ </row>
+ <row>
+ <entry>doShow()</entry>
+ <entry/>
+ <entry>Any Ordering control</entry>
+ </row>
+ <row>
+ <entry>isShown()</entry>
+ <entry/>
+ <entry>Any Ordering control</entry>
+ </row>
+ <row>
+ <entry>doEnable()</entry>
+ <entry/>
+ <entry>Any Ordering control</entry>
+ </row>
+ <row>
+ <entry>doDisable()</entry>
+ <entry/>
+ <entry>Any Ordering control</entry>
+ </row>
+ <row>
+ <entry>isEnabled()</entry>
+ <entry/>
+ <entry>Any Ordering control</entry>
+ </row>
+ <!--List managing API -->
+ <row>
+ <entry>moveUp()</entry>
+ <entry/>
+ <entry>Any Item</entry>
+ </row>
+ <row>
+ <entry>moveDown()</entry>
+ <entry/>
+ <entry>Any Item</entry>
+ </row>
+ <row>
+ <entry>moveTop()</entry>
+ <entry/>
+ <entry>Any Item</entry>
+ </row>
+ <row>
+ <entry>moveBottom()</entry>
+ <entry/>
+ <entry>Any Item</entry>
+ </row>
+ <row>
+ <entry>copy()</entry>
+ <entry/>
+ <entry>Any Item</entry>
+ </row>
+ <row>
+ <entry>remove()</entry>
+ <entry/>
+ <entry>Any Item</entry>
+ </row>
+ <row>
+ <entry>copyAll()</entry>
+ <entry/>
+ <entry>Any Item</entry>
+ </row>
+ <row>
+ <entry>removeAll()</entry>
+ <entry/>
+ <entry>Any Item</entry>
+ </row>
+ <row>
+ <entry>getSelection()</entry>
+ <entry/>
+ <entry/>
+ </row>
+ <row>
+ <entry>getItems()</entry>
+ <entry/>
+ <entry/>
+ </row>
+ </tbody>
+ </tgroup>
+ </table>
+ </section>
+ <section>
+ <title>Look-and-Feel Customization</title>
+ <para>For skinnability implementation, the components use a <emphasis>
+ <property>style class redefinition method.</property>
+ </emphasis> Default style classes are mapped on <emphasis>
+ <property>skin parameters.</property>
+ </emphasis></para>
+ <para>There are two ways to redefine the appearance of all <emphasis role="bold">
+ <property><rich:listShuttle></property>
+ </emphasis> components at once: <itemizedlist>
+ <listitem>Redefine the corresponding skin parameters</listitem>
+ <listitem> Add to your style sheets style classes used by a <emphasis role="bold">
+ <property><rich:listShuttle></property>
+ </emphasis> component</listitem>
+ </itemizedlist>
+ </para>
+ </section>
+ <section>
+ <title>Definition of Custom Style Classes</title>
+
+ <para>On the screenshot there are classes names that define styles for component elements.</para>
+
+ <!-- screenshot -->
+
+ <figure>
+ <title>Style classes</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="" scalefit="1"/>
+ </imageobject>
+ </mediaobject>
+ </figure>
+
+ <!-- ADD ITEMS representations!!!-->
+
+ <table>
+ <title>Classes names that define a caption representations in the source list</title>
+ <tgroup cols="2">
+ <thead>
+ <row>
+ <entry>Class name</entry>
+ <entry>Description</entry>
+ </row>
+ </thead>
+ <tbody>
+ <row>
+ <entry>rich-shuttle-source-caption</entry>
+ <entry>Defines a class for caption customization</entry>
+ </row>
+ </tbody>
+ </tgroup>
+ </table>
+ <table>
+ <title>Classes names that define a caption representations in the target list</title>
+ <tgroup cols="2">
+ <thead>
+ <row>
+ <entry>Class name</entry>
+ <entry>Description</entry>
+ </row>
+ </thead>
+ <tbody>
+ <row>
+ <entry>rich-shuttle-target-caption</entry>
+ <entry>Defines a class for caption customization</entry>
+ </row>
+ </tbody>
+ </tgroup>
+ </table>
+ <table>
+ <title>Classes names that define a rows representations in the source list</title>
+ <tgroup cols="2">
+ <thead>
+ <row>
+ <entry>Class name</entry>
+ <entry>Description</entry>
+ </row>
+ </thead>
+ <tbody>
+ <row>
+ <entry>rich-shuttle-source-row</entry>
+ <entry>Defines a default class for any item row</entry>
+ </row>
+ <row>
+ <entry>rich-shuttle-row-source-selected</entry>
+ <entry>Defines class to be additionally added to selected item rows</entry>
+ </row>
+ <row>
+ <entry>rich-shuttle-row-source-active</entry>
+ <entry>Defines class to be additionally added to active item rows</entry>
+ </row>
+ </tbody>
+ </tgroup>
+ </table>
+ <table>
+ <title>Classes names that define a rows representations in the target list</title>
+ <tgroup cols="2">
+ <thead>
+ <row>
+ <entry>Class name</entry>
+ <entry>Description</entry>
+ </row>
+ </thead>
+ <tbody>
+ <row>
+ <entry>rich-shuttle-target -row</entry>
+ <entry>Defines a default class for any item row</entry>
+ </row>
+ <row>
+ <entry>rich-shuttle-row-target -selected</entry>
+ <entry>Defines class to be additionally added to selected item rows</entry>
+ </row>
+ <row>
+ <entry>rich-shuttle-row-target -active</entry>
+ <entry>Defines class to be additionally added to active item rows</entry>
+ </row>
+ </tbody>
+ </tgroup>
+ </table>
+ <table>
+ <title>Classes names that define a cells representations in the source list</title>
+ <tgroup cols="2">
+ <thead>
+ <row>
+ <entry>Class name</entry>
+ <entry>Description</entry>
+ </row>
+ </thead>
+ <tbody>
+ <row>
+ <entry>rich-shuttle-source-cell</entry>
+ <entry>Defines a default class for any item cell</entry>
+ </row>
+ <row>
+ <entry>rich-shuttle-source-cell-selected</entry>
+ <entry>Defines class to be additionally added to selected item cells</entry>
+ </row>
+ <row>
+ <entry>rich-shuttle-source-cell-active</entry>
+ <entry>Defines class to be additionally added to active item cells</entry>
+ </row>
+ </tbody>
+ </tgroup>
+ </table>
+ <table>
+ <title>Classes names that define a cells representations in the target list</title>
+ <tgroup cols="2">
+ <thead>
+ <row>
+ <entry>Class name</entry>
+ <entry>Description</entry>
+ </row>
+ </thead>
+ <tbody>
+ <row>
+ <entry>rich-shuttle-target -cell</entry>
+ <entry>Defines a default class for any item cell</entry>
+ </row>
+ <row>
+ <entry>rich-shuttle-target -cell-selected</entry>
+ <entry>Defines class to be additionally added to selected item cells</entry>
+ </row>
+ <row>
+ <entry>rich-shuttle-target -cell-active</entry>
+ <entry>Defines class to be additionally added to active item cells</entry>
+ </row>
+ </tbody>
+ </tgroup>
+ </table>
+ <table>
+ <title>Classes names that define controls representations</title>
+ <tgroup cols="2">
+ <thead>
+ <row>
+ <entry>Class name</entry>
+ <entry>Description</entry>
+ </row>
+ </thead>
+ <tbody>
+ <row>
+ <entry>rich-ordering-controls</entry>
+ <entry>Could be applied to the whole group of the controls.</entry>
+ </row>
+ <row>
+ <entry>rich-shuttle-top</entry>
+ <entry>Defines class for Top control</entry>
+ </row>
+ <row>
+ <entry>rich-shuttle-bottom</entry>
+ <entry>Defines class for Bottom control</entry>
+ </row>
+ <row>
+ <entry>rich-shuttle-up</entry>
+ <entry>Defines class for Up control</entry>
+ </row>
+ <row>
+ <entry>rich-shuttle-down</entry>
+ <entry>Defines class for Down control</entry>
+ </row>
+
+ <row>
+ <entry>rich-shuttle-copy</entry>
+ <entry>Defines class for Copy control</entry>
+ </row>
+
+ <row>
+ <entry>rich-shuttle-remove</entry>
+ <entry>Defines class for Remove control</entry>
+ </row>
+
+ <row>
+ <entry>rich-shuttle-copyAll</entry>
+ <entry>Defines class for copyAll control</entry>
+ </row>
+ <row>
+ <entry>rich-shuttle-removeAll</entry>
+ <entry>Defines class for removeAll control</entry>
+ </row>
+ <row>
+ <entry>rich-shuttle-control-disabled</entry>
+ <entry>Defines a class for any control in a disabled state</entry>
+ </row>
+ </tbody>
+ </tgroup>
+ </table>
+ </section>
+ </section>
18 years, 5 months
JBoss Rich Faces SVN: r3922 - trunk/docs/userguide/en/src/main/docbook/included.
by richfaces-svn-commits@lists.jboss.org
Author: artdaw
Date: 2007-11-12 10:24:26 -0500 (Mon, 12 Nov 2007)
New Revision: 3922
Added:
trunk/docs/userguide/en/src/main/docbook/included/listShuttle.desc.xml
Log:
RF-1174 - write description of listShuttle component
Added: trunk/docs/userguide/en/src/main/docbook/included/listShuttle.desc.xml
===================================================================
--- trunk/docs/userguide/en/src/main/docbook/included/listShuttle.desc.xml (rev 0)
+++ trunk/docs/userguide/en/src/main/docbook/included/listShuttle.desc.xml 2007-11-12 15:24:26 UTC (rev 3922)
@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<section>
+ <sectioninfo>
+ <keywordset>
+ <keyword>listShuttle</keyword>
+ </keywordset>
+ </sectioninfo>
+ <section>
+ <title>Description</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref=""/>
+ </imageobject>
+ </mediaobject>
+ <para>An <property>listShuttle</property> component is a component for moving chosen items
+ from one list into another with their optional reordering there.</para>
+ </section>
+ <section>
+ <title>Key Features</title>
+ <itemizedlist>
+ <listitem>Skinnable <property>listShuttle</property> and child items</listitem>
+ <listitem>Customizable component layout (captions, headers, list items and control sets)</listitem>
+ <listitem>Disabled/enabled ordering controls</listitem>
+ <listitem>Drag-and-drop support</listitem>
+ </itemizedlist>
+ </section>
+</section>
18 years, 5 months
JBoss Rich Faces SVN: r3921 - trunk/docs/userguide/en/src/main/docbook/included.
by richfaces-svn-commits@lists.jboss.org
Author: artdaw
Date: 2007-11-12 10:23:30 -0500 (Mon, 12 Nov 2007)
New Revision: 3921
Modified:
trunk/docs/userguide/en/src/main/docbook/included/orderingList.xml
Log:
RF-1184 - edit Details of Usage
Modified: trunk/docs/userguide/en/src/main/docbook/included/orderingList.xml
===================================================================
--- trunk/docs/userguide/en/src/main/docbook/included/orderingList.xml 2007-11-12 15:18:26 UTC (rev 3920)
+++ trunk/docs/userguide/en/src/main/docbook/included/orderingList.xml 2007-11-12 15:23:30 UTC (rev 3921)
@@ -14,9 +14,9 @@
<emphasis role="bold">Example:</emphasis>
</para>
<programlisting role="XML"><![CDATA[...
-<rich:orderingList value=”#{bean.list}” var=”list”>
+<rich:orderingList value="#{bean.list}" var="list">
<rich:column>
- <h:outputText value=”#{list.text}”>
+ <h:outputText value="#{list.text}">
</rich:column>
<rich:orderingList>
...
@@ -49,15 +49,13 @@
<property><rich:orderingList></property>
</emphasis> component provides to use <emphasis>
<property>"optionalCaption"</property>
- </emphasis> facet.</para>
- <para>It's possible to define <property>
+ </emphasis>, <property>
<emphasis>"optionalHeader"</emphasis>
- </property> facet. It has two possible types of representation: sortable and
- non-sortable. </para>
- <para> Also you can use<property>
+ </property>(It's possible to define facet. It has two possible types of representation: sortable and
+ non-sortable) and <property>
<emphasis>"optionalFooter"</emphasis>
- </property> facet.</para>
-
+ </property> facets.
+ </para>
<!-- add simple and screenshot-->
@@ -94,10 +92,10 @@
<emphasis>"var"</emphasis>
</property> attributes are used to access the values of a list. Example of page
definition: <programlisting role="XML"><![CDATA[...
-<rich:orderingList value=”#{bean.list}” var=”list”>
- <f:facet name=header><h:outputText value=”Header1”/></f:facet>
+<rich:orderingList value="#{bean.list}" var="list">
+ <f:facet name=header><h:outputText value="Header1"/></f:facet>
<rich:column>
- <h:outputText value=”#{list.text}”>
+ <h:outputText value="#{list.text}">
</rich:column>
<rich:orderingList>
...]]>
@@ -105,7 +103,7 @@
</para>
<para>The <property>
- <emphasis>"selection "</emphasis>
+ <emphasis>"selection"</emphasis>
</property> attribute is bound to a list, which stores a set of indexes for rows
selected. If the index from a set is out of bounds, it should be ignored. </para>
<para>Controls rendering is based on the <property>
@@ -113,9 +111,9 @@
</property> attribute. Possible types are button, link, none.</para>
<para>Example of page definition:</para>
<programlisting role="XML"><![CDATA[...
-<rich:orderingList controlType=”button”>
- <f:facet name=”Top”>
- <h:outputText value=”Move to top”>
+<rich:orderingList controlType="button">
+ <f:facet name="Top">
+ <h:outputText value="Move to top">
</f:facet>
<rich:orderingList>
...
@@ -206,13 +204,13 @@
<programlisting role="XML"><![CDATA[...
<rich:orderingList>
- <h:panelGrid columns=”2” columnClasses=”class1 class2”>
- <h:outputText value=”{list}”/>
+ <h:panelGrid columns="2" columnClasses="class1 class2">
+ <h:outputText value="{list}"/>
<h:panelGroup>
- <h:outputText value=”{topControl}”/>
- <h:outputText value=”{upControl}”/>
- <h:outputText value=”{downControl}”/>
- <h:outputText value=”{bottomControl}”/>
+ <h:outputText value="{topControl}"/>
+ <h:outputText value="{upControl}"/>
+ <h:outputText value="{downControl}"/>
+ <h:outputText value="{bottomControl}"/>
</h:panelGroup>
</h:panelGrid>
</rich:orderingList>
@@ -412,12 +410,22 @@
</emphasis> Default style classes are mapped on <emphasis>
<property>skin parameters.</property>
</emphasis></para>
+ <para>There are two ways to redefine the appearance of all <emphasis role="bold">
+ <property><rich:orderingList></property>
+ </emphasis> components at once: <itemizedlist>
+ <listitem>Redefine the corresponding skin parameters</listitem>
+ <listitem> Add to your style sheets style classes used by a <emphasis role="bold">
+ <property><rich:orderingList></property>
+ </emphasis> component</listitem>
+ </itemizedlist>
+ </para>
</section>
<section>
<title>Definition of Custom Style Classes</title>
<para>On the screenshot there are classes names that define styles for component elements.</para>
-
+
+<!-- screenshot -->
<figure>
<title>Style classes</title>
<mediaobject>
@@ -457,7 +465,7 @@
</tgroup>
</table>
<table>
- <title>Classes names that define a rows representations</title>
+ <title>Classes names that define a cells representations</title>
<tgroup cols="2">
<thead>
<row>
18 years, 5 months
JBoss Rich Faces SVN: r3920 - branches/3.1.x/ui/panelbar/src/main/resources/org/richfaces/renderkit/html/scripts.
by richfaces-svn-commits@lists.jboss.org
Author: sergeyhalipov
Date: 2007-11-12 10:18:26 -0500 (Mon, 12 Nov 2007)
New Revision: 3920
Modified:
branches/3.1.x/ui/panelbar/src/main/resources/org/richfaces/renderkit/html/scripts/panelbar.js
Log:
http://jira.jboss.com/jira/browse/RF-1310
Modified: branches/3.1.x/ui/panelbar/src/main/resources/org/richfaces/renderkit/html/scripts/panelbar.js
===================================================================
--- branches/3.1.x/ui/panelbar/src/main/resources/org/richfaces/renderkit/html/scripts/panelbar.js 2007-11-12 15:09:26 UTC (rev 3919)
+++ branches/3.1.x/ui/panelbar/src/main/resources/org/richfaces/renderkit/html/scripts/panelbar.js 2007-11-12 15:18:26 UTC (rev 3920)
@@ -131,7 +131,6 @@
this.header=header;
this.header_act=header_act;
this.content=content;
- this.item.style.overflow="hidden";
// this.header.style.overflowX="hidden";
// this.header.style.overflowY="visible";
// this.header.style.cursor="pointer";
18 years, 5 months
JBoss Rich Faces SVN: r3919 - in branches/3.1.x/ui/panelmenu/src: main/templates/org/richfaces and 1 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: sergeyhalipov
Date: 2007-11-12 10:09:26 -0500 (Mon, 12 Nov 2007)
New Revision: 3919
Modified:
branches/3.1.x/ui/panelmenu/src/main/resources/org/richfaces/renderkit/html/scripts/panelMenu.js
branches/3.1.x/ui/panelmenu/src/main/templates/org/richfaces/htmlPanelMenuGroup.jspx
branches/3.1.x/ui/panelmenu/src/main/templates/org/richfaces/htmlPanelMenuItem.jspx
branches/3.1.x/ui/panelmenu/src/test/java/org/richfaces/component/PanelMenuComponentTest.java
Log:
http://jira.jboss.com/jira/browse/RF-1311
Modified: branches/3.1.x/ui/panelmenu/src/main/resources/org/richfaces/renderkit/html/scripts/panelMenu.js
===================================================================
--- branches/3.1.x/ui/panelmenu/src/main/resources/org/richfaces/renderkit/html/scripts/panelMenu.js 2007-11-12 14:57:39 UTC (rev 3918)
+++ branches/3.1.x/ui/panelmenu/src/main/resources/org/richfaces/renderkit/html/scripts/panelMenu.js 2007-11-12 15:09:26 UTC (rev 3919)
@@ -49,7 +49,7 @@
this.hoveredStyles = hoveredStyles;
this.hoveredClasses = hoveredClasses;
- this.tdhider = $("tdhide"+ids.myId);
+ this.tdhider = $(ids.myId);
this.tablehider = $("tablehide"+ids.myId);
this.haveDynamicIcon = haveDynamicIcon;
if (this.haveDynamicIcon==true)
@@ -74,7 +74,7 @@
this.selected = false;
}
this.clientId = ids.myId;
- this.obj = $("tdhide" + ids.myId);
+ this.obj = $(ids.myId);
this.leftIcon = $('leftIcon' + ids.myId);
this.rightIcon = $('rightIcon' + ids.myId);
this.labelArea = $('icon' + ids.myId);
Modified: branches/3.1.x/ui/panelmenu/src/main/templates/org/richfaces/htmlPanelMenuGroup.jspx
===================================================================
--- branches/3.1.x/ui/panelmenu/src/main/templates/org/richfaces/htmlPanelMenuGroup.jspx 2007-11-12 14:57:39 UTC (rev 3918)
+++ branches/3.1.x/ui/panelmenu/src/main/templates/org/richfaces/htmlPanelMenuGroup.jspx 2007-11-12 15:09:26 UTC (rev 3919)
@@ -13,7 +13,7 @@
<f:clientid var="clientId"/>
- <div id="tdhide#{clientId}" style="#{this:getHideStyle(context, component)}"
+ <div id="#{clientId}" style="#{this:getHideStyle(context, component)}"
class="#{this:getDivClass(context, component)}" >
<jsp:scriptlet>
<![CDATA[
Modified: branches/3.1.x/ui/panelmenu/src/main/templates/org/richfaces/htmlPanelMenuItem.jspx
===================================================================
--- branches/3.1.x/ui/panelmenu/src/main/templates/org/richfaces/htmlPanelMenuItem.jspx 2007-11-12 14:57:39 UTC (rev 3918)
+++ branches/3.1.x/ui/panelmenu/src/main/templates/org/richfaces/htmlPanelMenuItem.jspx 2007-11-12 15:09:26 UTC (rev 3919)
@@ -13,7 +13,7 @@
<f:clientid var="clientId"/>
- <div id="tdhide#{clientId}" style="#{this:getHideStyle(context, component)}" >
+ <div id="#{clientId}" style="#{this:getHideStyle(context, component)}" >
<table cellspacing="0" cellpadding="0" border="0"
id="tablehide#{clientId}"
class="dr-pmenu-item rich-pmenu-item #{this:getFullStyleClass( context, component )} "
Modified: branches/3.1.x/ui/panelmenu/src/test/java/org/richfaces/component/PanelMenuComponentTest.java
===================================================================
--- branches/3.1.x/ui/panelmenu/src/test/java/org/richfaces/component/PanelMenuComponentTest.java 2007-11-12 14:57:39 UTC (rev 3918)
+++ branches/3.1.x/ui/panelmenu/src/test/java/org/richfaces/component/PanelMenuComponentTest.java 2007-11-12 15:09:26 UTC (rev 3919)
@@ -68,6 +68,8 @@
javaScripts.add("org.ajax4jsf.javascript.PrototypeScript");
javaScripts.add("org/richfaces/renderkit/html/scripts/utils.js");
javaScripts.add("org/richfaces/renderkit/html/scripts/panelMenu.js");
+ javaScripts.add("org/ajax4jsf/javascript/scripts/form.js");
+ javaScripts.add("org/richfaces/renderkit/html/scripts/form.js");
}
/**
@@ -197,7 +199,7 @@
assertNotNull(div);
assertEquals("div", div.getNodeName());
- HtmlElement firstGroupDiv = page.getHtmlElementById("tdhide" + group1.getClientId(facesContext));
+ HtmlElement firstGroupDiv = page.getHtmlElementById(group1.getClientId(facesContext));
assertNotNull(firstGroupDiv);
assertEquals("div", firstGroupDiv.getNodeName());
@@ -214,7 +216,7 @@
assertTrue(styleClass.contains("rich-pmenu-disabled-element"));
assertTrue(styleClass.contains("dr-pmenu-disabled-element"));
- HtmlElement subGroupDiv = page.getHtmlElementById("tdhide" + group3.getClientId(facesContext));
+ HtmlElement subGroupDiv = page.getHtmlElementById(group3.getClientId(facesContext));
assertNotNull(subGroupDiv);
assertEquals("div", subGroupDiv.getNodeName());
18 years, 5 months
JBoss Rich Faces SVN: r3918 - trunk/docs/userguide/en/src/main/docbook/included.
by richfaces-svn-commits@lists.jboss.org
Author: vkorluzhenko
Date: 2007-11-12 09:57:39 -0500 (Mon, 12 Nov 2007)
New Revision: 3918
Modified:
trunk/docs/userguide/en/src/main/docbook/included/calendar.xml
Log:
http://jira.jboss.com/jira/browse/RF-925 - Code patterns explanation
Modified: trunk/docs/userguide/en/src/main/docbook/included/calendar.xml
===================================================================
--- trunk/docs/userguide/en/src/main/docbook/included/calendar.xml 2007-11-12 14:43:36 UTC (rev 3917)
+++ trunk/docs/userguide/en/src/main/docbook/included/calendar.xml 2007-11-12 14:57:39 UTC (rev 3918)
@@ -229,14 +229,14 @@
</emphasis> facet with available {weekNumber}, {elementId} elements and <emphasis>
<property>"weekDay"</property>
</emphasis> facet with {weekDayLabel}, {weekDayLabelShort}, {weekDayNumber}, {isWeekend},
- {elementId} elements. {weekNumber}, {weekDayLabel}, {weekDayLabelShort}, {weekDayNumber} elements could be
- used for labels output, {isWeekend}, {elementId} - for additional processing in JavaScript
- code.</para>
+ {elementId} elements. {weekNumber}, {weekDayLabel}, {weekDayLabelShort}, {weekDayNumber}
+ elements could be used for labels output, {isWeekend}, {elementId} - for additional processing
+ in JavaScript code.</para>
<para>These elements are shown on the picture below.</para>
-
+
<figure>
<title>Available elements</title>
-
+
<mediaobject>
<imageobject>
<imagedata fileref="images/calendar3.png"/>
@@ -301,7 +301,7 @@
</mediaobject>
</figure>
- <para>As it's shown on the picture below {selectedDateControl}, {todayControl} elements
+ <para>As it's shown on the picture above {selectedDateControl}, {todayControl} elements
are placed in the <emphasis>
<property>"header"</property>
</emphasis> facet, {previousMonthControl}, {currentMonthControl}, {nextMonthControl} - in the <emphasis>
@@ -311,25 +311,20 @@
</emphasis> facet, {nextYearControl}, {previousYearControl} are absent. Numbers of weeks are
red colored.</para>
- <para>The example of using JavaScript API is placed below:</para>
+ <para>It's possible to program events for calendar from JavaScript code. A simplest example of
+ usage JavaScript API is placed below:</para>
<para>
<emphasis role="bold">Example:</emphasis>
</para>
<programlisting role="XML"><![CDATA[...
<a4j:form id="form">
- <h:panelGroup id="test" columns="2" style="width: 300px">
- <h:selectBooleanCheckbox value="#{bean.check}">
- <a4j:support event="onchange" reRender="test" />
- <f:selectItem itemValue="true" itemLabel="Show" />
- <f:selectItem itemValue="false" itemLabel="Hide" />
- </h:selectBooleanCheckbox>
- <rich:calendar popup="true"
- rendered="#{!bean.check}" value="#{bean.date}" id="c"/>
- <a onclick="$('form:c').component.doExpand()" href="#">Show</a>
- </h:panelGroup>
+ <rich:calendar popup="true" rendered="#{!bean.check}" value="#{bean.date}" id="c"/>
+ <!--The link which is used to call a calendar popup externally-->
+ <a onclick="$('form:c').component.doExpand()" href="#">Show</a>
</a4j:form>
...
]]></programlisting>
+
<para>Also the discussion about this problem can be found on the <ulink
url="http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4078301#..."
>RichFaces Users Forum</ulink>.</para>
18 years, 5 months
JBoss Rich Faces SVN: r3917 - in trunk/sandbox/ui/orderingList/src/main: templates/org/richfaces and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: vmolotkov
Date: 2007-11-12 09:43:36 -0500 (Mon, 12 Nov 2007)
New Revision: 3917
Modified:
trunk/sandbox/ui/orderingList/src/main/resources/org/richfaces/renderkit/html/scripts/OrderingList.js
trunk/sandbox/ui/orderingList/src/main/templates/org/richfaces/htmlOrderingList.jspx
Log:
FuncSpec-RF-OL-CF-060.1.7 List Active State was implemented
Modified: trunk/sandbox/ui/orderingList/src/main/resources/org/richfaces/renderkit/html/scripts/OrderingList.js
===================================================================
--- trunk/sandbox/ui/orderingList/src/main/resources/org/richfaces/renderkit/html/scripts/OrderingList.js 2007-11-12 14:33:36 UTC (rev 3916)
+++ trunk/sandbox/ui/orderingList/src/main/resources/org/richfaces/renderkit/html/scripts/OrderingList.js 2007-11-12 14:43:36 UTC (rev 3917)
@@ -34,6 +34,8 @@
this.activeItem = null;
this.focusKeeper = document.getElementById(focusKeeperId);
+ this.focusKeeper.focused = false;
+
this.valueKeeper = document.getElementById(valueKeeperId);
this.shuttleTop = null;
@@ -45,7 +47,7 @@
this.focusKeeper.onkeydown = function(e) {
obj.onkeydownHandler(window.event || e);
}
- this.init(containerId, contentTableId, headerTableId, controlsId, onclickControlId, focusKeeperId);
+ this.init(containerId, contentTableId, headerTableId, controlsId, onclickControlId);
}
Shuttle.ASC = "acs";
@@ -63,6 +65,11 @@
Shuttle.CONTROL_SET = ["A", "INPUT", "TEXTAREA", "SELECT", "BUTTON"];
+Shuttle.ORDERING_LIST_CLASSES = {
+ normal : "ol_internal_tab rich-ordering-list-items",
+ disabled : "ol_internal_tab rich-ordering-list-disabled",
+ active : "ol_internal_tab rich-ordering-list-active"
+}
Shuttle.ACTIVITY_MARKER = "a";
Shuttle.SELECTION_MARKER = "s";
@@ -75,9 +82,10 @@
down: function (e) { this.moveSelectedItems("down", e);return false; }
};
-Shuttle.prototype.init = function(containerId, contentTableId, headerTableId, ids, onclickControlId, focusKeeperId) {
+Shuttle.prototype.init = function(containerId, contentTableId, headerTableId, ids, onclickControlId) {
var obj = this;
- Shuttle.setFocus(focusKeeperId);
+ this.setFocus();
+ Shuttle.addEventListener(this.focusKeeper, "blur", function (e) {obj.focusListener(e);});
for (var i = 0; i < ids.length; i++) {
var id = ids[i];
var node = document.getElementById(containerId + id[0]);
@@ -92,6 +100,13 @@
this.shuttleTop = LayoutManager.getElemXY(this.shuttleTable).top;
}
+Shuttle.prototype.isListActive = function() {
+ if ((this.activeItem != null || this.selectedItems.length != 0) && this.focusKeeper.focused) {
+ return true;
+ }
+ return false;
+}
+
Shuttle.prototype.controlListManager = function() {
this.selectedItems.sort(this.compareByRowIndex);
var control;
@@ -275,7 +290,7 @@
this.activeItem.className = Shuttle.ACTIVE_ITEM_CLASS;
this.saveState();
this.controlListManager();
- Shuttle.setFocus(this.focusKeeper.id);
+ this.setFocus();
}
}
@@ -566,10 +581,20 @@
return ((obj1 == obj2) ? 0 : ((obj1 < obj2) ? -1 : 1));
}
-Shuttle.setFocus = function(targetObjectId) {
- document.getElementById(targetObjectId).focus();
+Shuttle.prototype.setFocus = function() {
+ this.focusKeeper.focus();
+ this.focusKeeper.focused = true;
+ if (this.isListActive()) {
+ this.shuttleTable.className = Shuttle.ORDERING_LIST_CLASSES.active;
+ }
}
+Shuttle.prototype.focusListener = function(e) {
+ e = e || window.event;
+ this.focusKeeper.focusused = false;
+ this.shuttleTable.className = Shuttle.ORDERING_LIST_CLASSES.normal;
+}
+
Shuttle.addEventListener = function(elem, event, func) {
if (window.attachEvent) {
elem.attachEvent("on" + event, func);
Modified: trunk/sandbox/ui/orderingList/src/main/templates/org/richfaces/htmlOrderingList.jspx
===================================================================
--- trunk/sandbox/ui/orderingList/src/main/templates/org/richfaces/htmlOrderingList.jspx 2007-11-12 14:33:36 UTC (rev 3916)
+++ trunk/sandbox/ui/orderingList/src/main/templates/org/richfaces/htmlOrderingList.jspx 2007-11-12 14:43:36 UTC (rev 3917)
@@ -36,7 +36,7 @@
<td>
<div id="#{clientId}headerBox" class="ol_list">
<div class="ol_list_header" style="width: #{component.attributes['listHeight']}px;">
- <table id="#{clientId}internal_header_tab" class="ol_internal_header_tab" cellpadding="0" cellspacing="0">
+ <table id="#{clientId}internal_header_tab" class="ol_internal_header_tab rich-ordering-list-items" cellpadding="0" cellspacing="0">
<f:call name="encodeHeader"/>
</table>
</div>
18 years, 5 months