Author: ppitonak(a)redhat.com
Date: 2011-07-07 09:41:57 -0400 (Thu, 07 Jul 2011)
New Revision: 22542
Added:
modules/tests/metamer/trunk/application/src/main/webapp/components/richDragSource/cc.xhtml
modules/tests/metamer/trunk/application/src/main/webapp/resources/metamer/dragSource.xhtml
Modified:
modules/tests/metamer/trunk/application/src/main/webapp/components/richDragSource/list.xhtml
Log:
added sample for verifying RF-10992
Added:
modules/tests/metamer/trunk/application/src/main/webapp/components/richDragSource/cc.xhtml
===================================================================
---
modules/tests/metamer/trunk/application/src/main/webapp/components/richDragSource/cc.xhtml
(rev 0)
+++
modules/tests/metamer/trunk/application/src/main/webapp/components/richDragSource/cc.xhtml 2011-07-07
13:41:57 UTC (rev 22542)
@@ -0,0 +1,180 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html
xmlns="http://www.w3.org/1999/xhtml"
+
xmlns:h="http://java.sun.com/jsf/html"
+
xmlns:f="http://java.sun.com/jsf/core"
+
xmlns:ui="http://java.sun.com/jsf/facelets"
+
xmlns:metamer="http://java.sun.com/jsf/composite/metamer"
+
xmlns:rich="http://richfaces.org/rich"
+
xmlns:a4j="http://richfaces.org/a4j">
+
+<!--
+ JBoss, Home of Professional Open Source
+ Copyright 2010-2011, Red Hat, Inc. and individual contributors
+ by the @authors tag. See the copyright.txt in the distribution for a
+ full listing of individual contributors.
+
+ This is free software; you can redistribute it and/or modify it
+ under the terms of the GNU Lesser General Public License as
+ published by the Free Software Foundation; either version 2.1 of
+ the License, or (at your option) any later version.
+
+ This software 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 software; if not, write to the Free
+ Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ -->
+
+<ui:composition template="/templates/template.xhtml">
+ <ui:param name="componentId" value="richTree" />
+
+ <ui:define name="view">
+ <f:metadata>
+ <f:viewParam name="templates"
value="#{templateBean.templates}">
+ <f:converter converterId="templatesListConverter" />
+ </f:viewParam>
+ </f:metadata>
+ </ui:define>
+
+ <ui:define name="head">
+ <h:outputStylesheet library="css" name="richDragAndDrop.css"
/>
+ </ui:define>
+
+ <ui:define name="component">
+
+ <rich:dragIndicator id="indicator" />
+
+ <rich:dragIndicator id="indicator2" acceptClass="acceptClass"
+ rejectClass="rejectClass" draggingClass="draggingClass" />
+ <p>Use @indicator=indicator2 to switch to usage of second defined
+ indicator with custom styling</p>
+
+
+ <table>
+ <tr>
+ <td><metamer:dragSource id="draggable1"
+ dragValue="#{richDragSourceBean.dragValues[0]}"
+ dragIndicator="#{richDragSourceBean.attributes['dragIndicator'].value}"
+ type="#{richDragSourceBean.attributes['type'].value}"
+ rendered="#{richDragSourceBean.attributes['rendered'].value}"
/>
+
+ </td>
+ <td><a4j:outputPanel id="draggable2" layout="block"
+ styleClass="metamer-draggable">
+ <h:outputText value="#2: type=drg2" />
+ <rich:dragSource type="drg2" dragIndicator="indicator"
+ dragValue="#{richDragSourceBean.dragValues[1]}" />
+ </a4j:outputPanel>
+ </td>
+ <td><a4j:outputPanel id="draggable3" layout="block"
+ styleClass="metamer-draggable">
+ <h:outputText value="#3: type=drg3" />
+ <rich:dragSource type="drg3" dragIndicator="indicator"
+ dragValue="#{richDragSourceBean.dragValues[2]}" />
+ </a4j:outputPanel>
+ </td>
+ </tr>
+ </table>
+
+ <a4j:outputPanel id="droppable1" layout="block"
+ styleClass="metamer-droppable" style="float: left">
+ <rich:dropTarget id="richDropTarget1"
+ dropValue="#{richDropTargetBean.dropValue}"
+ dropListener="#{richDropListenerBean.processDragging}"
+ acceptedTypes="drg1, drg2" render="droppable1 droppable2" />
+
+ <h:outputText value="Accepts: drg1, drg2" />
+ <br />
+
+ <h:outputText id="dropNumber1"
+ value="Drops: #{richDropTargetBean.dropValue.number}" />
+ <br />
+
+
+
+ <h:dataTable id="droppedValues1" var="droppedValue"
+ value="#{richDropTargetBean.droppedEntries1}">
+ <h:column>
+ <f:facet name="header">
+ Dragged
+ </f:facet>
+ <h:outputText value="##{droppedValue.value.number}" />
+ </h:column>
+ <h:column>
+ <f:facet name="header">
+ Dropped
+ </f:facet>
+ <h:outputText value="#{droppedValue.key.number}" />
+ </h:column>
+
+ </h:dataTable>
+ </a4j:outputPanel>
+
+ <a4j:outputPanel id="droppable2" layout="block"
+ styleClass="metamer-droppable">
+ <rich:dropTarget id="richDropTarget2"
+ dropValue="#{richDropTargetBean.dropValue}"
+ dropListener="#{richDropListenerBean.processDragging}"
+ acceptedTypes="drg2, drg3" render="droppable1 droppable2" />
+
+ <h:outputText value="Accepts: drg2, drg3" />
+ <br />
+
+ <h:outputText id="dropNumber2"
+ value="Drops: #{richDropTargetBean.dropValue.number}" />
+ <br />
+
+
+
+ <h:dataTable id="droppedValues2" var="droppedValue"
+ value="#{richDropTargetBean.droppedEntries2}">
+ <h:column>
+ <f:facet name="header">
+ Dragged
+ </f:facet>
+ <h:outputText value="##{droppedValue.value.number}" />
+ </h:column>
+ <h:column>
+ <f:facet name="header">
+ Dropped
+ </f:facet>
+ <h:outputText value="#{droppedValue.key.number}" />
+ </h:column>
+
+ </h:dataTable>
+ </a4j:outputPanel>
+
+ </ui:define>
+
+ <ui:define name="outOfTemplateAfter">
+ <a4j:outputPanel ajaxRendered="true">
+ <h:panelGrid columns="2">
+ <h:outputLabel value="Drop Event:"
+ rendered="#{not empty richDropListenerBean.dropEvent}" />
+ <h:panelGroup rendered="#{not empty
richDropListenerBean.dropEvent}">
+ <h:panelGrid columns="2">
+ <h:outputLabel value="clientId:" />
+ <h:outputText
+ value="#{richDropListenerBean.dropEvent.component.clientId}" />
+
+ <h:outputLabel value="Drag Value:" />
+ <h:outputText value="#{richDropListenerBean.dropEvent.dragValue}"
/>
+
+ <h:outputLabel value="Drop Value:" />
+ <h:outputText value="#{richDropListenerBean.dropEvent.dropValue}"
/>
+ </h:panelGrid>
+ </h:panelGroup>
+ </h:panelGrid>
+ </a4j:outputPanel>
+
+ <metamer:attributes value="#{richDragSourceBean.attributes}"
+ id="attributes" />
+ </ui:define>
+
+</ui:composition>
+</html>
\ No newline at end of file
Modified:
modules/tests/metamer/trunk/application/src/main/webapp/components/richDragSource/list.xhtml
===================================================================
---
modules/tests/metamer/trunk/application/src/main/webapp/components/richDragSource/list.xhtml 2011-07-07
09:35:13 UTC (rev 22541)
+++
modules/tests/metamer/trunk/application/src/main/webapp/components/richDragSource/list.xhtml 2011-07-07
13:41:57 UTC (rev 22542)
@@ -36,6 +36,10 @@
<div>Attributes are tied to first of components.</div>
<div>After drop to target, details of event appears.</div>
</metamer:testPageLink>
+
+ <metamer:testPageLink id="cc" outcome="cc"
value="Composite Component">
+ <div>The 3 simple <b>rich:dragSource</b> components
defined in a custom composite component (RF-10992).</div>
+ </metamer:testPageLink>
</ui:define>
Added:
modules/tests/metamer/trunk/application/src/main/webapp/resources/metamer/dragSource.xhtml
===================================================================
---
modules/tests/metamer/trunk/application/src/main/webapp/resources/metamer/dragSource.xhtml
(rev 0)
+++
modules/tests/metamer/trunk/application/src/main/webapp/resources/metamer/dragSource.xhtml 2011-07-07
13:41:57 UTC (rev 22542)
@@ -0,0 +1,29 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html
xmlns="http://www.w3.org/1999/xhtml"
+
xmlns:h="http://java.sun.com/jsf/html"
+
xmlns:f="http://java.sun.com/jsf/core"
+
xmlns:c="http://java.sun.com/jsp/jstl/core"
+
xmlns:composite="http://java.sun.com/jsf/composite"
+
xmlns:a4j="http://richfaces.org/a4j"
+
xmlns:rich="http://richfaces.org/rich">
+
+<h:body>
+ <composite:interface>
+ <composite:attribute name="id" type="java.lang.String"
required="true" />
+ <composite:attribute name="dragValue" type="java.lang.String"
/>
+ <composite:attribute name="type" type="java.lang.String"
required="true" />
+ <composite:attribute name="dragIndicator"
type="java.lang.String" />
+ <composite:attribute name="rendered" type="java.lang.Boolean"
/>
+ </composite:interface>
+
+ <composite:implementation>
+ <a4j:outputPanel id="#{cc.attrs.id}" layout="block"
styleClass="metamer-draggable" style="border: 3px solid red">
+ <h:outputText value="type=#{cc.attrs.type}" />
+ <rich:dragSource dragValue="#{cc.attrs.dragValue}"
+ dragIndicator="#{cc.attrs.dragIndicator}"
+ type="#{cc.attrs.type}"
+ rendered="#{cc.attrs.rendered}" />
+ </a4j:outputPanel>
+ </composite:implementation>
+</h:body>
+</html>