JBoss Rich Faces SVN: r4359 - 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-11-29 12:56:20 -0500 (Thu, 29 Nov 2007)
New Revision: 4359
Modified:
branches/3.1.x/ui/orderingList/src/main/resources/org/richfaces/renderkit/html/scripts/LayoutManager.js
Log:
layout was corrected
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-11-29 17:40:01 UTC (rev 4358)
+++ branches/3.1.x/ui/orderingList/src/main/resources/org/richfaces/renderkit/html/scripts/LayoutManager.js 2007-11-29 17:56:20 UTC (rev 4359)
@@ -38,7 +38,7 @@
headCell.firstChild.style.width = width + "px";
headCell.style.width = width + "px";
}
- //this.headerTable.style.width = this.contentTable.offsetWidth + (this.contentDiv.offsetWidth - this.contentDiv.clientWidth);
+ this.headerTable.style.width = this.contentTable.offsetWidth + (this.contentDiv.offsetWidth - this.contentDiv.clientWidth);
}
}
@@ -71,7 +71,6 @@
var tgtElemMarginWidth = LayoutManager.getMarginWidth(tgtElem, "lr");
//alert("srcElemBorderWidth:" + srcElemBorderWidth + "srcElemPaddingWidth:" + srcElemPaddingWidth + "srcElemMarginWidth:" + srcElemMarginWidth + "tgtElemBorderWidth:" + tgtElemBorderWidth + "tgtElemPaddingWidth:" + tgtElemPaddingWidth + "tgtElemMarginWidth:" + tgtElemMarginWidth);
var srcWidth = srcElem.offsetWidth - srcElemBorderWidth - srcElemPaddingWidth - srcElemMarginWidth;
- //alert(tgtElem.style.width + "|" + srcElem.offsetWidth);
return {srcWidth : srcWidth, colWidth : (srcWidth + (srcElemBorderWidth - tgtElemBorderWidth)
+ (srcElemPaddingWidth - tgtElemPaddingWidth)
+ (srcElemMarginWidth - tgtElemMarginWidth))};
@@ -92,10 +91,10 @@
LayoutManager.getStyles = function(el, sides, styles) {
var val = 0;
for(var i = 0, len = sides.length; i < len; i++){
- if (el.getStyle) {
- var w = parseInt(el.getStyle(styles[sides.charAt(i)]), 10);
+ //if (el.getStyle) {
+ var w = parseInt(Element.getStyle(el, styles[sides.charAt(i)]), 10);
if(!isNaN(w)) val += w;
- }
+ //}
}
return val;
}
17 years, 1 month
JBoss Rich Faces SVN: r4358 - trunk/docs/userguide/en/src/main/docbook/included.
by richfaces-svn-commits@lists.jboss.org
Author: vkorluzhenko
Date: 2007-11-29 12:40:01 -0500 (Thu, 29 Nov 2007)
New Revision: 4358
Modified:
trunk/docs/userguide/en/src/main/docbook/included/poll.desc.xml
trunk/docs/userguide/en/src/main/docbook/included/poll.xml
trunk/docs/userguide/en/src/main/docbook/included/push.xml
Log:
http://jira.jboss.com/jira/browse/RF-657 - improved description
Modified: trunk/docs/userguide/en/src/main/docbook/included/poll.desc.xml
===================================================================
--- trunk/docs/userguide/en/src/main/docbook/included/poll.desc.xml 2007-11-29 17:39:25 UTC (rev 4357)
+++ trunk/docs/userguide/en/src/main/docbook/included/poll.desc.xml 2007-11-29 17:40:01 UTC (rev 4358)
@@ -1,6 +1,6 @@
<?xml version='1.0' encoding='UTF-8'?>
<root>
- <section>
+ <section id="poll_d">
<title>Description</title>
<para>The <emphasis role="bold">
<property><a4j:poll></property>
Modified: trunk/docs/userguide/en/src/main/docbook/included/poll.xml
===================================================================
--- trunk/docs/userguide/en/src/main/docbook/included/poll.xml 2007-11-29 17:39:25 UTC (rev 4357)
+++ trunk/docs/userguide/en/src/main/docbook/included/poll.xml 2007-11-29 17:40:01 UTC (rev 4358)
@@ -63,18 +63,18 @@
<title>Key attributes and ways of usage</title>
<para id="attributes">The <emphasis role="bold">
<property><a4j:poll></property>
- </emphasis> componet is used for periodical polling of a server. In order to use the component
+ </emphasis> componet is used for periodical polling of server data. In order to use the component
it's necessary to set an update interval. The <emphasis>
<property>"interval"</property>
- </emphasis> attribute defines a polling interval in milliseconds beetween the previous
+ </emphasis> attribute defines an interval in milliseconds beetween the previous
response and the next request. The total period beetween two requests generated by the
<emphasis role="bold">
<property><a4j:poll></property>
</emphasis> component is a sum of an<emphasis>
<property>"interval"</property>
- </emphasis> attribute value and a server response time. Default value for <emphasis>
+ </emphasis> attribute value and server response time. Default value for <emphasis>
<property>"interval"</property>
- </emphasis> attribute is set to 1000 milliseconds (1 second). See an example of definition in
+ </emphasis> attribute is set to "1000" milliseconds (1 second). See an example of definition in
the <link linkend="creating">"Creating on a page" section</link>. </para>
<para>The <emphasis>
<property>"timeout"</property>
@@ -95,7 +95,7 @@
</emphasis> attribute. You can use an EL-expression for <emphasis>
<property>"enabled"</property>
</emphasis> attribute to point to a bean property. An example of usage of <link
- linkend="attributes">all mentioned above attributes</link> is placed below:</para>
+ linkend="attributes">mentioned above attributes</link> is placed below:</para>
<para>
<emphasis role="bold">Example:</emphasis>
@@ -132,20 +132,16 @@
<property>"reRender"</property>
</emphasis> attribute for <emphasis role="bold">
<property><a4j:poll></property>
- </emphasis> contains value of own Id. Hence, it renders itself for applying the current value
+ </emphasis> contains value of its own Id. Hence, it renders itself for applying the current value
of <emphasis>
<property>"enabled"</property>
</emphasis> attribute.</para>
+
+ <note><title>Note:</title> The form around the <emphasis role="bold">
+ <property><a4j:poll></property>
+ </emphasis> component is required.</note>
- <!--It's also necessary to define an ID of the <emphasis role="bold">
- <property><a4j:poll></property>
- </emphasis> componet in its <emphasis>
- <property>"reRender"</property>
- </emphasis> attribute to apply the current value of <emphasis>
- <property>"enabled"</property>
- </emphasis> attribute. </para>
-
- <para>The component decodes all necessary JavaScript for time count and on the expiry of some
+ <!--para>The component decodes all necessary JavaScript for time count and on the expiry of some
interval for calling of a RichFaces utility method for Ajax request sending (A4J.AJAX.Submit
(Some request parameters)). </para>
<para> The timer could be stopped or started in any time. The current state is controlled on the
Modified: trunk/docs/userguide/en/src/main/docbook/included/push.xml
===================================================================
--- trunk/docs/userguide/en/src/main/docbook/included/push.xml 2007-11-29 17:39:25 UTC (rev 4357)
+++ trunk/docs/userguide/en/src/main/docbook/included/push.xml 2007-11-29 17:40:01 UTC (rev 4358)
@@ -1,52 +1,106 @@
<?xml version='1.0' encoding='UTF-8'?>
<chapter>
-
- <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.ajax4jsf.Push</entry>
- </row>
- <row>
- <entry>component-family</entry>
- <entry>org.ajax4jsf.components.AjaxPush</entry>
- </row>
- <row>
- <entry>component-class</entry>
- <entry>org.ajax4jsf.component.html.AjaxPush</entry>
- </row>
- <row>
- <entry>renderer-type</entry>
- <entry>org.ajax4jsf.components.AjaxPushRenderer</entry>
- </row>
- </tbody>
- </tgroup>
- </table>
-
+
+ <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.ajax4jsf.Push</entry>
+ </row>
+ <row>
+ <entry>component-family</entry>
+ <entry>org.ajax4jsf.components.AjaxPush</entry>
+ </row>
+ <row>
+ <entry>component-class</entry>
+ <entry>org.ajax4jsf.component.html.AjaxPush</entry>
+ </row>
+ <row>
+ <entry>renderer-type</entry>
+ <entry>org.ajax4jsf.components.AjaxPushRenderer</entry>
+ </row>
+ </tbody>
+ </tgroup>
+ </table>
+
<section>
<title>Creating on a page</title>
- <programlisting role="XML"><![CDATA[
-<a4j:push reRender="msg" eventProducer="#{messageBean.addListener}" interval="3000"/>]]></programlisting>
+ <programlisting role="XML"><![CDATA[<a4j:push reRender="msg" eventProducer="#{messageBean.addListener}" interval="3000"/>]]></programlisting>
</section>
-
- <section>
+
+ <section>
<title>Dynamical creation of a component from Java code</title>
- <programlisting role="JAVA"><![CDATA[import org.ajax4jsf.component.html.AjaxPush;
+ <programlisting role="JAVA"><![CDATA[import org.ajax4jsf.component.html.AjaxPush;
...
AjaxPush myPush = new AjaxPush();
...]]></programlisting>
</section>
-
+
+
<section>
<title>Key attributes and ways of usage</title>
+ <para>The <emphasis role="bold">
+ <property><a4j:push></property>
+ </emphasis> component is similar to the <emphasis role="bold">
+ <property><a4j:poll></property>
+ </emphasis>
+ <link linkend="poll_d"> one</link>. The main difference is that the<emphasis role="bold">
+ <property><a4j:push></property>
+ </emphasis> makes request to minimal code (not to JSF tree) in order to check presence of
+ messages in a queue. If a message exists, a complete request is performed. The component
+ doesn't poll registered bean. It registers <property>EventListener</property>, which
+ receives messages about event presence. See an example below:</para>
+
+ <para>
+ <emphasis role="bold">Example:</emphasis>
+ </para>
+ <programlisting role="XML"><![CDATA[<a4j:push reRender="msg" eventProducer="#{pushBean.addListener}" interval="2000"/>
+]]></programlisting>
+ <para>In the example <emphasis>
+ <property>"interval"</property>
+ </emphasis> attribute has value "2000". This attribute defines an interval
+ in milliseconds beetween the previous response and the next request. Default value is set to
+ "1000" milliseconds (1 second). It's possible to set value equal to
+ "0". In this case connection is permanent. </para>
+ <para>The <emphasis>
+ <property>"timeout"</property>
+ </emphasis> attribute defines response wating time in milliseconds. If the response
+ isn't received during this period a connection is aborted and the next request is
+ sent. Default value for <emphasis>
+ <property>"timeout"</property>
+ </emphasis> attribute isn't set. Usage of <emphasis>
+ <property>"interval"</property>
+ </emphasis> and <emphasis>
+ <property>"timeout"</property>
+ </emphasis> attributes gives an opportunity to set short polls of queue state or long
+ connections or permanent connection generally.</para>
+ <para>Code for <property>EventListener</property> registration in a bean is placed below:</para>
+ <para>
+ <emphasis role="bold">Example:</emphasis>
+ </para>
+ <programlisting role="JAVA"><![CDATA[...
+public void addListener(EventListener listener) {
+synchronized (listener) {
+ if (this.listener != listener) {
+ this.listener = (PushEventListener) listener;
+}
+...
+]]></programlisting>
+
+<para></para>
+
+ </section>
+
+ <!--section>
+ <title>Key attributes and ways of usage</title>
<para>The main difference between <emphasis role="bold"><property><a4j:push></property></emphasis>and
<emphasis role="bold"><property><a4j:poll></property></emphasis> components
is that <emphasis role="bold"><property><a4j:push></property></emphasis> makes request to minimal code only (not to JSF tree) in order to check the presence of messages in the queue.
@@ -58,7 +112,7 @@
</para>
<para>
"interval" - Interval (in ms) for call push requests. Default value 1000 (1 sec).
-<!-- If "0" a connection is permanent. Also you can set different value for parameter 'timeout'. -->
+< If "0" a connection is permanent. Also you can set different value for parameter 'timeout'.>
</para>
<para>
Code for registration of listener:
@@ -83,14 +137,14 @@
<para>
Thus, component 'push' uses asynchronous model instead of polls.
</para>
- </section>
-
+ </section-->
+
<section>
<title>Relevant resources links</title>
- <para>
- <ulink url="http://livedemo.exadel.com/richfaces-demo/richfaces/push.jsf?c=push">Here
- </ulink> you can see the example of <emphasis role="bold"
- ><property><a4j:push></property></emphasis> usage and sources for the given example.
- </para>
- </section>
-</chapter>
\ No newline at end of file
+ <para>
+ <ulink url="http://livedemo.exadel.com/richfaces-demo/richfaces/push.jsf?c=push">Here </ulink>
+ you can see the example of <emphasis role="bold">
+ <property><a4j:push></property>
+ </emphasis> usage and sources for the given example. </para>
+ </section>
+</chapter>
17 years, 1 month
JBoss Rich Faces SVN: r4357 - trunk/docs/userguide/en/src/main/docbook/included.
by richfaces-svn-commits@lists.jboss.org
Author: vkorluzhenko
Date: 2007-11-29 12:39:25 -0500 (Thu, 29 Nov 2007)
New Revision: 4357
Modified:
trunk/docs/userguide/en/src/main/docbook/included/calendar.xml
trunk/docs/userguide/en/src/main/docbook/included/panelMenu.xml
trunk/docs/userguide/en/src/main/docbook/included/scrollableDataTable.xml
trunk/docs/userguide/en/src/main/docbook/included/tooltip.xml
Log:
http://jira.jboss.com/jira/browse/RF-1447 - checked and updated JS API.
Modified: trunk/docs/userguide/en/src/main/docbook/included/calendar.xml
===================================================================
--- trunk/docs/userguide/en/src/main/docbook/included/calendar.xml 2007-11-29 17:07:49 UTC (rev 4356)
+++ trunk/docs/userguide/en/src/main/docbook/included/calendar.xml 2007-11-29 17:39:25 UTC (rev 4357)
@@ -382,14 +382,14 @@
<row>
<entry>selectDate(date)</entry>
- <entry>Select the date specified. If the date isn't in current month - performs
+ <entry>Selects the date specified. If the date isn't in current month - performs
request to select</entry>
</row>
<row>
<entry>isDateEnabled(date)</entry>
- <entry>Check if given date is selectable</entry>
+ <entry>Checks if given date is selectable</entry>
</row>
<row>
@@ -419,55 +419,55 @@
<row>
<entry>nextMonth()</entry>
- <entry>Navigate to next month</entry>
+ <entry>Navigates to next month</entry>
</row>
<row>
<entry>nextYear()</entry>
- <entry>Navigate to next year</entry>
+ <entry>Navigates to next year</entry>
</row>
<row>
<entry>prevMonth()</entry>
- <entry>Navigate to previous month </entry>
+ <entry>Navigates to previous month </entry>
</row>
<row>
<entry>prevYear()</entry>
- <entry>Navigate to previous year</entry>
+ <entry>Navigates to previous year</entry>
</row>
<row>
<entry>today()</entry>
- <entry>Select today date</entry>
+ <entry>Selects today date</entry>
</row>
<row>
<entry>getSelectedDate()</entry>
- <entry>Return currently selected date</entry>
+ <entry>Returns currently selected date</entry>
</row>
<row>
<entry>Object getData()</entry>
- <entry>Return additional data for the date</entry>
+ <entry>Returns additional data for the date</entry>
</row>
<row>
<entry>enable()</entry>
- <entry>enables calendar</entry>
+ <entry>Enables calendar</entry>
</row>
<row>
<entry>disable()</entry>
- <entry>disables calendar</entry>
+ <entry>Disables calendar</entry>
</row>
<row>
@@ -485,13 +485,13 @@
<row>
<entry>doCollapse()</entry>
- <entry>Collapse calendar element</entry>
+ <entry>Collapses calendar element</entry>
</row>
<row>
<entry>doExpand()</entry>
- <entry>Expand calendar element</entry>
+ <entry>Expands calendar element</entry>
</row>
</tbody>
</tgroup>
Modified: trunk/docs/userguide/en/src/main/docbook/included/panelMenu.xml
===================================================================
--- trunk/docs/userguide/en/src/main/docbook/included/panelMenu.xml 2007-11-29 17:07:49 UTC (rev 4356)
+++ trunk/docs/userguide/en/src/main/docbook/included/panelMenu.xml 2007-11-29 17:39:25 UTC (rev 4357)
@@ -220,13 +220,13 @@
<row>
<entry>doExpand()</entry>
- <entry>Expand group element</entry>
+ <entry>Expands group element</entry>
</row>
<row>
<entry>doCollapse()</entry>
- <entry>Collapse group element</entry>
+ <entry>Collapses group element</entry>
</row>
</tbody>
</tgroup>
Modified: trunk/docs/userguide/en/src/main/docbook/included/scrollableDataTable.xml
===================================================================
--- trunk/docs/userguide/en/src/main/docbook/included/scrollableDataTable.xml 2007-11-29 17:07:49 UTC (rev 4356)
+++ trunk/docs/userguide/en/src/main/docbook/included/scrollableDataTable.xml 2007-11-29 17:39:25 UTC (rev 4357)
@@ -208,6 +208,36 @@
</itemizedlist>
</para>
</section>
+
+
+ <section>
+ <title>JavaScript API</title>
+ <table>
+ <title>JavaScript API</title>
+
+ <tgroup cols="2">
+ <thead>
+ <row>
+ <entry>Function</entry>
+
+ <entry>Description</entry>
+ </row>
+ </thead>
+
+ <tbody>
+
+ <row>
+ <entry>doCollapse(columnId)</entry>
+
+ <entry>Performs a collapse action for column with corresponding Id</entry>
+ </row>
+
+ </tbody>
+ </tgroup>
+ </table>
+
+ </section>
+
<section>
<title>Look-and-Feel Customization</title>
Modified: trunk/docs/userguide/en/src/main/docbook/included/tooltip.xml
===================================================================
--- trunk/docs/userguide/en/src/main/docbook/included/tooltip.xml 2007-11-29 17:07:49 UTC (rev 4356)
+++ trunk/docs/userguide/en/src/main/docbook/included/tooltip.xml 2007-11-29 17:39:25 UTC (rev 4357)
@@ -174,10 +174,10 @@
<para>
Special JS API is provided to control the component behaviour:
<itemizedlist>
- <listitem>doShow() - Shows the corresponding tooltip</listitem>
- <listitem>doHide() - Hides the corresponding tooltip</listitem>
- <listitem>doEnable() - Enables the corresponding tooltip</listitem>
- <listitem>doDisable() - Disables the corresponding tooltip</listitem>
+ <listitem> - </listitem>
+ <listitem> - </listitem>
+ <listitem> - </listitem>
+ <listitem> - </listitem>
</itemizedlist>
</para>
<para>
@@ -209,6 +209,52 @@
</itemizedlist>
</para>
</section>
+
+ <section>
+ <title>JavaScript API</title>
+ <table>
+ <title>JavaScript API</title>
+
+ <tgroup cols="2">
+ <thead>
+ <row>
+ <entry>Function</entry>
+
+ <entry>Description</entry>
+ </row>
+ </thead>
+
+ <tbody>
+
+ <row>
+ <entry>doShow()</entry>
+
+ <entry>Shows the corresponding tooltip</entry>
+ </row>
+
+ <row>
+ <entry>doHide()</entry>
+
+ <entry>Hides the corresponding tooltip</entry>
+ </row>
+
+ <row>
+ <entry>doEnable()</entry>
+
+ <entry>Enables the corresponding tooltip</entry>
+ </row>
+
+ <row>
+ <entry>doDisable()</entry>
+
+ <entry>Disables the corresponding tooltip</entry>
+ </row>
+
+ </tbody>
+ </tgroup>
+ </table>
+
+ </section>
<section>
<title>Look-and-Feel Customization</title>
17 years, 1 month
JBoss Rich Faces SVN: r4356 - 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-11-29 12:07:49 -0500 (Thu, 29 Nov 2007)
New Revision: 4356
Modified:
branches/3.1.x/ui/orderingList/src/main/resources/org/richfaces/renderkit/html/scripts/ListBase.js
Log:
bug:RF-1446
Modified: branches/3.1.x/ui/orderingList/src/main/resources/org/richfaces/renderkit/html/scripts/ListBase.js
===================================================================
--- branches/3.1.x/ui/orderingList/src/main/resources/org/richfaces/renderkit/html/scripts/ListBase.js 2007-11-29 17:03:35 UTC (rev 4355)
+++ branches/3.1.x/ui/orderingList/src/main/resources/org/richfaces/renderkit/html/scripts/ListBase.js 2007-11-29 17:07:49 UTC (rev 4356)
@@ -250,7 +250,7 @@
this.selectedItems.push(markedShuttleItem); //TODO :delete
}
- if (this.activeItem.rowIndex != activeItem.rowIndex) {
+ if ((this.activeItem != null) && (this.activeItem.rowIndex != activeItem.rowIndex)) {
//reset activity of an element
if (Richfaces.SelectItems.isSelected(this.activeItem)) {
Richfaces.SelectItems.doSelect(this.activeItem);
17 years, 1 month
JBoss Rich Faces SVN: r4355 - management/design/listShuttle.
by richfaces-svn-commits@lists.jboss.org
Author: ilya_shaikovsky
Date: 2007-11-29 12:03:35 -0500 (Thu, 29 Nov 2007)
New Revision: 4355
Modified:
management/design/listShuttle/FuncSpec - ListShuttle.doc
Log:
Modified: management/design/listShuttle/FuncSpec - ListShuttle.doc
===================================================================
(Binary files differ)
17 years, 1 month
JBoss Rich Faces SVN: r4354 - 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-11-29 11:49:06 -0500 (Thu, 29 Nov 2007)
New Revision: 4354
Modified:
branches/3.1.x/ui/orderingList/src/main/resources/org/richfaces/renderkit/html/scripts/ListBase.js
Log:
selection fixed
Modified: branches/3.1.x/ui/orderingList/src/main/resources/org/richfaces/renderkit/html/scripts/ListBase.js
===================================================================
--- branches/3.1.x/ui/orderingList/src/main/resources/org/richfaces/renderkit/html/scripts/ListBase.js 2007-11-29 16:48:04 UTC (rev 4353)
+++ branches/3.1.x/ui/orderingList/src/main/resources/org/richfaces/renderkit/html/scripts/ListBase.js 2007-11-29 16:49:06 UTC (rev 4354)
@@ -382,7 +382,7 @@
for (var i = 0; i < this.shuttleItems.length; i++) {
var item = this.shuttleItems[i];
result.push(item._id);
- if (item._selected) {
+ if (Richfaces.SelectItems.isSelected(item._node)) {
result.push(Richfaces.OrderingList.SELECTION_MARKER);
}
if (this.activeItem && (this.activeItem.rowIndex == item._node.rowIndex)) {
17 years, 1 month
JBoss Rich Faces SVN: r4353 - branches/3.1.x/sandbox/ui/listShuttle/src/main/java/org/richfaces/component.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2007-11-29 11:48:04 -0500 (Thu, 29 Nov 2007)
New Revision: 4353
Modified:
branches/3.1.x/sandbox/ui/listShuttle/src/main/java/org/richfaces/component/UIListShuttle.java
Log:
listShuttle: check for duplicate keys added
Modified: branches/3.1.x/sandbox/ui/listShuttle/src/main/java/org/richfaces/component/UIListShuttle.java
===================================================================
--- branches/3.1.x/sandbox/ui/listShuttle/src/main/java/org/richfaces/component/UIListShuttle.java 2007-11-29 16:20:06 UTC (rev 4352)
+++ branches/3.1.x/sandbox/ui/listShuttle/src/main/java/org/richfaces/component/UIListShuttle.java 2007-11-29 16:48:04 UTC (rev 4353)
@@ -212,8 +212,42 @@
}
public void setSubmittedStrings(String[] submittedStrings) {
- //TODO check for parameters correlation
this.submittedValueHolder = new SubmittedValue(submittedStrings);
+ final Map sourceTranslationTable = this.submittedValueHolder.getSourceTranslationTable();
+ final Map targetTranslationTable = this.submittedValueHolder.getTargetTranslationTable();
+
+ if (sourceTranslationTable != null && targetTranslationTable != null) {
+ sourceTranslationTable.entrySet().removeAll(targetTranslationTable.entrySet());
+ } else {
+ ListShuttleDataModel dataModel = (ListShuttleDataModel) getExtendedDataModel();
+ FacesContext context = FacesContext.getCurrentInstance();
+
+ try {
+ if (sourceTranslationTable != null) {
+ dataModel.walkTarget(context, new DataVisitor() {
+
+ public void process(FacesContext context, Object rowKey,
+ Object argument) throws IOException {
+
+ sourceTranslationTable.entrySet().remove(rowKey);
+ }
+
+ }, null, null);
+ } else if (targetTranslationTable != null) {
+ dataModel.walkSource(context, new DataVisitor() {
+
+ public void process(FacesContext context, Object rowKey,
+ Object argument) throws IOException {
+
+ targetTranslationTable.entrySet().remove(rowKey);
+ }
+
+ }, null, null);
+ }
+ } catch (IOException e) {
+ throw new FacesException(e.getLocalizedMessage(), e);
+ }
+ }
}
protected Object saveIterationSubmittedState() {
17 years, 1 month
JBoss Rich Faces SVN: r4352 - in branches/3.1.x/test-applications/facelets/src/main: webapp/ContextMenu and 1 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: ayanul
Date: 2007-11-29 11:20:06 -0500 (Thu, 29 Nov 2007)
New Revision: 4352
Modified:
branches/3.1.x/test-applications/facelets/src/main/java/contextMenu/ContextMenu.java
branches/3.1.x/test-applications/facelets/src/main/webapp/ContextMenu/ContextMenu.xhtml
branches/3.1.x/test-applications/facelets/src/main/webapp/ContextMenu/ContextMenuProperty.xhtml
branches/3.1.x/test-applications/facelets/src/main/webapp/OrderingList/OrderingListStraightforward.xhtml
Log:
update ContextMenu
Modified: branches/3.1.x/test-applications/facelets/src/main/java/contextMenu/ContextMenu.java
===================================================================
--- branches/3.1.x/test-applications/facelets/src/main/java/contextMenu/ContextMenu.java 2007-11-29 15:59:38 UTC (rev 4351)
+++ branches/3.1.x/test-applications/facelets/src/main/java/contextMenu/ContextMenu.java 2007-11-29 16:20:06 UTC (rev 4352)
@@ -3,12 +3,15 @@
import java.util.Map;
import javax.faces.context.FacesContext;
+import javax.faces.event.ActionEvent;
public class ContextMenu {
private String info;
+ private String inputText;
private String submitMode;
private String event;
private String popupWidth;
+ private String selectOneMenu;
private int hideDelay;
private int showDelay;
private boolean disableDefaultMenu;
@@ -32,11 +35,18 @@
return info;
}
+ public void actionListener(ActionEvent event) {
+ setInfo("actionListener");
+ }
+
public void setInfo(String info) {
+ System.out.println("Info: " + info);
this.info = info;
}
public ContextMenu() {
+ selectOneMenu = "item1";
+ inputText = "inputText";
submitMode = "none";
event = "oncontextmenu";
popupWidth = "300px";
@@ -111,5 +121,20 @@
public void setShowDelay(int showDelay) {
this.showDelay = showDelay;
}
-
+
+ public String getInputText() {
+ return inputText;
+ }
+
+ public void setInputText(String inputText) {
+ this.inputText = inputText;
+ }
+
+ public String getSelectOneMenu() {
+ return selectOneMenu;
+ }
+
+ public void setSelectOneMenu(String selectOneMenu) {
+ this.selectOneMenu = selectOneMenu;
+ }
}
Modified: branches/3.1.x/test-applications/facelets/src/main/webapp/ContextMenu/ContextMenu.xhtml
===================================================================
--- branches/3.1.x/test-applications/facelets/src/main/webapp/ContextMenu/ContextMenu.xhtml 2007-11-29 15:59:38 UTC (rev 4351)
+++ branches/3.1.x/test-applications/facelets/src/main/webapp/ContextMenu/ContextMenu.xhtml 2007-11-29 16:20:06 UTC (rev 4352)
@@ -1,12 +1,153 @@
<f:subview id="contextMenuSubviewID" xmlns:a4j="http://richfaces.org/a4j" xmlns:f="http://java.sun.com/jsf/core"
xmlns:h="http://java.sun.com/jsf/html" xmlns:rich="http://richfaces.org/rich" xmlns:ui="http://java.sun.com/jsf/facelets">
- <h:panelGrid columns="2">
- <rich:panel style="width: 130px; height: 50px; background-color: #98FB98;">
- <h:outputText value="panel with contextMenu(DEFAULT)" />
- <rich:contextMenu id="contextMenuDefaultID" submitMode="client">
- <rich:menuItem icon="/pics/header.png" value="abc" reRender="cmInfoID">
- <f:param name="cmdParam" value="abc" />
+ <h:panelGrid columns="2">
+ <rich:panel style="width: 130px; height: 50px; background-color: #98FB98;">
+ <h:outputText value="panel with contextMenu(DEFAULT)" />
+ <rich:contextMenu id="contextMenuDefaultID" submitMode="ajax">
+ <rich:menuItem icon="/pics/header.png" value="abc" reRender="cmInfoID">
+ <f:param name="cmdParam" value="abc" />
+ </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:menuItem icon="/pics/info.gif" value="d" reRender="cmInfoID">
+ <f:param name="cmdParam" value="d" />
+ </rich:menuItem>
+ <rich:menuGroup value="menuGroup">
+ <rich:menuItem icon="/pics/fatal.gif" value="a" reRender="cmInfoID">
+ <f:param name="cmdParam" value="a" />
</rich:menuItem>
+ <rich:menuItem icon="/pics/fatal.gif" value="b" reRender="cmInfoID">
+ <f:param name="cmdParam" value="b" />
+ </rich:menuItem>
+ <rich:menuItem icon="/pics/fatal.gif" value="c" reRender="cmInfoID">
+ <f:param name="cmdParam" value="c" />
+ </rich:menuItem>
+ <rich:menuItem icon="/pics/fatal.gif" value="d" reRender="cmInfoID">
+ <f:param name="cmdParam" value="d" />
+ </rich:menuItem>
+ </rich:menuGroup>
+ </rich:contextMenu>
+ </rich:panel>
+
+ <rich:panel style="width: 130px; height: 50px; background-color: #98FB98;">
+ <h:outputText value="panel with contextMenu(Test)" />
+ <rich:contextMenu id="contextMenuID" attached="#{contextMenu.attached}" submitMode="#{contextMenu.submitMode}"
+ event="#{contextMenu.event}" disableDefaultMenu="#{contextMenu.disableDefaultMenu}" rendered="#{contextMenu.rendered}"
+ hideDelay="#{contextMenu.hideDelay}" showDelay="#{contextMenu.showDelay}" popupWidth="#{contextMenu.popupWidth}">
+ <rich:menuItem icon="/pics/header.png" value="abc" reRender="cmInfoID">
+ <f:param name="cmdParam" value="abc" />
+ </rich:menuItem>
+ <rich:menuSeparator />
+ <rich:menuItem icon="/pics/info.gif" value="action" action="alert('action work')" reRender="cmInfoID">
+ <f:param name="cmdParam" value="action" />
+ </rich:menuItem>
+ <rich:menuItem icon="/pics/info.gif" value="actionListener" actionListener="#{contextMenu.actionListener}" reRender="cmInfoID">
+ </rich:menuItem>
+ <rich:menuItem icon="/pics/info.gif" value="ajaxSingle" ajaxSingle="true" action="submit()" reRender="cmInfoID">
+ <f:param name="cmdParam" value="ajaxSingle" />
+ </rich:menuItem>
+ <rich:menuItem icon="/pics/fatal.gif" value="disabled" disabled="true" reRender="cmInfoID">
+ <f:param name="cmdParam" value="disabled" />
+ </rich:menuItem>
+ <rich:menuItem icon="/pics/fatal.gif" value="immediate" immediate="true" action="submit();">
+ <f:param name="cmdParam" value="immedeate" />
+ <h:inputText value="#{contextMenu.inputText}" />
+ </rich:menuItem>
+ <rich:menuItem icon="/pics/fatal.gif" value="submitMode: none" submitMode="none" reRender="cmInfoID">
+ <f:param name="cmdParam" value="none" />
+ </rich:menuItem>
+ <rich:menuItem icon="/pics/fatal.gif" value="submitMode: server" submitMode="server" reRender="cmInfoID">
+ <f:param name="cmdParam" value="server" />
+ </rich:menuItem>
+ <rich:menuItem icon="/pics/fatal.gif" value="submitMode: ajax" submitMode="ajax" reRender="cmInfoID">
+ <f:param name="cmdParam" value="ajax" />
+ </rich:menuItem>
+ <rich:menuItem value="select">
+ <h:selectOneMenu value="#{contextMenu.selectOneMenu}" onchange="submit();">
+ <f:selectItem itemLabel="item1" itemValue="item1" />
+ <f:selectItem itemLabel="item2" itemValue="item2" />
+ </h:selectOneMenu>
+ </rich:menuItem>
+ <rich:menuGroup value="menuGroup">
+ <rich:menuItem icon="/pics/fatal.gif" value="a" reRender="cmInfoID">
+ <f:param name="cmdParam" value="a" />
+ </rich:menuItem>
+ <rich:menuItem icon="/pics/fatal.gif" value="b" reRender="cmInfoID">
+ <f:param name="cmdParam" value="b" />
+ </rich:menuItem>
+ <rich:menuItem icon="/pics/fatal.gif" value="c" reRender="cmInfoID">
+ <f:param name="cmdParam" value="c" />
+ </rich:menuItem>
+ <rich:menuItem icon="/pics/fatal.gif" value="d" reRender="cmInfoID">
+ <f:param name="cmdParam" value="d" />
+ </rich:menuItem>
+ </rich:menuGroup>
+ </rich:contextMenu>
+ </rich:panel>
+ </h:panelGrid>
+ <h:panelGrid id="cmInfoID" olumns="2">
+ <h:outputText value="Select items: " />
+ <h:outputText value="#{contextMenu.info}" style="color: red" />
+ </h:panelGrid>
+
+ <h:panelGrid id="pgcmTestID" columns="3">
+ <h:selectOneMenu value="#{contextMenu.selectOneMenu}">
+ <f:selectItem itemLabel="select1" itemValue="select1" />
+ <f:selectItem itemLabel="select2" itemValue="select2" />
+ <rich:contextMenu attached="#{contextMenu.attached}" submitMode="#{contextMenu.submitMode}" event="#{contextMenu.event}"
+ disableDefaultMenu="#{contextMenu.disableDefaultMenu}" rendered="#{contextMenu.rendered}" hideDelay="#{contextMenu.hideDelay}"
+ showDelay="#{contextMenu.showDelay}" popupWidth="#{contextMenu.popupWidth}">
+ <rich:menuItem icon="/pics/header.png" value="select" reRender="cmInfoID">
+ <f:param name="cmdParam" value="select" />
+ </rich:menuItem>
+ <rich:menuSeparator />
+ <rich:menuItem icon="/pics/info.gif" value="action" action="alert('action work')" reRender="cmInfoID">
+ <f:param name="cmdParam" value="action" />
+ </rich:menuItem>
+ <rich:menuItem icon="/pics/info.gif" value="actionListener" actionListener="#{contextMenu.actionListener}" reRender="cmInfoID">
+ </rich:menuItem>
+ <rich:menuItem icon="/pics/info.gif" value="ajaxSingle" ajaxSingle="true" action="submit()" reRender="cmInfoID">
+ <f:param name="cmdParam" value="ajaxSingle" />
+ </rich:menuItem>
+ <rich:menuItem icon="/pics/fatal.gif" value="disabled" disabled="true" reRender="cmInfoID">
+ <f:param name="cmdParam" value="disabled" />
+ </rich:menuItem>
+ <rich:menuItem icon="/pics/fatal.gif" value="immediate" immediate="true" action="submit();">
+ <f:param name="cmdParam" value="immedeate" />
+ <h:inputText value="#{contextMenu.inputText}" />
+ </rich:menuItem>
+ <rich:menuItem icon="/pics/fatal.gif" value="submitMode: none" submitMode="none" reRender="cmInfoID">
+ <f:param name="cmdParam" value="none" />
+ </rich:menuItem>
+ <rich:menuItem icon="/pics/fatal.gif" value="submitMode: server" submitMode="server" reRender="cmInfoID">
+ <f:param name="cmdParam" value="server" />
+ </rich:menuItem>
+ <rich:menuItem icon="/pics/fatal.gif" value="submitMode: ajax" submitMode="ajax" reRender="cmInfoID">
+ <f:param name="cmdParam" value="ajax" />
+ </rich:menuItem>
+ <rich:menuItem value="select">
+ <h:selectOneMenu value="#{contextMenu.selectOneMenu}" onchange="submit();">
+ <f:selectItem itemLabel="item1" itemValue="item1" />
+ <f:selectItem itemLabel="item2" itemValue="item2" />
+ </h:selectOneMenu>
+ </rich:menuItem>
+ </rich:contextMenu>
+ </h:selectOneMenu>
+
+ <rich:tabPanel id="tpcmTestID" switchType="client">
+ <rich:tab id="t1cmTestID" label="tab1">
+ <rich:contextMenu submitMode="ajax">
+ <rich:menuItem icon="/pics/header.png" value="tab1" reRender="cmInfoID">
+ <f:param name="cmdParam" value="tab1" />
+ </rich:menuItem>
<rich:menuSeparator />
<rich:menuItem icon="/pics/info.gif" value="a" reRender="cmInfoID">
<f:param name="cmdParam" value="a" />
@@ -17,33 +158,31 @@
<rich:menuItem icon="/pics/info.gif" value="c" reRender="cmInfoID">
<f:param name="cmdParam" value="c" />
</rich:menuItem>
- <rich:menuItem icon="/pics/info.gif" value="d" reRender="cmInfoID">
- <f:param name="cmdParam" value="d" />
+ </rich:contextMenu>
+ <h:outputText value="text1" />
+ </rich:tab>
+ <rich:tab id="t2cmTestID" label="tab2">
+ <rich:contextMenu submitMode="ajax">
+ <rich:menuItem icon="/pics/header.png" value="tab2" reRender="cmInfoID">
+ <f:param name="cmdParam" value="tab2" />
</rich:menuItem>
- <rich:menuGroup value="menuGroup">
- <rich:menuItem icon="/pics/fatal.gif" value="a" reRender="cmInfoID">
- <f:param name="cmdParam" value="a" />
- </rich:menuItem>
- <rich:menuItem icon="/pics/fatal.gif" value="{cmdParam} b" reRender="cmInfoID">
- <f:param name="cmdParam" value="b" />
- </rich:menuItem>
- <rich:menuItem icon="/pics/fatal.gif" value="c" reRender="cmInfoID">
- <f:param name="cmdParam" value="c" />
- </rich:menuItem>
- <rich:menuItem icon="/pics/fatal.gif" value="d" reRender="cmInfoID">
- <f:param name="cmdParam" value="d" />
- </rich:menuItem>
- </rich:menuGroup>
+ <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:panel>
-
- <rich:panel style="width: 130px; height: 50px; background-color: #98FB98;">
- <h:outputText value="panel with contextMenu(Test)" />
- <rich:contextMenu id="contextMenuID" attached="#{contextMenu.attached}" submitMode="#{contextMenu.submitMode}" event="#{contextMenu.event}"
- disableDefaultMenu="#{contextMenu.disableDefaultMenu}" rendered="#{contextMenu.rendered}"
- hideDelay="#{contextMenu.hideDelay}" showDelay="#{contextMenu.showDelay}" popupWidth="#{contextMenu.popupWidth}">
- <rich:menuItem icon="/pics/header.png" value="abc" reRender="cmInfoID">
- <f:param name="cmdParam" value="abc" />
+ <h:outputText value="text2" />
+ </rich:tab>
+ <rich:tab id="t3cmTestID" label="tab3">
+ <rich:contextMenu submitMode="ajax">
+ <rich:menuItem icon="/pics/header.png" value="tab3" reRender="cmInfoID">
+ <f:param name="cmdParam" value="tab3" />
</rich:menuItem>
<rich:menuSeparator />
<rich:menuItem icon="/pics/info.gif" value="a" reRender="cmInfoID">
@@ -55,29 +194,214 @@
<rich:menuItem icon="/pics/info.gif" value="c" reRender="cmInfoID">
<f:param name="cmdParam" value="c" />
</rich:menuItem>
- <rich:menuItem icon="/pics/info.gif" value="d" reRender="cmInfoID">
- <f:param name="cmdParam" value="d" />
- </rich:menuItem>
- <rich:menuGroup value="menuGroup">
- <rich:menuItem icon="/pics/fatal.gif" value="a" reRender="cmInfoID">
- <f:param name="cmdParam" value="a" />
- </rich:menuItem>
- <rich:menuItem icon="/pics/fatal.gif" value="{cmdParam} b" reRender="cmInfoID">
- <f:param name="cmdParam" value="b" />
- </rich:menuItem>
- <rich:menuItem icon="/pics/fatal.gif" value="c" reRender="cmInfoID">
- <f:param name="cmdParam" value="c" />
- </rich:menuItem>
- <rich:menuItem icon="/pics/fatal.gif" value="d" reRender="cmInfoID">
- <f:param name="cmdParam" value="d" />
- </rich:menuItem>
- </rich:menuGroup>
</rich:contextMenu>
- </rich:panel>
- <h:panelGrid id="cmInfoID" columns="2">
- <h:outputText value="Select items: " />
- <h:outputText value="#{contextMenu.info}" style="color: red"/>
- </h:panelGrid>
-
+ <h:outputText value="text3" />
+ </rich:tab>
+ <rich:contextMenu attached="#{contextMenu.attached}" submitMode="#{contextMenu.submitMode}" event="#{contextMenu.event}"
+ disableDefaultMenu="#{contextMenu.disableDefaultMenu}" rendered="#{contextMenu.rendered}" hideDelay="#{contextMenu.hideDelay}"
+ showDelay="#{contextMenu.showDelay}" popupWidth="#{contextMenu.popupWidth}">
+ <rich:menuItem icon="/pics/header.png" value="tabPanel" reRender="cmInfoID">
+ <f:param name="cmdParam" value="tabPanel" />
+ </rich:menuItem>
+ <rich:menuSeparator />
+ <rich:menuItem icon="/pics/info.gif" value="action" action="alert('action work')" reRender="cmInfoID">
+ <f:param name="cmdParam" value="action" />
+ </rich:menuItem>
+ <rich:menuItem icon="/pics/info.gif" value="actionListener" actionListener="#{contextMenu.actionListener}" reRender="cmInfoID">
+ </rich:menuItem>
+ <rich:menuItem icon="/pics/info.gif" value="ajaxSingle" ajaxSingle="true" action="submit()" reRender="cmInfoID">
+ <f:param name="cmdParam" value="ajaxSingle" />
+ </rich:menuItem>
+ <rich:menuItem icon="/pics/fatal.gif" value="disabled" disabled="true" reRender="cmInfoID">
+ <f:param name="cmdParam" value="disabled" />
+ </rich:menuItem>
+ <rich:menuItem icon="/pics/fatal.gif" value="immediate" immediate="true" action="submit();">
+ <f:param name="cmdParam" value="immedeate" />
+ <h:inputText value="#{contextMenu.inputText}" />
+ </rich:menuItem>
+ <rich:menuItem icon="/pics/fatal.gif" value="submitMode: none" submitMode="none" reRender="cmInfoID">
+ <f:param name="cmdParam" value="none" />
+ </rich:menuItem>
+ <rich:menuItem icon="/pics/fatal.gif" value="submitMode: server" submitMode="server" reRender="cmInfoID">
+ <f:param name="cmdParam" value="server" />
+ </rich:menuItem>
+ <rich:menuItem icon="/pics/fatal.gif" value="submitMode: ajax" submitMode="ajax" reRender="cmInfoID">
+ <f:param name="cmdParam" value="ajax" />
+ </rich:menuItem>
+ <rich:menuItem value="select">
+ <h:selectOneMenu value="#{contextMenu.selectOneMenu}" onchange="submit();">
+ <f:selectItem itemLabel="item1" itemValue="item1" />
+ <f:selectItem itemLabel="item2" itemValue="item2" />
+ </h:selectOneMenu>
+ </rich:menuItem>
+ </rich:contextMenu>
+ </rich:tabPanel>
+
+ <h:graphicImage id="gicmID" value="/pics/asus.jpg" height="125px" width="150px">
+ <rich:contextMenu attached="#{contextMenu.attached}" submitMode="#{contextMenu.submitMode}" event="#{contextMenu.event}"
+ disableDefaultMenu="#{contextMenu.disableDefaultMenu}" rendered="#{contextMenu.rendered}" hideDelay="#{contextMenu.hideDelay}"
+ showDelay="#{contextMenu.showDelay}" popupWidth="#{contextMenu.popupWidth}">
+ <rich:menuItem icon="/pics/header.png" value="graphicImage" reRender="cmInfoID">
+ <f:param name="cmdParam" value="graphicImage" />
+ </rich:menuItem>
+ <rich:menuSeparator />
+ <rich:menuItem icon="/pics/info.gif" value="action" action="alert('action work')" reRender="cmInfoID">
+ <f:param name="cmdParam" value="action" />
+ </rich:menuItem>
+ <rich:menuItem icon="/pics/info.gif" value="actionListener" actionListener="#{contextMenu.actionListener}" reRender="cmInfoID">
+ </rich:menuItem>
+ <rich:menuItem icon="/pics/info.gif" value="ajaxSingle" ajaxSingle="true" action="submit()" reRender="cmInfoID">
+ <f:param name="cmdParam" value="ajaxSingle" />
+ </rich:menuItem>
+ <rich:menuItem icon="/pics/fatal.gif" value="disabled" disabled="true" reRender="cmInfoID">
+ <f:param name="cmdParam" value="disabled" />
+ </rich:menuItem>
+ <rich:menuItem icon="/pics/fatal.gif" value="immediate" immediate="true" action="submit();">
+ <f:param name="cmdParam" value="immedeate" />
+ <h:inputText value="#{contextMenu.inputText}" />
+ </rich:menuItem>
+ <rich:menuItem icon="/pics/fatal.gif" value="submitMode: none" submitMode="none" reRender="cmInfoID">
+ <f:param name="cmdParam" value="none" />
+ </rich:menuItem>
+ <rich:menuItem icon="/pics/fatal.gif" value="submitMode: server" submitMode="server" reRender="cmInfoID">
+ <f:param name="cmdParam" value="server" />
+ </rich:menuItem>
+ <rich:menuItem icon="/pics/fatal.gif" value="submitMode: ajax" submitMode="ajax" reRender="cmInfoID">
+ <f:param name="cmdParam" value="ajax" />
+ </rich:menuItem>
+ <rich:menuItem value="select">
+ <h:selectOneMenu value="#{contextMenu.selectOneMenu}" onchange="submit();">
+ <f:selectItem itemLabel="item1" itemValue="item1" />
+ <f:selectItem itemLabel="item2" itemValue="item2" />
+ </h:selectOneMenu>
+ </rich:menuItem>
+ </rich:contextMenu>
+ </h:graphicImage>
+
+ <h:inputText id="itcmTestID" value="inputText">
+ <rich:contextMenu attached="#{contextMenu.attached}" submitMode="#{contextMenu.submitMode}" event="#{contextMenu.event}"
+ disableDefaultMenu="#{contextMenu.disableDefaultMenu}" rendered="#{contextMenu.rendered}" hideDelay="#{contextMenu.hideDelay}"
+ showDelay="#{contextMenu.showDelay}" popupWidth="#{contextMenu.popupWidth}">
+ <rich:menuItem icon="/pics/header.png" value="inputText" reRender="cmInfoID">
+ <f:param name="cmdParam" value="inputText" />
+ </rich:menuItem>
+ <rich:menuSeparator />
+ <rich:menuItem icon="/pics/info.gif" value="action" action="alert('action work')" reRender="cmInfoID">
+ <f:param name="cmdParam" value="action" />
+ </rich:menuItem>
+ <rich:menuItem icon="/pics/info.gif" value="actionListener" actionListener="#{contextMenu.actionListener}" reRender="cmInfoID">
+ </rich:menuItem>
+ <rich:menuItem icon="/pics/info.gif" value="ajaxSingle" ajaxSingle="true" action="submit()" reRender="cmInfoID">
+ <f:param name="cmdParam" value="ajaxSingle" />
+ </rich:menuItem>
+ <rich:menuItem icon="/pics/fatal.gif" value="disabled" disabled="true" reRender="cmInfoID">
+ <f:param name="cmdParam" value="disabled" />
+ </rich:menuItem>
+ <rich:menuItem icon="/pics/fatal.gif" value="immediate" immediate="true" action="submit();">
+ <f:param name="cmdParam" value="immedeate" />
+ <h:inputText value="#{contextMenu.inputText}" />
+ </rich:menuItem>
+ <rich:menuItem icon="/pics/fatal.gif" value="submitMode: none" submitMode="none" reRender="cmInfoID">
+ <f:param name="cmdParam" value="none" />
+ </rich:menuItem>
+ <rich:menuItem icon="/pics/fatal.gif" value="submitMode: server" submitMode="server" reRender="cmInfoID">
+ <f:param name="cmdParam" value="server" />
+ </rich:menuItem>
+ <rich:menuItem icon="/pics/fatal.gif" value="submitMode: ajax" submitMode="ajax" reRender="cmInfoID">
+ <f:param name="cmdParam" value="ajax" />
+ </rich:menuItem>
+ <rich:menuItem value="select">
+ <h:selectOneMenu value="#{contextMenu.selectOneMenu}" onchange="submit();">
+ <f:selectItem itemLabel="item1" itemValue="item1" />
+ <f:selectItem itemLabel="item2" itemValue="item2" />
+ </h:selectOneMenu>
+ </rich:menuItem>
+ </rich:contextMenu>
+ </h:inputText>
+
+
+ <div id="divcmTestID" style="width: 80px; height: 45px; background-color: #008080;"> <rich:contextMenu
+ attached="#{contextMenu.attached}" submitMode="#{contextMenu.submitMode}" event="#{contextMenu.event}"
+ disableDefaultMenu="#{contextMenu.disableDefaultMenu}" rendered="#{contextMenu.rendered}" hideDelay="#{contextMenu.hideDelay}"
+ showDelay="#{contextMenu.showDelay}" popupWidth="#{contextMenu.popupWidth}">
+ <rich:menuItem icon="/pics/header.png" value="div" reRender="cmInfoID">
+ <f:param name="cmdParam" value="div" />
+ </rich:menuItem>
+ <rich:menuSeparator />
+ <rich:menuItem icon="/pics/info.gif" value="action" action="alert('action work')" reRender="cmInfoID">
+ <f:param name="cmdParam" value="action" />
+ </rich:menuItem>
+ <rich:menuItem icon="/pics/info.gif" value="actionListener" actionListener="#{contextMenu.actionListener}" reRender="cmInfoID">
+ </rich:menuItem>
+ <rich:menuItem icon="/pics/info.gif" value="ajaxSingle" ajaxSingle="true" action="submit()" reRender="cmInfoID">
+ <f:param name="cmdParam" value="ajaxSingle" />
+ </rich:menuItem>
+ <rich:menuItem icon="/pics/fatal.gif" value="disabled" disabled="true" reRender="cmInfoID">
+ <f:param name="cmdParam" value="disabled" />
+ </rich:menuItem>
+ <rich:menuItem icon="/pics/fatal.gif" value="immediate" immediate="true" action="submit();">
+ <f:param name="cmdParam" value="immedeate" />
+ <h:inputText value="#{contextMenu.inputText}" />
+ </rich:menuItem>
+ <rich:menuItem icon="/pics/fatal.gif" value="submitMode: none" submitMode="none" reRender="cmInfoID">
+ <f:param name="cmdParam" value="none" />
+ </rich:menuItem>
+ <rich:menuItem icon="/pics/fatal.gif" value="submitMode: server" submitMode="server" reRender="cmInfoID">
+ <f:param name="cmdParam" value="server" />
+ </rich:menuItem>
+ <rich:menuItem icon="/pics/fatal.gif" value="submitMode: ajax" submitMode="ajax" reRender="cmInfoID">
+ <f:param name="cmdParam" value="ajax" />
+ </rich:menuItem>
+ <rich:menuItem value="select">
+ <h:selectOneMenu value="#{contextMenu.selectOneMenu}" onchange="submit();">
+ <f:selectItem itemLabel="item1" itemValue="item1" />
+ <f:selectItem itemLabel="item2" itemValue="item2" />
+ </h:selectOneMenu>
+ </rich:menuItem>
+ </rich:contextMenu></div>
+
+
+ <h:panelGrid id="pgTestID" columns="1" border="5" cellpadding="2" cellspacing="2">
+ <h:outputText value="panelGrid" />
+ <h:outputText value="" />
+ <rich:contextMenu attached="#{contextMenu.attached}" submitMode="#{contextMenu.submitMode}" event="#{contextMenu.event}"
+ disableDefaultMenu="#{contextMenu.disableDefaultMenu}" rendered="#{contextMenu.rendered}" hideDelay="#{contextMenu.hideDelay}"
+ showDelay="#{contextMenu.showDelay}" popupWidth="#{contextMenu.popupWidth}">
+ <rich:menuItem icon="/pics/header.png" value="panelGrid" reRender="cmInfoID">
+ <f:param name="cmdParam" value="panelGrid" />
+ </rich:menuItem>
+ <rich:menuSeparator />
+ <rich:menuItem icon="/pics/info.gif" value="action" action="alert('action work')" reRender="cmInfoID">
+ <f:param name="cmdParam" value="action" />
+ </rich:menuItem>
+ <rich:menuItem icon="/pics/info.gif" value="actionListener" actionListener="#{contextMenu.actionListener}" reRender="cmInfoID">
+ </rich:menuItem>
+ <rich:menuItem icon="/pics/info.gif" value="ajaxSingle" ajaxSingle="true" action="submit()" reRender="cmInfoID">
+ <f:param name="cmdParam" value="ajaxSingle" />
+ </rich:menuItem>
+ <rich:menuItem icon="/pics/fatal.gif" value="disabled" disabled="true" reRender="cmInfoID">
+ <f:param name="cmdParam" value="disabled" />
+ </rich:menuItem>
+ <rich:menuItem icon="/pics/fatal.gif" value="immediate" immediate="true" action="submit();">
+ <f:param name="cmdParam" value="immedeate" />
+ <h:inputText value="#{contextMenu.inputText}" />
+ </rich:menuItem>
+ <rich:menuItem icon="/pics/fatal.gif" value="submitMode: none" submitMode="none" reRender="cmInfoID">
+ <f:param name="cmdParam" value="none" />
+ </rich:menuItem>
+ <rich:menuItem icon="/pics/fatal.gif" value="submitMode: server" submitMode="server" reRender="cmInfoID">
+ <f:param name="cmdParam" value="server" />
+ </rich:menuItem>
+ <rich:menuItem icon="/pics/fatal.gif" value="submitMode: ajax" submitMode="ajax" reRender="cmInfoID">
+ <f:param name="cmdParam" value="ajax" />
+ </rich:menuItem>
+ <rich:menuItem value="select">
+ <h:selectOneMenu value="#{contextMenu.selectOneMenu}" onchange="submit();">
+ <f:selectItem itemLabel="item1" itemValue="item1" />
+ <f:selectItem itemLabel="item2" itemValue="item2" />
+ </h:selectOneMenu>
+ </rich:menuItem>
+ </rich:contextMenu>
</h:panelGrid>
-</f:subview>
\ No newline at end of file
+ </h:panelGrid>
+</f:subview>
Modified: branches/3.1.x/test-applications/facelets/src/main/webapp/ContextMenu/ContextMenuProperty.xhtml
===================================================================
--- branches/3.1.x/test-applications/facelets/src/main/webapp/ContextMenu/ContextMenuProperty.xhtml 2007-11-29 15:59:38 UTC (rev 4351)
+++ branches/3.1.x/test-applications/facelets/src/main/webapp/ContextMenu/ContextMenuProperty.xhtml 2007-11-29 16:20:06 UTC (rev 4352)
@@ -1,13 +1,18 @@
<f:subview id="contextMenuPropertySubviewID" xmlns:f="http://java.sun.com/jsf/core" xmlns:a4j="http://richfaces.org/a4j"
xmlns:h="http://java.sun.com/jsf/html" xmlns:rich="http://richfaces.org/rich" xmlns:ui="http://java.sun.com/jsf/facelets">
+
+ <a4j:commandButton value="reRender" reRender="orderingListID"></a4j:commandButton>
+ <a4j:commandButton action="submit();" value="a4j submit();"></a4j:commandButton>
+ <a4j:commandButton action="submit();" immediate="true" value="immediate submit(); (a4j)"></a4j:commandButton>
+ <h:commandButton action="submit();" value="submit();" />
+ <h:commandButton action="submit();" immediate="true" value="immediate submit();" />
+
<h:panelGrid columns="2" style="top">
-
<h:outputText value="event:" />
<h:selectOneMenu value="#{contextMenu.event}" onchange="submit();">
<f:selectItem itemLabel="oncontextmenu" itemValue="oncontextmenu" />
<f:selectItem itemLabel="onclick" itemValue="onclick" />
<f:selectItem itemLabel="onmousemove" itemValue="onmousemove" />
- <f:selectItem itemLabel="onblur" itemValue="onblur" />
</h:selectOneMenu>
<h:outputText value="popupWidth:" />
@@ -25,13 +30,13 @@
<a4j:support event="onchange" reRender="contextMenuID"></a4j:support>
</h:inputText>
- <h:outputText value="submitMode:" onchange="submit();" />
- <h:selectOneRadio value="#{contextMenu.submitMode}">
+ <h:outputText value="submitMode:" />
+ <h:selectOneRadio value="#{contextMenu.submitMode}" onchange="submit();">
<f:selectItem itemLabel="none" itemValue="none" />
<f:selectItem itemLabel="server" itemValue="server" />
<f:selectItem itemLabel="ajax" itemValue="ajax" />
</h:selectOneRadio>
-
+
<h:outputText value="attached" />
<h:selectBooleanCheckbox value="#{contextMenu.attached}" onchange="submit();" />
Modified: branches/3.1.x/test-applications/facelets/src/main/webapp/OrderingList/OrderingListStraightforward.xhtml
===================================================================
--- branches/3.1.x/test-applications/facelets/src/main/webapp/OrderingList/OrderingListStraightforward.xhtml 2007-11-29 15:59:38 UTC (rev 4351)
+++ branches/3.1.x/test-applications/facelets/src/main/webapp/OrderingList/OrderingListStraightforward.xhtml 2007-11-29 16:20:06 UTC (rev 4352)
@@ -35,6 +35,7 @@
<h:panelGroup>
<a4j:commandButton value="reRender" reRender="orderingListID"></a4j:commandButton>
<a4j:commandButton action="submit();" value="a4j submit();"></a4j:commandButton>
+ <a4j:commandButton action="submit();" immediate="true" value="immediate submit(); (a4j)"></a4j:commandButton>
<h:commandButton action="submit();" value="submit();" />
<h:commandButton action="submit();" immediate="true" value="immediate submit();" />
</h:panelGroup>
17 years, 1 month
JBoss Rich Faces SVN: r4351 - in branches/3.1.x/sandbox/ui/listShuttle/src/main/java/org/richfaces: model and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2007-11-29 10:59:38 -0500 (Thu, 29 Nov 2007)
New Revision: 4351
Modified:
branches/3.1.x/sandbox/ui/listShuttle/src/main/java/org/richfaces/component/UIListShuttle.java
branches/3.1.x/sandbox/ui/listShuttle/src/main/java/org/richfaces/model/ListShuttleRowKey.java
Log:
latest changes for listShuttle & orderingList
Modified: branches/3.1.x/sandbox/ui/listShuttle/src/main/java/org/richfaces/component/UIListShuttle.java
===================================================================
--- branches/3.1.x/sandbox/ui/listShuttle/src/main/java/org/richfaces/component/UIListShuttle.java 2007-11-29 15:59:23 UTC (rev 4350)
+++ branches/3.1.x/sandbox/ui/listShuttle/src/main/java/org/richfaces/component/UIListShuttle.java 2007-11-29 15:59:38 UTC (rev 4351)
@@ -55,7 +55,7 @@
}
protected static final class SubmittedValue extends OrderingBaseAbstractSubmittedValue {
- private static final Pattern KEY_STRING_PATTERN = Pattern.compile("(s?\\d+)(s?a?)");
+ private static final Pattern KEY_STRING_PATTERN = Pattern.compile("((?:s|t)\\d+)(s?a?)");
/**
*
*/
@@ -103,10 +103,13 @@
try {
if (c == 's') {
sourceKey = true;
- integer = new Integer(keyString.substring(1));
+ } else if (c == 't') {
+ sourceKey = false;
} else {
- integer = new Integer(keyString);
+ throw new IllegalArgumentException();
}
+
+ integer = new Integer(keyString.substring(1));
} catch (NumberFormatException e) {
throw new FacesException(new IllegalArgumentException());
}
Modified: branches/3.1.x/sandbox/ui/listShuttle/src/main/java/org/richfaces/model/ListShuttleRowKey.java
===================================================================
--- branches/3.1.x/sandbox/ui/listShuttle/src/main/java/org/richfaces/model/ListShuttleRowKey.java 2007-11-29 15:59:23 UTC (rev 4350)
+++ branches/3.1.x/sandbox/ui/listShuttle/src/main/java/org/richfaces/model/ListShuttleRowKey.java 2007-11-29 15:59:38 UTC (rev 4351)
@@ -61,7 +61,7 @@
}
public String toString() {
- return (source ? "s" : "") + rowKey.toString();
+ return (source ? "s" : "t") + rowKey.toString();
}
public ListShuttleRowKey(Object rowKey, boolean source) {
17 years, 1 month
JBoss Rich Faces SVN: r4350 - in branches/3.1.x/ui/orderingList/src/main: resources/org/richfaces/renderkit/html/scripts and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2007-11-29 10:59:23 -0500 (Thu, 29 Nov 2007)
New Revision: 4350
Modified:
branches/3.1.x/ui/orderingList/src/main/java/org/richfaces/component/OrderingBaseAbstractSubmittedValue.java
branches/3.1.x/ui/orderingList/src/main/java/org/richfaces/component/UIOrderingBaseComponent.java
branches/3.1.x/ui/orderingList/src/main/resources/org/richfaces/renderkit/html/scripts/ListBase.js
Log:
latest changes for listShuttle & orderingList
Modified: branches/3.1.x/ui/orderingList/src/main/java/org/richfaces/component/OrderingBaseAbstractSubmittedValue.java
===================================================================
--- branches/3.1.x/ui/orderingList/src/main/java/org/richfaces/component/OrderingBaseAbstractSubmittedValue.java 2007-11-29 15:08:58 UTC (rev 4349)
+++ branches/3.1.x/ui/orderingList/src/main/java/org/richfaces/component/OrderingBaseAbstractSubmittedValue.java 2007-11-29 15:59:23 UTC (rev 4350)
@@ -46,9 +46,15 @@
protected Map asMap(String string) {
if (string != null && string.length() != 0) {
- String[] valueOrder = string.split(",");
+ String substring = string.trim().substring(1, string.length() - 1);
+
+ String[] valueOrder = substring.split(",");
Map translationMap = new LinkedHashMap(valueOrder.length);
for (int i = 0; i < valueOrder.length; i++) {
+ if (valueOrder[i].length() == 0) {
+ continue;
+ }
+
Matcher matcher = getKeyStringPattern().matcher(valueOrder[i]);
if (matcher.matches()) {
Object oldKey = createOldKey(matcher.group(1));
@@ -99,7 +105,7 @@
result.append(',');
}
}
- return result.toString();
+ return "[" + result.toString() + "]";
} else {
return "";
}
Modified: branches/3.1.x/ui/orderingList/src/main/java/org/richfaces/component/UIOrderingBaseComponent.java
===================================================================
--- branches/3.1.x/ui/orderingList/src/main/java/org/richfaces/component/UIOrderingBaseComponent.java 2007-11-29 15:08:58 UTC (rev 4349)
+++ branches/3.1.x/ui/orderingList/src/main/java/org/richfaces/component/UIOrderingBaseComponent.java 2007-11-29 15:59:23 UTC (rev 4350)
@@ -776,11 +776,11 @@
private Set selectionKeys;
public boolean isActive() {
- return activeItemKeys != null && activeItemKeys.contains(getTranslatedRowKey());
+ return activeItemKeys != null && activeItemKeys.contains(getRowKey());
}
public boolean isSelected() {
- return selectionKeys != null && selectionKeys.contains(getTranslatedRowKey());
+ return selectionKeys != null && selectionKeys.contains(getRowKey());
}
public SubmittedItemState(Set selectionKeys, Set activeItemKeys) {
Modified: branches/3.1.x/ui/orderingList/src/main/resources/org/richfaces/renderkit/html/scripts/ListBase.js
===================================================================
--- branches/3.1.x/ui/orderingList/src/main/resources/org/richfaces/renderkit/html/scripts/ListBase.js 2007-11-29 15:08:58 UTC (rev 4349)
+++ branches/3.1.x/ui/orderingList/src/main/resources/org/richfaces/renderkit/html/scripts/ListBase.js 2007-11-29 15:59:23 UTC (rev 4350)
@@ -397,7 +397,7 @@
saveState : function() {
//if (this.activeItem != null || (this.selectedItems.length > 0)) {
- this.valueKeeper.value = this.getAsString();
+ this.valueKeeper.value = "[" + this.getAsString() + "]";
//}
}
17 years, 1 month