JBoss Rich Faces SVN: r4574 - trunk/framework/api/src/main/java/org/richfaces/component.
by richfaces-svn-commits@lists.jboss.org
Author: alexsmirnov
Date: 2007-12-06 15:28:56 -0500 (Thu, 06 Dec 2007)
New Revision: 4574
Modified:
trunk/framework/api/src/main/java/org/richfaces/component/Draggable.java
Log:
Append methods for a bean properties "grabCursor" and "grabbingCursor"
Modified: trunk/framework/api/src/main/java/org/richfaces/component/Draggable.java
===================================================================
--- trunk/framework/api/src/main/java/org/richfaces/component/Draggable.java 2007-12-06 20:27:24 UTC (rev 4573)
+++ trunk/framework/api/src/main/java/org/richfaces/component/Draggable.java 2007-12-06 20:28:56 UTC (rev 4574)
@@ -117,4 +117,10 @@
public void setDragListener(MethodBinding binding);
public MethodBinding getDragListener();
+ public String getGrabCursor();
+ public void setGrabCursor(String grabCursor);
+
+ public String getGrabbingCursor();
+ public void setGrabbingCursor(String grabbingCursor);
+
}
18 years, 5 months
JBoss Rich Faces SVN: r4573 - branches/3.1.x/ui/listShuttle/src/main/resources/org/richfaces/renderkit/html/css.
by richfaces-svn-commits@lists.jboss.org
Author: vmolotkov
Date: 2007-12-06 15:27:24 -0500 (Thu, 06 Dec 2007)
New Revision: 4573
Modified:
branches/3.1.x/ui/listShuttle/src/main/resources/org/richfaces/renderkit/html/css/listShuttle.xcss
Log:
bug: RF-1520
Modified: branches/3.1.x/ui/listShuttle/src/main/resources/org/richfaces/renderkit/html/css/listShuttle.xcss
===================================================================
--- branches/3.1.x/ui/listShuttle/src/main/resources/org/richfaces/renderkit/html/css/listShuttle.xcss 2007-12-06 19:48:18 UTC (rev 4572)
+++ branches/3.1.x/ui/listShuttle/src/main/resources/org/richfaces/renderkit/html/css/listShuttle.xcss 2007-12-06 20:27:24 UTC (rev 4573)
@@ -19,6 +19,8 @@
.rich-shuttle-header-tab-cell {
padding : 0px 2px;
+ border-style: solid;
+ border-left:0;
}
.rich-shuttle-internal-tab {
@@ -124,7 +126,9 @@
}
.rich-shuttle-header-tab-cell-end {
- border-right : 0px;
+ border-style:solid;
+ border-right: 0;
+ border-left: 0;
white-space: nowrap;
padding : 2px;
}
@@ -134,8 +138,8 @@
white-space: nowrap;
}
-.rich-shuttle-source-cell-selected, .rich-shuttle-target-cell-selected, .rich-shuttle-source-cell-selected *, .rich-shuttle-target-cell-selected * {
- padding : 2px 0px;
+.rich-shuttle-source-cell-selected, .rich-shuttle-target-cell-selected {
+ padding : 2px;
white-space: nowrap;
}
@@ -165,11 +169,25 @@
<u:style name="font-family" skin="headerFamilyFont" />
<u:style name="font-size" skin="headerSizeFont" />
<u:style name="font-weight" skin="headerWeightFont" />
+ <u:style name="border-width" skin="tableBorderWidth" />
<u:style name="border-top-color" skin="subBorderColor" />
- <u:style name="border-bottom-color" skin="tableBorderColor" />
- <u:style name="border-right-color" skin="tableBorderColor" />
- <u:style name="border-left-color" skin="panelBorderColor" />
+ <u:style name="border-bottom-color" skin="panelBorderColor" />
+ <u:style name="border-right-color" skin="panelBorderColor" />
</u:selector>
+
+<u:selector name=".rich-shuttle-header-tab-cell-end">
+ <u:style name="background-image">
+ <f:resource f:key="org.richfaces.renderkit.html.gradientimages.OrderingListHeaderGradient" />
+ </u:style>
+ <u:style name="background-color" skin="trimColor" />
+ <u:style name="color" skin="headerTextColor" />
+ <u:style name="font-family" skin="headerFamilyFont" />
+ <u:style name="font-size" skin="headerSizeFont" />
+ <u:style name="font-weight" skin="headerWeightFont" />
+ <u:style name="border-width" skin="tableBorderWidth" />
+ <u:style name="border-top-color" skin="subBorderColor" />
+ <u:style name="border-bottom-color" skin="panelBorderColor" />
+ </u:selector>
<u:selector name=".rich-list-shuttle-button">
<u:style name="background-image">
18 years, 5 months
JBoss Rich Faces SVN: r4572 - branches/3.1.x/ui/orderingList/src/main/resources/org/richfaces/renderkit/html/css.
by richfaces-svn-commits@lists.jboss.org
Author: vmolotkov
Date: 2007-12-06 14:48:18 -0500 (Thu, 06 Dec 2007)
New Revision: 4572
Modified:
branches/3.1.x/ui/orderingList/src/main/resources/org/richfaces/renderkit/html/css/orderingList.xcss
Log:
bug: RF-1515
Modified: branches/3.1.x/ui/orderingList/src/main/resources/org/richfaces/renderkit/html/css/orderingList.xcss
===================================================================
--- branches/3.1.x/ui/orderingList/src/main/resources/org/richfaces/renderkit/html/css/orderingList.xcss 2007-12-06 19:20:08 UTC (rev 4571)
+++ branches/3.1.x/ui/orderingList/src/main/resources/org/richfaces/renderkit/html/css/orderingList.xcss 2007-12-06 19:48:18 UTC (rev 4572)
@@ -102,7 +102,7 @@
.rich-ordering-list-header {
overflow: hidden;
- height: 18px;
+ /*height: 18px;*/
}
.rich-ordering-list-items {
@@ -137,7 +137,8 @@
}
.rich-ordering-list-table-header-cell-end {
- border-right : 0px;
+ border-style:solid;
+ border-right: 0;
white-space: nowrap;
}
@@ -242,6 +243,10 @@
<u:style name="font-family" skin="headerFamilyFont" />
<u:style name="font-size" skin="headerSizeFont" />
<u:style name="font-weight" skin="headerWeightFont" />
+ <u:style name="border-width" skin="tableBorderWidth" />
+ <u:style name="border-top-color" skin="subBorderColor" />
+ <u:style name="border-bottom-color" skin="tableBorderColor" />
+ <u:style name="border-left-color" skin="panelBorderColor" />
</u:selector>
<u:selector name=".rich-ordering-list-cell-end">
18 years, 5 months
JBoss Rich Faces SVN: r4571 - in trunk/ui/drag-drop/src/main: java/org/richfaces/renderkit and 1 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: abelevich
Date: 2007-12-06 14:20:08 -0500 (Thu, 06 Dec 2007)
New Revision: 4571
Modified:
trunk/ui/drag-drop/src/main/config/component/dragSupport.xml
trunk/ui/drag-drop/src/main/java/org/richfaces/renderkit/DraggableRendererContributor.java
trunk/ui/drag-drop/src/main/resources/org/richfaces/renderkit/html/scripts/simple-draggable.js
Log:
add grab and grabbing cursor support for the rich:dragSupport (RF-1403)
Modified: trunk/ui/drag-drop/src/main/config/component/dragSupport.xml
===================================================================
--- trunk/ui/drag-drop/src/main/config/component/dragSupport.xml 2007-12-06 19:18:16 UTC (rev 4570)
+++ trunk/ui/drag-drop/src/main/config/component/dragSupport.xml 2007-12-06 19:20:08 UTC (rev 4571)
@@ -62,6 +62,23 @@
JavaScript code for call before submission of ajax event
</description>
</property>
+
+ <property>
+ <name>grabCursor</name>
+ <classname>java.lang.String</classname>
+ <description>
+ list of comma separated cursors that indicates then user can grab and drag an object
+ </description>
+ </property>
+
+ <property>
+ <name>grabbingCursor</name>
+ <classname>java.lang.String</classname>
+ <description>
+ list of comma separated cursors that indicates then the user has grabbed something
+ </description>
+ </property>
+
<property hidden="true" >
<name>actionExpression</name>
Modified: trunk/ui/drag-drop/src/main/java/org/richfaces/renderkit/DraggableRendererContributor.java
===================================================================
--- trunk/ui/drag-drop/src/main/java/org/richfaces/renderkit/DraggableRendererContributor.java 2007-12-06 19:18:16 UTC (rev 4570)
+++ trunk/ui/drag-drop/src/main/java/org/richfaces/renderkit/DraggableRendererContributor.java 2007-12-06 19:20:08 UTC (rev 4571)
@@ -77,6 +77,8 @@
super((UIComponent) draggable);
addOption("dragType", draggable.getDragType());
+ addOption("grab", convertCursorStyle(draggable.getGrabCursor()));
+ addOption("grabbing",convertCursorStyle(draggable.getGrabbingCursor()));
addEventHandler("ondragstart", draggable.getOndragstart());
addEventHandler("ondragend", draggable.getOndragend());
addEventHandler("ondropover",draggable.getOndropover());
@@ -84,6 +86,17 @@
}
}
+
+ public String convertCursorStyle(String cursors){
+ StringBuffer cursorStyle = new StringBuffer();
+ if(cursors != null){
+ String [] entries = cursors.split(",");
+ for (int i = 0; i < entries.length; i++) {
+ cursorStyle.append("cursor: " + entries[i] + ";");
+ }
+ }
+ return cursorStyle.toString();
+ }
public void decode(FacesContext context, UIComponent component, CompositeRenderer compositeRenderer) {
DnDEventsExchangeMailer eventsExchanger = DnDEventsExchangeMailer.getInstance(context);
Modified: trunk/ui/drag-drop/src/main/resources/org/richfaces/renderkit/html/scripts/simple-draggable.js
===================================================================
--- trunk/ui/drag-drop/src/main/resources/org/richfaces/renderkit/html/scripts/simple-draggable.js 2007-12-06 19:18:16 UTC (rev 4570)
+++ trunk/ui/drag-drop/src/main/resources/org/richfaces/renderkit/html/scripts/simple-draggable.js 2007-12-06 19:20:08 UTC (rev 4571)
@@ -15,13 +15,17 @@
this.dragIndicatorId = this.options.dragIndicator;
this.eventMouseDown = this.initDrag.bindAsEventListener(this);
-
+
Event.observe(this.id, "mousedown", this.eventMouseDown);
this.form = this.id;
while (this.form && !/^form$/i.test(this.form.tagName)) {
this.form = this.form.parentNode;
}
+
+ if (this.options.grab || this.options.grabbing) {
+ this.enableDraggableCursors();
+ }
},
getDnDDragParams: function() {
@@ -63,7 +67,7 @@
},
initDrag: function(event) {
- if(Event.isLeftClick(event)) {
+ if (Event.isLeftClick(event)) {
var src = Event.element(event);
if(src.tagName && (
src.tagName.toUpperCase() == 'INPUT' ||
18 years, 5 months
JBoss Rich Faces SVN: r4570 - trunk/framework/impl/src/main/resources/org/richfaces/renderkit/html/scripts/dnd.
by richfaces-svn-commits@lists.jboss.org
Author: abelevich
Date: 2007-12-06 14:18:16 -0500 (Thu, 06 Dec 2007)
New Revision: 4570
Modified:
trunk/framework/impl/src/main/resources/org/richfaces/renderkit/html/scripts/dnd/dnd-draggable.js
Log:
add grab and grabbing cursor support for the rich:dragSupport (RF-1403)
Modified: trunk/framework/impl/src/main/resources/org/richfaces/renderkit/html/scripts/dnd/dnd-draggable.js
===================================================================
--- trunk/framework/impl/src/main/resources/org/richfaces/renderkit/html/scripts/dnd/dnd-draggable.js 2007-12-06 18:39:12 UTC (rev 4569)
+++ trunk/framework/impl/src/main/resources/org/richfaces/renderkit/html/scripts/dnd/dnd-draggable.js 2007-12-06 19:18:16 UTC (rev 4570)
@@ -59,6 +59,29 @@
};
+DnD.Cursor = Class.create();
+DnD.Cursor.prototype = {
+
+ initialize: function(element,cursor) {
+ this.element = element;
+ this.cursor = cursor;
+ this.visible = false;
+ },
+
+ showCursor: function() {
+ var parent = this.element;
+ Element.setStyle(parent,this.cursor);
+ this.visible = true;
+ },
+
+ hideCursor: function() {
+ var parent = this.element;
+ parent.style.cursor = "" ;
+ this.visible = false;
+ }
+
+};
+
DnD.Draggable.prototype = {
getElement: function() {
@@ -144,7 +167,15 @@
startDrag : function(event) {
var contentType = this.getContentType();
-
+
+ if(this.grabbingCursor) {
+ if(this.grabCursor && this.grabCursor.visible) {
+ this.grabCursor.hideCursor();
+ }
+ this.grabbingCursor.showCursor();
+ }
+ window.status= document.body.style.cursor;
+
if (contentType) {
if (!this.endDragListener) {
this.dragTrigger = this.moveDrag.bindAsEventListener(this);
@@ -213,6 +244,7 @@
*/
endDrag: function(event, drag) {
DnD.endDrag(event);
+
this.lastDragX = undefined;
this.lastDragY = undefined;
@@ -234,13 +266,28 @@
}
this.ondragend(event, drag);
+
}
+ var grabbingCursor = this.getCurrentGrabbingCursor();
+
+ if (grabbingCursor) {
+ if (grabbingCursor.visible) {
+ grabbingCursor.hideCursor();
+ }
+ }
+ window.status= document.body.style.cursor;
+
+
var options = this.getDraggableOptions();
if (options && options.ondragend) {
options.ondragend(event);
}
},
+
+ attachCursor: function () {
+ this.cursor = new DnD.Cursor();
+ },
/**
* cubclasses may define custom behavior
@@ -254,6 +301,64 @@
},
+ ondragover: function(event) {
+ var grabCursor = this.getCurrentGrabCursor();
+ if(!document.body.style.cursor) {
+ if(grabCursor) {
+ if(!grabCursor.visible) {
+ grabCursor.showCursor();
+ }
+ }
+ }
+ this.i = this.i + 1
+ window.status= this.i;
+ },
+
+ ondragout: function(event) {
+ var grabCursor = this.getCurrentGrabCursor();
+ if (grabCursor) {
+ if(grabCursor.visible) {
+ grabCursor.hideCursor();
+ }
+ }
+ window.status= document.body.style.cursor;
+ },
+
+ getCurrentGrabbingCursor: function() {
+ var drag = window.drag;
+ var grabbingCursor = this.grabbingCursor;
+ if(drag) {
+ grabbingCursor = drag.source.grabbingCursor;
+ }
+ return grabbingCursor;
+ },
+
+ getCurrentGrabCursor: function() {
+ var drag = window.drag;
+ var grabCursor = this.grabCursor
+ if(drag) {
+ grabCursor = drag.source.grabCursor;
+ }
+ return grabCursor;
+ },
+
+ onmouseup: function (event) {
+ var grabbingCursor = this.getCurrentGrabbingCursor();
+ var grabCursor = this.grabCursor;
+
+ if(grabbingCursor && grabbingCursor.visible) {
+ grabbingCursor.hideCursor();
+ }
+
+ if(grabCursor) {
+ grabCursor.showCursor();
+ }
+
+ window.status= document.body.style.cursor;
+
+
+ },
+
ondropover: function(event, drag) {
var options = this.getDraggableOptions();
if (options && options.ondropover) {
@@ -268,8 +373,53 @@
event.drag = drag;
options.ondropout(event);
}
- }
+ },
+ enableDraggableCursors: function() {
+
+ if(this.options){
+ var element = this.getElement();
+
+ if(this.options.grab){
+
+ this.dragOutBound = this.ondragout.bindAsEventListener(this);
+ this.dragOverBound = this.ondragover.bindAsEventListener(this);
+ this.dragUpBound = this.onmouseup.bindAsEventListener(this);
+
+ Event.observe(element, "mouseout", this.dragOutBound);
+ Event.observe(element, "mouseover", this.dragOverBound);
+ Event.observe(element, "mouseup", this.dragUpBound);
+ this.i = 0;
+ this.grabCursor = new DnD.Cursor(element,this.options.grab);
+ }
+
+ if (this.options.grabbing) {
+
+ this.grabbingCursor = new DnD.Cursor(document.body,this.options.grabbing);
+ }
+ }
+
+ },
+
+ disableDraggableCursors: function() {
+ var element = this.getElement();
+ if(this.dragOutBound && this.dragOverBound) {
+ Event.stopObserving(element, "mouseover", this.dragOutBound);
+ Event.stopObserving(element, "mouseout", this.dragOverBound);
+ } else {
+ return false;
+ }
+ return true;
+ },
+
+ isDraggableCursorsEnabled: function() {
+ if (this.isCursorsEnabled) {
+ this.isCursorsEnabled = true;
+ } else {
+ this.isCursorsEnabled = false;
+ }
+ return this.isCursorsEnabled;
+ }
};
DefaultDragIndicator = {
18 years, 5 months
JBoss Rich Faces SVN: r4569 - branches/3.1.x/ui/listShuttle/src/main/resources/org/richfaces/renderkit/html/scripts.
by richfaces-svn-commits@lists.jboss.org
Author: vmolotkov
Date: 2007-12-06 13:39:12 -0500 (Thu, 06 Dec 2007)
New Revision: 4569
Modified:
branches/3.1.x/ui/listShuttle/src/main/resources/org/richfaces/renderkit/html/scripts/ListShuttle.js
Log:
bug: RF-1546
Modified: branches/3.1.x/ui/listShuttle/src/main/resources/org/richfaces/renderkit/html/scripts/ListShuttle.js
===================================================================
--- branches/3.1.x/ui/listShuttle/src/main/resources/org/richfaces/renderkit/html/scripts/ListShuttle.js 2007-12-06 18:36:27 UTC (rev 4568)
+++ branches/3.1.x/ui/listShuttle/src/main/resources/org/richfaces/renderkit/html/scripts/ListShuttle.js 2007-12-06 18:39:12 UTC (rev 4569)
@@ -172,6 +172,10 @@
var item = this.sourceList.getEventTargetRow(event);
this.moveItem(sourceComponent, targetComponent, item);
+ this.controlListManager();
+ this.targetList.controlListManager();
+ this.saveState();
+
this.targetLayoutManager.widthSynchronization();
this.sourceLayoutManager.widthSynchronization();
}
18 years, 5 months
JBoss Rich Faces SVN: r4568 - in branches/3.1.x/docs/userguide: en/src/main/docbook and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: vkorluzhenko
Date: 2007-12-06 13:36:27 -0500 (Thu, 06 Dec 2007)
New Revision: 4568
Modified:
branches/3.1.x/docs/userguide/en/src/main/docbook/master.xml
branches/3.1.x/docs/userguide/pom.xml
Log:
http://jira.jboss.com/jira/browse/RF-1537 - added new componet into building process
Modified: branches/3.1.x/docs/userguide/en/src/main/docbook/master.xml
===================================================================
--- branches/3.1.x/docs/userguide/en/src/main/docbook/master.xml 2007-12-06 18:34:11 UTC (rev 4567)
+++ branches/3.1.x/docs/userguide/en/src/main/docbook/master.xml 2007-12-06 18:36:27 UTC (rev 4568)
@@ -50,8 +50,10 @@
<!ENTITY contextMenu_table SYSTEM "../../../target/generated/contextMenu.xml">
<!ENTITY listShuttle_table SYSTEM "../../../target/generated/listShuttle.xml">
<!ENTITY orderingList_table SYSTEM "../../../target/generated/orderingList.xml">
+<!ENTITY componentControl_table SYSTEM "../../../target/generated/componentControl.xml">
+
<!ENTITY coreComponents_table SYSTEM "../../../target/generated/a4j.xml">
]>
@@ -84,6 +86,7 @@
-->
&coreComponents_table;
&calendar_table;
+&componentControl_table;
&contextMenu_table;
&dataFilterSlider_table;
&dataScroller_table;
Modified: branches/3.1.x/docs/userguide/pom.xml
===================================================================
--- branches/3.1.x/docs/userguide/pom.xml 2007-12-06 18:34:11 UTC (rev 4567)
+++ branches/3.1.x/docs/userguide/pom.xml 2007-12-06 18:36:27 UTC (rev 4568)
@@ -70,6 +70,19 @@
org.richfaces.ui
</groupId>
<artifactId>
+ componentControl
+ </artifactId>
+ <version>
+ ${project.version}
+ </version>
+ </artifactItem>
+
+
+ <artifactItem>
+ <groupId>
+ org.richfaces.ui
+ </groupId>
+ <artifactId>
contextMenu
</artifactId>
<version>
18 years, 5 months
JBoss Rich Faces SVN: r4567 - branches/3.1.x/docs/userguide/en/src/main/docbook/included.
by richfaces-svn-commits@lists.jboss.org
Author: vkorluzhenko
Date: 2007-12-06 13:34:11 -0500 (Thu, 06 Dec 2007)
New Revision: 4567
Added:
branches/3.1.x/docs/userguide/en/src/main/docbook/included/componentControl.desc.xml
branches/3.1.x/docs/userguide/en/src/main/docbook/included/componentControl.xml
Log:
http://jira.jboss.com/jira/browse/RF-1537 - added description for component
Added: branches/3.1.x/docs/userguide/en/src/main/docbook/included/componentControl.desc.xml
===================================================================
--- branches/3.1.x/docs/userguide/en/src/main/docbook/included/componentControl.desc.xml (rev 0)
+++ branches/3.1.x/docs/userguide/en/src/main/docbook/included/componentControl.desc.xml 2007-12-06 18:34:11 UTC (rev 4567)
@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<section>
+ <sectioninfo>
+ <keywordset>
+ <keyword>componentControl</keyword>
+ </keywordset>
+ </sectioninfo>
+ <section>
+ <title>Description</title>
+ <para>The <emphasis role="bold">
+ <property><rich:componentControl></property>
+ </emphasis> component allows to manage other components or operation on other components
+ via API.</para>
+
+ </section>
+ <!--section>
+ <title>Key Features</title>
+ <itemizedlist>
+ <listitem>Highly customizable look and feel</listitem>
+ <listitem>Popup representation</listitem>
+ <listitem>Disablement support</listitem>
+ <listitem>Smart and user-defined positioning</listitem>
+ <listitem>Cells customization</listitem>
+ <listitem>Macro substitution based on tool bars customization</listitem>
+ </itemizedlist>
+ </section-->
+</section>
Added: branches/3.1.x/docs/userguide/en/src/main/docbook/included/componentControl.xml
===================================================================
--- branches/3.1.x/docs/userguide/en/src/main/docbook/included/componentControl.xml (rev 0)
+++ branches/3.1.x/docs/userguide/en/src/main/docbook/included/componentControl.xml 2007-12-06 18:34:11 UTC (rev 4567)
@@ -0,0 +1,192 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<section>
+ <sectioninfo>
+ <keywordset>
+ <keyword>componentControl</keyword>
+ </keywordset>
+ </sectioninfo>
+
+ <table>
+ <title>Component identification parameters</title>
+
+ <tgroup cols="2">
+ <thead>
+ <row>
+ <entry>Name</entry>
+
+ <entry>Value</entry>
+ </row>
+ </thead>
+
+ <tbody>
+ <row>
+ <entry>component-type</entry>
+
+ <entry>org.richfaces.ComponentControl</entry>
+ </row>
+
+ <row>
+ <entry>component-class</entry>
+
+ <entry>org.richfaces.component.html.HtmlComponentControl</entry>
+ </row>
+
+ <row>
+ <entry>component-family</entry>
+
+ <entry>org.richfaces.ComponentControl</entry>
+ </row>
+
+ <row>
+ <entry>renderer-type</entry>
+
+ <entry>org.richfaces.ComponentControlRenderer</entry>
+ </row>
+
+ <row>
+ <entry>tag-class</entry>
+
+ <entry>org.richfaces.taglib.ComponentControlTag</entry>
+ </row>
+ </tbody>
+ </tgroup>
+ </table>
+
+ <section>
+ <title>Creating the Component with a Page Tag</title>
+
+ <para>To create the simplest variant on a page use the following syntax:</para>
+
+
+ <para>
+ <emphasis role="bold">Example:</emphasis>
+ </para>
+ <programlisting role="XML"><![CDATA[...
+ <rich:componentControl attachTo="doExpandCalendarID" for="ccCalendarID" event="onclick" operation="doExpand" />
+...]]></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.HtmlComponentControl;
+...
+HtmlComponentControl myCalendar = new HtmlComponentControl();
+...
+]]></programlisting>
+ </section>
+
+ <section>
+ <title>Details of Usage</title>
+ <para>There are three ways to attach the <emphasis role="bold">
+ <property><rich:componentControl></property>
+ </emphasis> to another component.</para>
+ <itemizedlist>
+ <listitem>Defining a name of a function that is generated. An "event"
+ argument is passed to this function.</listitem>
+ </itemizedlist>
+ <para>An example is placed below:</para>
+ <programlisting role="XML"><![CDATA[...
+ <rich:componentControl name="ffunction" for="comp_ID" operation="show"/>
+...
+]]></programlisting>
+ <para>According to this code a function with name <property>"call"</property>
+ is generated. It could be used in JavaScript code to trigger an operation on the target
+ component with defined id=<property>"comp_ID"</property>.</para>
+ <para>The generated function is shown below:</para>
+ <programlisting role="JAVA"><![CDATA[function ffunction (event) {
+}
+]]></programlisting>
+ <itemizedlist>
+ <listitem>Attaching to a parent component (usage is similar to <emphasis role="bold">
+ <property><a4j:support></property>
+ </emphasis> component)</listitem>
+ </itemizedlist>
+ <para>An example is placed below:</para>
+
+ <programlisting role="XML"><![CDATA[...
+ <rich:modalPanel id="ccModalPanelID" onshow="alert(event.parameters.show)" onhide="alert(event.parameters.hide)">
+ ...
+ </rich:modalPanel>
+ <h:commandButton value="Show Modal Panel">
+ <rich:componentControl for="ccModalPanelID" event="onclick" disableDefault="true" operation="show" params="show:'componentControl work(show)'" />
+ </h:commandButton>
+...
+]]></programlisting>
+ <para>In the example is shown a possibility to manage <emphasis role="bold">
+ <property><rich:modalpanel></property>
+ </emphasis> component via <emphasis role="bold">
+ <property><h:commandButton></property>
+ </emphasis>. The <emphasis>
+ <property>"for"</property>
+ </emphasis> attribute contains value of an Id of <emphasis role="bold">
+ <property><rich:modalpanel></property>
+ </emphasis> component. The <emphasis>
+ <property>"operation"</property>
+ </emphasis> attribute contains a name of JavaScript API function. The <emphasis>
+ <property>"disableDefault"</property>
+ </emphasis> attribute with <property>"true"</property> value is used instead
+ of <property>onclick="return false;"</property> attribute for <emphasis role="bold">
+ <property><h:commandButton></property>
+ </emphasis> to avoid a problem with form submit and <property>modalPanel</property> showing.</para>
+ <itemizedlist>
+ <listitem>Attaching with <emphasis>
+ <property>"attachTo"</property>
+ </emphasis> attribute</listitem>
+ </itemizedlist>
+ <para>An example is placed below:</para>
+
+ <programlisting role="XML"><![CDATA[...
+ <rich:calendar popup="#{componentControl.calendarPopup}" id="ccCalendarID" />
+ ...
+ <f:verbatim>
+ <a href="#" id="doExpandCalendarID">Calendar (nextYear)</a>
+ </f:verbatim>
+ <rich:componentControl attachTo="doExpandCalendarID" for="ccCalendarID" event="onclick" disableDefault="true" operation="nextYear" />
+...
+]]></programlisting>
+ <para>In the example is shown a possibility to manage the <emphasis role="bold">
+ <property><rich:calendar></property>
+ </emphasis> component. The <emphasis>
+ <property>"attachTo"</property>
+ </emphasis> attribute contais a value of an Id of <property><a></property> tag.
+ The <emphasis>
+ <property>"for"</property>
+ </emphasis> attribute contains value of an Id of <emphasis role="bold">
+ <property><rich:calendar></property>
+ </emphasis> component. The <emphasis>
+ <property>"operation"</property>
+ </emphasis> attribute contains a name of JavaScript API function. Thus, clicking on the link
+ represents the next year on the calendar.</para>
+ <!--para>One more example of <emphasis role="bold">
+ <property><rich:componentControl></property>
+ </emphasis> usage is placed below:</para>
+ <programlisting role="XML"><![CDATA[...
+ <rich:panelMenu id="ccContextMenuPanelMenuID">
+ <h:outputText value="click text" />
+ </rich:panelMenu>
+ <rich:contextMenu id="ccContextMenuID" submitMode="ajax">
+ <rich:menuItem icon="/pics/header.png" value="tab1" reRender="cmInfoID">
+ <f:param name="cmdParam" value="menu" />
+ </rich:menuItem>
+ <rich:menuSeparator />
+ <rich:menuItem icon="/pics/info.gif" value="a" reRender="cmInfoID">
+ <f:param name="cmdParam" value="a" />
+ </rich:menuItem>
+ <rich:menuItem icon="/pics/info.gif" value=" b" reRender="cmInfoID">
+ <f:param name="cmdParam" value="b" />
+ </rich:menuItem>
+ <rich:menuItem icon="/pics/info.gif" value="c" reRender="cmInfoID">
+ <f:param name="cmdParam" value="c" />
+ </rich:menuItem>
+ </rich:contextMenu>
+ <rich:componentControl event="oncontextmenu" attachTo="ccContextMenuPanelMenuID" for="ccContextMenuID" disableDefault="true" operation="doShow" />
+...
+]]></programlisting-->
+
+ </section>
+
+</section>
18 years, 5 months
JBoss Rich Faces SVN: r4566 - branches/3.1.x/ui/orderingList/src/main/resources/org/richfaces/renderkit/html/scripts.
by richfaces-svn-commits@lists.jboss.org
Author: vmolotkov
Date: 2007-12-06 13:20:46 -0500 (Thu, 06 Dec 2007)
New Revision: 4566
Modified:
branches/3.1.x/ui/orderingList/src/main/resources/org/richfaces/renderkit/html/scripts/LayoutManager.js
Log:
bugs: RF-1541, RF-1528
Modified: branches/3.1.x/ui/orderingList/src/main/resources/org/richfaces/renderkit/html/scripts/LayoutManager.js
===================================================================
--- branches/3.1.x/ui/orderingList/src/main/resources/org/richfaces/renderkit/html/scripts/LayoutManager.js 2007-12-06 18:05:25 UTC (rev 4565)
+++ branches/3.1.x/ui/orderingList/src/main/resources/org/richfaces/renderkit/html/scripts/LayoutManager.js 2007-12-06 18:20:46 UTC (rev 4566)
@@ -33,21 +33,31 @@
width = LayoutManager.calculateWidth(curCell, headCell).colWidth;
if (i == contentCells.length - 1) {
- if (this.contentDiv.clientWidth != 0) {
- width = width + (this.contentDiv.offsetWidth - this.contentDiv.clientWidth);
- }
+ width = width + this.getScrollWidth();
}
headCell.firstChild.style.width = width + "px";
headCell.style.width = width + "px";
}
- //this.headerTable.style.width = this.contentTable.offsetWidth + (this.contentDiv.offsetWidth - this.contentDiv.clientWidth);
+ } else {
+ this.headerTable.style.width = this.contentDiv.offsetWidth;
}
}
+LayoutManager.prototype.getScrollWidth = function() {
+ if (this.contentDiv.clientWidth != 0) {
+ return this.contentDiv.offsetWidth - this.contentDiv.clientWidth;
+ }
+ return 0;
+}
+
LayoutManager.prototype.scrollHandler = function(obj) {
obj.headerDiv.scrollLeft = obj.contentDiv.scrollLeft;
}
+LayoutManager.getHeaderWidth = function(visibleBox, realBox) {
+ return realBox.offsetWidth + (visibleBox.offsetWidth - visibleBox.clientWidth);
+}
+
LayoutManager.isIE = function() {
return (/MSIE/.test(navigator.userAgent) && !window.opera);
}
18 years, 5 months
JBoss Rich Faces SVN: r4565 - in branches/3.1.x/ui/listShuttle/src/main: templates/org/richfaces and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: vmolotkov
Date: 2007-12-06 13:05:25 -0500 (Thu, 06 Dec 2007)
New Revision: 4565
Modified:
branches/3.1.x/ui/listShuttle/src/main/resources/org/richfaces/renderkit/html/scripts/ListShuttle.js
branches/3.1.x/ui/listShuttle/src/main/templates/org/richfaces/htmlListShuttle.jspx
Log:
bugs: RF-1541, RF-1528
Modified: branches/3.1.x/ui/listShuttle/src/main/resources/org/richfaces/renderkit/html/scripts/ListShuttle.js
===================================================================
--- branches/3.1.x/ui/listShuttle/src/main/resources/org/richfaces/renderkit/html/scripts/ListShuttle.js 2007-12-06 17:27:03 UTC (rev 4564)
+++ branches/3.1.x/ui/listShuttle/src/main/resources/org/richfaces/renderkit/html/scripts/ListShuttle.js 2007-12-06 18:05:25 UTC (rev 4565)
@@ -51,7 +51,7 @@
};
Richfaces.ListShuttle.prototype = {
- initialize: function(targetList, sourceList, clientId, controlIds, switchByClick) {
+ initialize: function(targetList, sourceList, clientId, controlIds, switchByClick, sourceLayoutManager, targetLayoutManager) {
sourceList._onclickHandler = sourceList.onclickHandler;
sourceList.onclickHandler = function(e) { this.onclickHandler(e, sourceList); }.bindAsEventListener(this);
targetList._onclickHandler = targetList.onclickHandler;
@@ -60,6 +60,9 @@
this.targetList = targetList;
this.sourceList = sourceList;
+ this.targetLayoutManager = targetLayoutManager;
+ this.sourceLayoutManager = sourceLayoutManager;
+
this.targetList.shuttleTable.observe("dblclick", function(e) {this.moveItemByClick(window.event||e, this.targetList, this.sourceList)}.bindAsEventListener(this));
this.sourceList.shuttleTable.observe("dblclick", function(e) {this.moveItemByClick(window.event||e, this.sourceList, this.targetList)}.bindAsEventListener(this));
@@ -130,6 +133,9 @@
this.controlListManager();
this.targetList.controlListManager();
this.saveState();
+
+ this.targetLayoutManager.widthSynchronization();
+ this.sourceLayoutManager.widthSynchronization();
}
},
@@ -162,9 +168,12 @@
this.sourceList.saveState();
},
- moveItemByClick : function(event, sourceComponent, targetComponent) {
+ moveItemByClick : function(event, sourceComponent, targetComponent, layoutManager) {
var item = this.sourceList.getEventTargetRow(event);
this.moveItem(sourceComponent, targetComponent, item);
+
+ this.targetLayoutManager.widthSynchronization();
+ this.sourceLayoutManager.widthSynchronization();
}
}
@@ -174,4 +183,4 @@
copyAll: function (e) { this.moveItems(this.sourceList, this.targetList, this.sourceList.shuttleItems); return false; },
remove: function (e) { this.moveItems(this.targetList, this.sourceList, this.targetList.selectedItems); return false; },
removeAll: function (e) { this.moveItems(this.targetList, this.sourceList, this.targetList.shuttleItems); return false; }
-};
+};
\ No newline at end of file
Modified: branches/3.1.x/ui/listShuttle/src/main/templates/org/richfaces/htmlListShuttle.jspx
===================================================================
--- branches/3.1.x/ui/listShuttle/src/main/templates/org/richfaces/htmlListShuttle.jspx 2007-12-06 17:27:03 UTC (rev 4564)
+++ branches/3.1.x/ui/listShuttle/src/main/templates/org/richfaces/htmlListShuttle.jspx 2007-12-06 18:05:25 UTC (rev 4565)
@@ -180,9 +180,13 @@
Event.onReady(function() {
var cotrolsIdPrefix = [['up', 'disup'], ['down', 'disdown'], ['last', 'dislast'], ['first','disfirst']];
var listShuttleCotrolsIdPrefix = [['copy', 'discopy'], ['copyAll', 'discopyAll'], ['remove', 'disremove'], ['removeAll','disremoveAll']];
+
+ var sourceLayoutManager = new LayoutManager('#{clientId}internal_header_tab', '#{clientId}internal_tab');
+ var targetLayoutManager = new LayoutManager('#{clientId}tlInternal_header_tab', '#{clientId}tlInternal_tab');
+
var listShuttle = new Richfaces.ListShuttle(new Richfaces.ListShuttle.Target('#{clientId}', '#{clientId}tlInternal_tab', '#{clientId}tlInternal_header_tab', '#{clientId}tlFocusKeeper', cotrolsIdPrefix, '#{clientId}sortLabel', #{this:getAsEventHandler(context, component, "onorderchanged")}),
new Richfaces.ListShuttle.Source('#{clientId}', '#{clientId}internal_tab', '#{clientId}internal_header_tab', '#{clientId}focusKeeper'),
- "#{clientId}", listShuttleCotrolsIdPrefix, "#{switchByClick}");
+ "#{clientId}", listShuttleCotrolsIdPrefix, "#{switchByClick}", sourceLayoutManager, targetLayoutManager);
var sourceLayoutManager = new LayoutManager('#{clientId}internal_header_tab', '#{clientId}internal_tab');
var targetLayoutManager = new LayoutManager('#{clientId}tlInternal_header_tab', '#{clientId}tlInternal_tab');
sourceLayoutManager.widthSynchronization();
18 years, 5 months