JBoss Rich Faces SVN: r4006 - trunk/docs/userguide/en/src/main/docbook/included.
by richfaces-svn-commits@lists.jboss.org
Author: artdaw
Date: 2007-11-15 09:44:50 -0500 (Thu, 15 Nov 2007)
New Revision: 4006
Added:
trunk/docs/userguide/en/src/main/docbook/included/contextMenu.xml
Log:
Creating the Component with a Page Tag, Creating the Component Dynamically Using Java, Details of Usage, JavaScript API sections
Added: trunk/docs/userguide/en/src/main/docbook/included/contextMenu.xml
===================================================================
--- trunk/docs/userguide/en/src/main/docbook/included/contextMenu.xml (rev 0)
+++ trunk/docs/userguide/en/src/main/docbook/included/contextMenu.xml 2007-11-15 14:44:50 UTC (rev 4006)
@@ -0,0 +1,259 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<section>
+ <sectioninfo>
+ <keywordset>
+ <keyword>rich:contextMenu</keyword>
+ <keyword>contextMenu</keyword>
+ </keywordset>
+ </sectioninfo>
+ <section>
+ <title>Creating the Component with a Page Tag</title>
+ <para>Here is a simple example as it could be used on a page: </para>
+
+ <para>
+ <emphasis role="bold">Example:</emphasis>
+ </para>
+ <programlisting role="XML"><![CDATA[...
+ <rich:contextMenu value="Menu1">
+
+ <!--Nested menu components-->
+
+ </rich:contextMenu>
+...
+]]></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.HtmlContextMenu;
+
+...
+
+HtmlContextMenu myContextMenu = new HtmlContextMenu();
+
+...
+]]></programlisting>
+ </section>
+ <section>
+ <title>Details of Usage</title>
+ <para>All attributes except <emphasis>
+ <property>"value"</property>
+ </emphasis> are optional. The <emphasis>
+ <property>"value"</property>
+ </emphasis> attribute defines text to be represented. For the same purpose you can also
+ use the <emphasis>
+ <property>"label"</property>
+ </emphasis> facet.</para>
+
+ <para> It's possible to define the direction for list appear in the <emphasis>
+ <property>"direction"</property>
+ </emphasis>attribute. If the accordance of the popup corner to corner of the label isn’t
+ set <emphasis>
+ <property>"direction"</property>
+ </emphasis> attribute must set next accordances: </para>
+ <itemizedlist>
+ <listitem>
+ <para>top-left - a menu drops to the top and left</para>
+ </listitem>
+
+ <listitem>
+ <para>top-right - a menu drops to the top and right</para>
+ </listitem>
+
+ <listitem>
+ <para>bottom-left - a menu drops to the bottom and left</para>
+ </listitem>
+
+ <listitem>
+ <para>bottom-right - a menu drops to the bottom and right</para>
+ </listitem>
+
+ <listitem>
+ <para>auto(default) - smart positioning activation</para>
+ </listitem>
+ </itemizedlist>
+ <para><emphasis role="bold">
+ <property><contextMenu></property>
+ </emphasis> provides <emphasis>
+ <property>"jointPoint"</property>
+ </emphasis> attribute to set the point on the label element to connect popup. Possible
+ values are:</para>
+
+ <itemizedlist>
+ <listitem>
+ <para>tr - a menu is attached to the top-right point of the button element</para>
+ </listitem>
+
+ <listitem>
+ <para>tl - a menu is attached to the top-left point of the button element</para>
+ </listitem>
+
+ <listitem>
+ <para>br - a menu is attached to the bottom-right point of the button element</para>
+ </listitem>
+
+ <listitem>
+ <para>bl - a menu is attached to the bottom-left point of the button element</para>
+ </listitem>
+
+ <listitem>
+ <para>auto(default) - smart positioning activation</para>
+ </listitem>
+ </itemizedlist>
+
+ <!--ADD EXAMPLE and SCREENSHOT -->
+
+ <para>In order to set the offset for the menu popup relatively to label, you can use <emphasis>
+ <property>"horizontalOffset"</property>
+ </emphasis> and <emphasis>
+ <property>"verticalOffset"</property>
+ </emphasis> attributes. Values can be negative.</para>
+
+ <para><property>menuItem</property> provides <emphasis>
+ <property>"submitMode"</property>
+ </emphasis> attribute to define the way of submission. Possible values : <itemizedlist>
+ <listitem>
+ <para>Server (default)</para>
+ </listitem>
+ </itemizedlist>
+ <para>The standard form submission is performed and the page is completely refreshed.</para>
+ <itemizedlist>
+ <listitem>
+ <para>Ajax</para>
+ </listitem>
+ </itemizedlist>
+ <para>An Ajax form submission is performed, and specified elements in the <emphasis>
+ <property>"reRender"</property>
+ </emphasis> attribute are rerendered.</para>
+ <itemizedlist>
+ <listitem>
+ <para>None</para>
+ </listitem>
+ </itemizedlist>
+ <para> The <emphasis>
+ <property>"action"</property>
+ </emphasis> and <emphasis>
+ <property>"actionListener"</property>
+ </emphasis> item's attributes are ignored. Menu items don't fire any submits
+ themselves. The behavior is fully defined by the components nested inside items.</para>
+ <!-- template
+ <para>emphasis role="bold">
+ <property><contextMenu></property>
+ </emphasis> could not be generated for every component where it's defined. Templating could
+ be used instead. So only representation data could be loaded from server. And markup
+ could be evaluated on client side. So it's should accept macrosubstitutions like
+ {value} </para>
+
+ -->
+ </para>
+ </section>
+ <section>
+ <title>JavaScript API</title>
+ <table>
+ <title>JavaScript API</title>
+ <tgroup cols="3">
+ <thead>
+ <row>
+ <entry>Function</entry>
+ <entry>Description</entry>
+ <entry>Apply to</entry>
+ </row>
+ </thead>
+ <tbody>
+ <!--Sorting API -->
+ <row>
+ <entry>doHide()</entry>
+ <entry>Hide component or group</entry>
+ <entry>Component, group</entry>
+ </row>
+ <row>
+ <entry>doShow()</entry>
+ <entry>Show component or group</entry>
+ <entry>Component, group</entry>
+ </row>
+ <row>
+ <entry>doEnable()</entry>
+ <entry>Enable component, item, group</entry>
+ <entry>Component, Item, Group</entry>
+ </row>
+ <row>
+ <entry>doDisable()</entry>
+ <entry>Disable component, item or group</entry>
+ <entry>Component, Item, Group</entry>
+ </row>
+ </tbody>
+ </tgroup>
+ </table>
+ </section>
+ <section>
+ <title>Look-and-Feel Customization</title>
+
+ <para>For skinnability implementation, the components use a <emphasis>
+ <property>style class redefinition method.</property>
+ </emphasis> Default style classes are mapped on <emphasis>
+ <property>skin parameters.</property>
+ </emphasis></para>
+
+ <para>There are two ways to redefine the appearance of all <emphasis role="bold">
+ <property><rich:contextMenu></property>
+ </emphasis> components at once:</para>
+
+ <itemizedlist>
+ <listitem>
+ <para>Redefine the corresponding skin parameters</para>
+ </listitem>
+
+ <listitem>
+ <para>Add to your style sheets <emphasis>
+ <property>style classes</property>
+ </emphasis> used by a <emphasis role="bold">
+ <property><rich:contextMenu></property>
+ </emphasis> component</para>
+ </listitem>
+ </itemizedlist>
+ </section>
+ <section>
+ <title>Skin Parameters Redefinition</title>
+ </section>
+ <section>
+ <title>Definition of Custom Style Classes</title>
+
+ <para>On the screenshot there are classes names that define styles for component elements.</para>
+
+ <figure>
+ <title>Classes names</title>
+
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref=""/>
+ </imageobject>
+ </mediaobject>
+ </figure>
+
+ <table>
+ <title>Classes names that define a label</title>
+
+ <tgroup cols="2">
+ <thead>
+ <row>
+ <entry>Class name</entry>
+
+ <entry>Description</entry>
+ </row>
+ </thead>
+
+ <tbody>
+ <row>
+ <entry></entry>
+
+ <entry></entry>
+ </row>
+ </tbody>
+ </tgroup>
+ </table>
+ </section>
+</section>
18 years, 5 months
JBoss Rich Faces SVN: r4005 - trunk/docs/userguide/en/src/main/docbook/included.
by richfaces-svn-commits@lists.jboss.org
Author: artdaw
Date: 2007-11-15 09:44:26 -0500 (Thu, 15 Nov 2007)
New Revision: 4005
Added:
trunk/docs/userguide/en/src/main/docbook/included/contextMenu.desc.xml
Log:
write description of the component
Added: trunk/docs/userguide/en/src/main/docbook/included/contextMenu.desc.xml
===================================================================
--- trunk/docs/userguide/en/src/main/docbook/included/contextMenu.desc.xml (rev 0)
+++ trunk/docs/userguide/en/src/main/docbook/included/contextMenu.desc.xml 2007-11-15 14:44:26 UTC (rev 4005)
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<section>
+ <sectioninfo>
+ <keywordset>
+ <keyword>contextMenu</keyword>
+ </keywordset>
+ </sectioninfo>
+ <section>
+ <title>Description</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref=""/>
+ </imageobject>
+ </mediaobject>
+ <para>An <property>contextMenu</property> component is used for creation multileveled
+ context menus that are activated after a user defines an event (onmouseover, onclick,
+ etc.) on any element on the page.</para>
+ </section>
+ <section>
+ <title>Key Features</title>
+ <itemizedlist>
+ <listitem>Skinnable <property>contextMenu</property> and child items</listitem>
+ <listitem>Highly customizable look and feel</listitem>
+ <listitem>Disablement support</listitem>
+ <listitem>Pop-up appearance event customization</listitem>
+ </itemizedlist>
+ </section>
+</section>
18 years, 5 months
JBoss Rich Faces SVN: r4004 - trunk/sandbox/ui/orderingList/src/main/config/component.
by richfaces-svn-commits@lists.jboss.org
Author: vmolotkov
Date: 2007-11-15 09:43:51 -0500 (Thu, 15 Nov 2007)
New Revision: 4004
Modified:
trunk/sandbox/ui/orderingList/src/main/config/component/orderinglist.xml
Log:
default value for listWidth
Modified: trunk/sandbox/ui/orderingList/src/main/config/component/orderinglist.xml
===================================================================
--- trunk/sandbox/ui/orderingList/src/main/config/component/orderinglist.xml 2007-11-15 14:37:00 UTC (rev 4003)
+++ trunk/sandbox/ui/orderingList/src/main/config/component/orderinglist.xml 2007-11-15 14:43:51 UTC (rev 4004)
@@ -52,6 +52,7 @@
<description>
listWidth
</description>
+ <defaultvalue><![CDATA[200]]></defaultvalue>
</property>
<property>
<name>listHeight</name>
@@ -59,6 +60,7 @@
<description>
listHeight
</description>
+ <defaultvalue><![CDATA[150]]></defaultvalue>
</property>
<property>
<name>rowClasses</name>
18 years, 5 months
JBoss Rich Faces SVN: r4003 - in trunk/docs/userguide/en/src/main: resources/images and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: vkorluzhenko
Date: 2007-11-15 09:37:00 -0500 (Thu, 15 Nov 2007)
New Revision: 4003
Added:
trunk/docs/userguide/en/src/main/resources/images/tree5.png
Modified:
trunk/docs/userguide/en/src/main/docbook/included/tree.xml
Log:
http://jira.jboss.com/jira/browse/RF-740 - Added example of usage of DnD attributes. Added description for example and picture.
Modified: trunk/docs/userguide/en/src/main/docbook/included/tree.xml
===================================================================
--- trunk/docs/userguide/en/src/main/docbook/included/tree.xml 2007-11-15 13:47:43 UTC (rev 4002)
+++ trunk/docs/userguide/en/src/main/docbook/included/tree.xml 2007-11-15 14:37:00 UTC (rev 4003)
@@ -175,8 +175,7 @@
<emphasis role="bold">Example:</emphasis>
</para>
- <programlisting role="JAVA"><![CDATA[<h: outputText value="#{varAttributeName}">
- ]]></programlisting>
+ <programlisting role="JAVA"><![CDATA[<h: outputText value="#{varAttributeName}">]]></programlisting>
<para>
<property>"varAttributeName"</property> is a value for <emphasis>
@@ -290,7 +289,7 @@
<f:facet name="iconLeaf">
<h:graphicImage value="/images/tree/song.gif " />
</f:facet>
- ...
+ ...
</rich:tree>
...]]></programlisting>
@@ -373,6 +372,52 @@
</tbody>
</tgroup>
</table>
+
+ <para>An example of usage is placed below.</para>
+
+ <para>
+ <emphasis role="bold">Example:</emphasis>
+ </para>
+
+ <programlisting role="JAVA"><![CDATA[...
+ <h:form>
+ <rich:tree dragIndicator=":treeDragIndicator" dropListener="#{libraryAjaxTree.processDrop}" style="width:300px" value="#{libraryAjaxTree.data}" var="item" nodeFace="#{item.type}">
+ <rich:treeNode type="artist" acceptedTypes="album" iconLeaf="/images/tree/group.gif" icon="/images/tree/group.gif">
+ <h:outputText value="#{item.name}" />
+ </rich:treeNode>
+ <rich:treeNode type="album" dragType="album" acceptedTypes="song" iconLeaf="/images/tree/cd.gif" icon="/images/tree/cd.gif">
+ <h:outputText value="#{item.title}" />
+ <rich:dndParam name="label" type="drag" value="Album: #{item.title}" />
+ </rich:treeNode>
+ <rich:treeNode type="song" dragType="song" iconLeaf="/images/tree/music.gif" icon="/images/tree/music.gif">
+ <h:outputText value="#{item.title}" />
+ <rich:dndParam name="label" type="drag" value="Song: #{item.title}" />
+ </rich:treeNode>
+ </rich:tree>
+ </h:form>
+...]]></programlisting>
+
+ <para>In the example a song from one album can be dragged into other because for the second
+ <property>treeNode</property> with <emphasis>
+ <property>"type"</property>
+ </emphasis>="album" was defined attribute <emphasis>
+ <property>"acceptedTypes"</property>
+ </emphasis>="song". Its value is equal to the value of the<emphasis>
+ <property>"type"</property>
+ </emphasis>attribute defined for the third treeNode (see picture below).
+ Also an album can be dragged into <property>treeNode</property> with <emphasis>
+ <property>"type"</property>
+ </emphasis>="artist".</para>
+
+ <figure>
+ <title>DnD operations</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/tree5.png"/>
+ </imageobject>
+ </mediaobject>
+ </figure>
+
</section>
<section>
<title>Events handling</title>
@@ -412,44 +457,43 @@
handlers of <property>treeNode</property> capture events occured on
<property>treeNode</property> only, except for children events. </para>
</section>
-
+
<section>
<title>Look-and-Feel Customization</title>
-
+
<para>For skinnability implementation, the components use a <emphasis>
- <property>style class redefinition method.</property>
- </emphasis> Default style classes are mapped on <emphasis>
- <property>skin parameters.</property>
- </emphasis></para>
-
+ <property>style class redefinition method.</property>
+ </emphasis> Default style classes are mapped on <emphasis>
+ <property>skin parameters.</property>
+ </emphasis></para>
+
<para>There are two ways to redefine the appearance of all <emphasis role="bold">
- <property><rich:tree></property>
- </emphasis> components at once:</para>
-
+ <property><rich:tree></property>
+ </emphasis> components at once:</para>
+
<itemizedlist>
<listitem>
<para>Redefine the corresponding skin parameters</para>
</listitem>
-
+
<listitem>
<para>Add to your style sheets <emphasis>
- <property>style classes</property>
- </emphasis> used by a <emphasis role="bold">
- <property><rich:tree></property>
- </emphasis> component</para>
+ <property>style classes</property>
+ </emphasis> used by a <emphasis role="bold">
+ <property><rich:tree></property>
+ </emphasis> component</para>
</listitem>
</itemizedlist>
</section>
-
+
<section>
<title>Skin Parameters Redefinition:</title>
- <para>There is only one skin parameter for <emphasis
- role="bold">
- <property><rich:tree></property>
- </emphasis>. As it's a wrapper component for <emphasis
- role="bold">
- <property><rich:treeNode></property>
- </emphasis> components, look and feel customization is described in the <link linkend="SPRofTN">corresponding section.</link></para>
+ <para>There is only one skin parameter for <emphasis role="bold">
+ <property><rich:tree></property>
+ </emphasis>. As it's a wrapper component for <emphasis role="bold">
+ <property><rich:treeNode></property>
+ </emphasis> components, look and feel customization is described in the <link
+ linkend="SPRofTN">corresponding section.</link></para>
<table>
<title>Skin parameters for a wrapper element</title>
<tgroup cols="2">
Added: trunk/docs/userguide/en/src/main/resources/images/tree5.png
===================================================================
(Binary files differ)
Property changes on: trunk/docs/userguide/en/src/main/resources/images/tree5.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
18 years, 5 months
JBoss Rich Faces SVN: r4002 - trunk/sandbox/ui/orderingList/src/main/resources/org/richfaces/renderkit/html/css.
by richfaces-svn-commits@lists.jboss.org
Author: vmolotkov
Date: 2007-11-15 08:47:43 -0500 (Thu, 15 Nov 2007)
New Revision: 4002
Modified:
trunk/sandbox/ui/orderingList/src/main/resources/org/richfaces/renderkit/html/css/orderingList.xcss
Log:
cosmetic changes
Modified: trunk/sandbox/ui/orderingList/src/main/resources/org/richfaces/renderkit/html/css/orderingList.xcss
===================================================================
--- trunk/sandbox/ui/orderingList/src/main/resources/org/richfaces/renderkit/html/css/orderingList.xcss 2007-11-15 12:52:25 UTC (rev 4001)
+++ trunk/sandbox/ui/orderingList/src/main/resources/org/richfaces/renderkit/html/css/orderingList.xcss 2007-11-15 13:47:43 UTC (rev 4002)
@@ -86,9 +86,9 @@
width : 100%;
}
-.ol_internal_tab .ol_endcol{border-right : 0px;white-space: nowrap;}
+.ol_internal_tab .ol_endcol{border-right : 0px;}
-.ol_internal_tab td{font-family : Arial; font-size :11px; border-bottom : 1px solid #bfbfc0; border-top : 1px solid #FFFFFF; padding : 2px;white-space: nowrap;}
+.ol_internal_tab td{font-family : Arial; font-size :11px; border-bottom : 1px solid #bfbfc0; border-top : 1px solid #FFFFFF; padding : 2px;}
.ol_internal_tab tr.ol_select{background : #EAF0F8}
@@ -96,6 +96,10 @@
background : #EAF0F8; color : #4A75B5;
}
+.ol_internal_tab tr.ol_active td{
+ color : #4A75B5;
+}
+
.ol_internal_tab tr.ol_normal {
}
@@ -118,9 +122,8 @@
<u:style name="color" skin="generalTextColor"/>
<u:style name="font-size" skin="generalSizeFont"/>
<u:style name="font-family" skin="generalFamilyFont"/>
- <u:style name="width" value="16px"/>
- <u:style name="height" value="16px"/>
<u:style name="border" value="0"/>
+ <u:style name="white-space" value="nowrap"/>
</u:selector>
<u:selector name=".ol_control_bn_up">
<u:style name="background-image">
18 years, 5 months
JBoss Rich Faces SVN: r4001 - in trunk/sandbox/ui/orderingList/src/main: templates/org/richfaces and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: vmolotkov
Date: 2007-11-15 07:52:25 -0500 (Thu, 15 Nov 2007)
New Revision: 4001
Modified:
trunk/sandbox/ui/orderingList/src/main/resources/org/richfaces/renderkit/html/css/orderingList.xcss
trunk/sandbox/ui/orderingList/src/main/templates/org/richfaces/htmlOrderingList.jspx
Log:
cosmetic changes
Modified: trunk/sandbox/ui/orderingList/src/main/resources/org/richfaces/renderkit/html/css/orderingList.xcss
===================================================================
--- trunk/sandbox/ui/orderingList/src/main/resources/org/richfaces/renderkit/html/css/orderingList.xcss 2007-11-15 12:30:58 UTC (rev 4000)
+++ trunk/sandbox/ui/orderingList/src/main/resources/org/richfaces/renderkit/html/css/orderingList.xcss 2007-11-15 12:52:25 UTC (rev 4001)
@@ -6,48 +6,17 @@
<f:verbatim><![CDATA[
- .ol_button_light{background : url(ol_images/bg_header.png) top left #C6D6EA repeat-x; border : 1px solid #E79A00;cursor : pointer; padding : 1px; font-family : Arial; font-size :11px;}
- .ol_button_dis{background : #bfbfc0; border : 1px solid #bfbfc0; margin-bottom : 3px; padding : 1px}
- .ol_button_press{background : url(ol_images/bg_press.png) top left repeat-x #EAF0F8; border : 1px solid #E79A00; padding : 2px 0px 0px 2px;font-family : Arial; font-size :11px;}
- .ol_center_button_col_valign{vertical-align : middle}
- .ol_right_button_col_valign{vertical-align : middle}
- .ol_button_content{font-family : Arial; font-size :11px; padding : 0px 0px 0px 0px; text-align : center;}
+.ol_button_layout{padding : 15px 8px 15px 0px;}
+.ol_button_border{border : 1px solid #bfbfc0; margin-bottom : 3px;}
+.ol_button{background : url(ol_images/bg_header.png) top left #C6D6EA repeat-x; cursor : pointer; padding : 2px; font-family : Arial; font-size :11px;}
+.ol_button_light{background : url(ol_images/bg_header.png) top left #C6D6EA repeat-x; border : 1px solid #E79A00;cursor : pointer; padding : 1px; font-family : Arial; font-size :11px;}
+.ol_button_dis{background : #bfbfc0; border : 1px solid #bfbfc0; margin-bottom : 3px; padding : 1px}
+.ol_button_press{background : url(ol_images/bg_press.png) top left repeat-x #EAF0F8; border : 1px solid #E79A00; padding : 2px 0px 0px 2px;font-family : Arial; font-size :11px;}
+.ol_center_button_col_valign{vertical-align : middle}
+.ol_right_button_col_valign{vertical-align : middle}
+.ol_button_content{font-family : Arial; font-size :11px; padding : 0px 0px 0px 0px; text-align : center;}
-.ol_caption {
- padding : 1px;
- height: 8px;
-}
-
-.ol_body{border : 0px solid #bfbfc0;}
-
-.ol_label{font-family : Arial; font-size :11px; font-weight : bold;}
-
-.ol_out_label{padding : 3px 3px 3px 8px}
-
-.ol_list{overflow : auto; width : 200px; height : 150px; background : #FFFFFF; border : 1px solid #bfbfc0;}
-
-.ol_outputlist{ margin : 0px 8px 8px 8px;}
-
-.ol_list_content {
- overflow : auto;
- width: 300px;
- height: 232px;
-}
-
-.ol_list_header {
- overflow: hidden;
- width: 300px;
- height: 18px;
-}
-
-.ol_button {
- background : repeat scroll left top;
- border : 1px solid #bfbfc0;
- margin-bottom : 3px;
- cursor : pointer;
- padding : 1px;
-}
-
+/*
.ol_button_clicked {
background : repeat scroll left top;
border : 1px solid #bfbfc0;
@@ -55,12 +24,7 @@
cursor : pointer;
padding : 1px;
}
-
-.ol_button_layout{padding : 15px 8px 15px 0px;}
-.ol_button_border{border : 1px solid #bfbfc0; margin-bottom : 3px;}
-
-
.ol_button_dis {
background : #bfbfc0;
border : 1px solid #bfbfc0;
@@ -74,27 +38,44 @@
margin-bottom : 3px;
padding : 2px 0px 0px 2px;
}
+*/
+.ol_caption {
+ padding : 1px;
+ height: 8px;
+}
+
+.ol_body{border : 0px solid #bfbfc0;}
+
+.ol_label{font-family : Arial; font-size :11px; font-weight : bold;}
+
+.ol_out_label{padding : 3px 3px 3px 8px}
+
+.ol_list{background : #FFFFFF; border : 1px solid #bfbfc0;}
+
+.ol_outputlist{ margin : 0px 8px 8px 8px;}
+
+.ol_list_content {
+ overflow-y : scroll;
+ overflow-x: auto;
+ /*width: 300px;
+ height: 232px;*/
+ width: 200px;
+ height: 150px;
+}
+
+.ol_list_header {
+ overflow: hidden;
+ /*width: 300px;*/
+ height: 18px;
+}
+
.ol_internal_header_tab {
background : repeat scroll left top;
- width : 100%;
+ /*width : 100%;*/
}
-<<<<<<< .mine
-.ol_internal_header_tab th {
- color : #FFFFFF;
-
- font-family : Arial;
- font-size :11px;
- font-weight : normal;
- border-bottom : 1px solid #bfbfc0;
- border-right : 1px solid #bfbfc0;
- padding : 2px;
- white-space: nowrap;
-}
-=======
.ol_internal_header_tab th{background : url(ol_images/bg_header.png) top left repeat-x #C6D6EA; color : #000000; font-family : Arial; font-size :11px; font-weight : normal; border-bottom : 1px solid #bfbfc0;border-right : 1px solid #bfbfc0;border-left : 1px solid #EAF0F8;border-top : 1px solid #FFFFFF; padding : 2px}
->>>>>>> .r3997
.ol_internal_header_tab .ol_endcol {
border-right : 0px;
@@ -105,25 +86,14 @@
width : 100%;
}
-.ol_internal_tab .ol_endcol{border-right : 0px}
+.ol_internal_tab .ol_endcol{border-right : 0px;white-space: nowrap;}
-.ol_internal_tab td{font-family : Arial; font-size :11px; border-bottom : 1px solid #bfbfc0;border-top : 1px solid #FFFFFF; padding : 2px}
+.ol_internal_tab td{font-family : Arial; font-size :11px; border-bottom : 1px solid #bfbfc0; border-top : 1px solid #FFFFFF; padding : 2px;white-space: nowrap;}
-
-<<<<<<< .mine
-.ol_internal_tab tr.ol_select {
- background : repeat scroll left top;
-}
-=======
.ol_internal_tab tr.ol_select{background : #EAF0F8}
->>>>>>> .r3997
.ol_internal_tab tr.ol_active {
-<<<<<<< .mine
- background : repeat scroll left top;
-=======
background : #EAF0F8; color : #4A75B5;
->>>>>>> .r3997
}
.ol_internal_tab tr.ol_normal {
@@ -251,6 +221,5 @@
<f:resource f:key="org.richfaces.renderkit.html.gradientimages.OrderingListSelectGradient" />
</u:style>
<u:style name="background-color" skin="additionalBackgroundColor" />
- <u:style name="color" skin="hoverLinkColor" />
</u:selector>
</f:template>
\ No newline at end of file
Modified: trunk/sandbox/ui/orderingList/src/main/templates/org/richfaces/htmlOrderingList.jspx
===================================================================
--- trunk/sandbox/ui/orderingList/src/main/templates/org/richfaces/htmlOrderingList.jspx 2007-11-15 12:30:58 UTC (rev 4000)
+++ trunk/sandbox/ui/orderingList/src/main/templates/org/richfaces/htmlOrderingList.jspx 2007-11-15 12:52:25 UTC (rev 4001)
@@ -35,12 +35,12 @@
<tr>
<td>
<div id="#{clientId}headerBox" class="ol_list ol_outputlist">
- <div class="ol_list_header" style="width: #{component.attributes['listHeight']}px;">
+ <div class="ol_list_header" style="width: #{component.attributes['listWidth']}px;">
<table id="#{clientId}internal_header_tab" class="ol_internal_header_tab rich-ordering-list-items" cellpadding="0" cellspacing="0">
<f:call name="encodeHeader"/>
</table>
</div>
- <div id="#{clientId}contentBox" class="ol_list_content" style="width: #{component.attributes['listHeight']}px; height:#{component.attributes['listWidth']}px;">
+ <div id="#{clientId}contentBox" class="ol_list_content" style="width: #{component.attributes['listWidth']}px; height:#{component.attributes['listHeight']}px;">
<table id="#{clientId}internal_tab" class="ol_internal_tab" cellpadding="0" cellspacing="0">
<tbody id="#{clientId}tbody">
<vcp:body>
@@ -51,7 +51,7 @@
</div>
</div>
</td>
- <td class="ol_button_layout">
+ <td class="ol_center_button_col_valign">
<div class="ol_button_layout">
<div class="ol_button_border"><div class="ol_button" onmouseover="this.className='ol_button_light'" onmousedown="this.className='ol_button_press'" onmouseup="this.className='ol_button'" onmouseout="this.className='ol_button'"><div class="ol_button_content"><img src="img/up.gif" width="15" height="15" alt="" border="0"/></div></div></div>
<div class="ol_button_border"><div class="ol_button" onmouseover="this.className='ol_button_light'" onmousedown="this.className='ol_button_press'" onmouseup="this.className='ol_button'" onmouseout="this.className='ol_button'"><div class="ol_button_content"><img src="img/down.gif" width="15" height="15" alt="" border="0"/></div></div></div>
18 years, 5 months
JBoss Rich Faces SVN: r4000 - branches/3.1.x/ui/message/src/main/java/org/richfaces/renderkit.
by richfaces-svn-commits@lists.jboss.org
Author: abelevich
Date: 2007-11-15 07:30:58 -0500 (Thu, 15 Nov 2007)
New Revision: 4000
Modified:
branches/3.1.x/ui/message/src/main/java/org/richfaces/renderkit/RichMessageBaseRenderer.java
Log:
RF-1352
Modified: branches/3.1.x/ui/message/src/main/java/org/richfaces/renderkit/RichMessageBaseRenderer.java
===================================================================
--- branches/3.1.x/ui/message/src/main/java/org/richfaces/renderkit/RichMessageBaseRenderer.java 2007-11-15 12:30:17 UTC (rev 3999)
+++ branches/3.1.x/ui/message/src/main/java/org/richfaces/renderkit/RichMessageBaseRenderer.java 2007-11-15 12:30:58 UTC (rev 4000)
@@ -152,7 +152,7 @@
markerClass = (String)uiMsg.getAttributes().get("warnMarkerClass");
markerStyle = (String)uiMsg.getAttributes().get("warnMarkerStyle");
- marker = uiMsg.getFacet("infoMarker");
+ marker = uiMsg.getFacet("warnMarker");
}
18 years, 5 months
JBoss Rich Faces SVN: r3999 - trunk/ui/message/src/main/java/org/richfaces/renderkit.
by richfaces-svn-commits@lists.jboss.org
Author: abelevich
Date: 2007-11-15 07:30:17 -0500 (Thu, 15 Nov 2007)
New Revision: 3999
Modified:
trunk/ui/message/src/main/java/org/richfaces/renderkit/RichMessageBaseRenderer.java
Log:
RF-1352
Modified: trunk/ui/message/src/main/java/org/richfaces/renderkit/RichMessageBaseRenderer.java
===================================================================
--- trunk/ui/message/src/main/java/org/richfaces/renderkit/RichMessageBaseRenderer.java 2007-11-14 20:42:09 UTC (rev 3998)
+++ trunk/ui/message/src/main/java/org/richfaces/renderkit/RichMessageBaseRenderer.java 2007-11-15 12:30:17 UTC (rev 3999)
@@ -153,7 +153,7 @@
markerClass = (String)uiMsg.getAttributes().get("warnMarkerClass");
markerStyle = (String)uiMsg.getAttributes().get("warnMarkerStyle");
- marker = uiMsg.getFacet("infoMarker");
+ marker = uiMsg.getFacet("warnMarker");
}
18 years, 5 months
JBoss Rich Faces SVN: r3998 - in trunk/sandbox/ui/orderingList/src/main: java/org/richfaces/renderkit/html and 3 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: sergeyhalipov
Date: 2007-11-14 15:42:09 -0500 (Wed, 14 Nov 2007)
New Revision: 3998
Added:
trunk/sandbox/ui/orderingList/src/main/java/org/richfaces/renderkit/html/gradientimages/
trunk/sandbox/ui/orderingList/src/main/java/org/richfaces/renderkit/html/gradientimages/OrderingListClickedGradient.java
trunk/sandbox/ui/orderingList/src/main/java/org/richfaces/renderkit/html/gradientimages/OrderingListHeaderGradient.java
trunk/sandbox/ui/orderingList/src/main/java/org/richfaces/renderkit/html/gradientimages/OrderingListSelectGradient.java
Modified:
trunk/sandbox/ui/orderingList/src/main/java/org/richfaces/renderkit/OrderingListRendererBase.java
trunk/sandbox/ui/orderingList/src/main/java/org/richfaces/renderkit/html/images/OrderingListIconBase.java
trunk/sandbox/ui/orderingList/src/main/resources/org/richfaces/renderkit/html/css/orderingList.xcss
Log:
Gradient images added to ordering list.
Modified: trunk/sandbox/ui/orderingList/src/main/java/org/richfaces/renderkit/OrderingListRendererBase.java
===================================================================
--- trunk/sandbox/ui/orderingList/src/main/java/org/richfaces/renderkit/OrderingListRendererBase.java 2007-11-14 20:22:08 UTC (rev 3997)
+++ trunk/sandbox/ui/orderingList/src/main/java/org/richfaces/renderkit/OrderingListRendererBase.java 2007-11-14 20:42:09 UTC (rev 3998)
@@ -348,6 +348,10 @@
writer.writeAttribute(HTML.class_ATTRIBUTE, "ol_button_border", null);
writer.startElement(HTML.DIV_ELEM, orderingList);
writer.writeAttribute(HTML.class_ATTRIBUTE, "ol_button", null);
+ writer.writeAttribute("onmousedown",
+ "Element.removeClassName(this, 'ol_button'); Element.addClassName(this, 'ol_button_clicked'); ", null);
+ writer.writeAttribute("onmouseup",
+ "Element.removeClassName(this, 'ol_button_clicked'); Element.addClassName(this, 'ol_button'); ", null);
}
if (htmlElem != null) {
Added: trunk/sandbox/ui/orderingList/src/main/java/org/richfaces/renderkit/html/gradientimages/OrderingListClickedGradient.java
===================================================================
--- trunk/sandbox/ui/orderingList/src/main/java/org/richfaces/renderkit/html/gradientimages/OrderingListClickedGradient.java (rev 0)
+++ trunk/sandbox/ui/orderingList/src/main/java/org/richfaces/renderkit/html/gradientimages/OrderingListClickedGradient.java 2007-11-14 20:42:09 UTC (rev 3998)
@@ -0,0 +1,40 @@
+/**
+ * License Agreement.
+ *
+ * JBoss RichFaces - Ajax4jsf Component Library
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+package org.richfaces.renderkit.html.gradientimages;
+
+import java.awt.Graphics2D;
+import java.awt.geom.AffineTransform;
+
+import org.ajax4jsf.resource.ResourceContext;
+
+/**
+ * @author Siarhej Chalipau
+ *
+ */
+public class OrderingListClickedGradient extends OrderingListHeaderGradient {
+ @Override
+ protected void paint(ResourceContext resourceContext, Graphics2D g2d) {
+ g2d.transform(new AffineTransform(1., 0., 0., -1., 0., 18.));
+ super.paint(resourceContext, g2d);
+ }
+
+}
Added: trunk/sandbox/ui/orderingList/src/main/java/org/richfaces/renderkit/html/gradientimages/OrderingListHeaderGradient.java
===================================================================
--- trunk/sandbox/ui/orderingList/src/main/java/org/richfaces/renderkit/html/gradientimages/OrderingListHeaderGradient.java (rev 0)
+++ trunk/sandbox/ui/orderingList/src/main/java/org/richfaces/renderkit/html/gradientimages/OrderingListHeaderGradient.java 2007-11-14 20:42:09 UTC (rev 3998)
@@ -0,0 +1,35 @@
+/**
+ * License Agreement.
+ *
+ * JBoss RichFaces - Ajax4jsf Component Library
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+package org.richfaces.renderkit.html.gradientimages;
+
+import org.richfaces.renderkit.html.BaseGradient;
+import org.richfaces.skin.Skin;
+
+/**
+ * @author Siarhej Chalipau
+ *
+ */
+public class OrderingListHeaderGradient extends BaseGradient {
+ public OrderingListHeaderGradient() {
+ super(8, 18, 9, "headerGradientColor", Skin.headerBackgroundColor);
+ }
+}
Added: trunk/sandbox/ui/orderingList/src/main/java/org/richfaces/renderkit/html/gradientimages/OrderingListSelectGradient.java
===================================================================
--- trunk/sandbox/ui/orderingList/src/main/java/org/richfaces/renderkit/html/gradientimages/OrderingListSelectGradient.java (rev 0)
+++ trunk/sandbox/ui/orderingList/src/main/java/org/richfaces/renderkit/html/gradientimages/OrderingListSelectGradient.java 2007-11-14 20:42:09 UTC (rev 3998)
@@ -0,0 +1,34 @@
+/**
+ * License Agreement.
+ *
+ * JBoss RichFaces - Ajax4jsf Component Library
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+package org.richfaces.renderkit.html.gradientimages;
+
+import org.richfaces.renderkit.html.BaseGradient;
+
+/**
+ * @author Siarhej Chalipau
+ *
+ */
+public class OrderingListSelectGradient extends BaseGradient {
+ public OrderingListSelectGradient() {
+ super(11, 18, "headerGradientColor", "additionalBackgroundColor");
+ }
+}
Modified: trunk/sandbox/ui/orderingList/src/main/java/org/richfaces/renderkit/html/images/OrderingListIconBase.java
===================================================================
--- trunk/sandbox/ui/orderingList/src/main/java/org/richfaces/renderkit/html/images/OrderingListIconBase.java 2007-11-14 20:22:08 UTC (rev 3997)
+++ trunk/sandbox/ui/orderingList/src/main/java/org/richfaces/renderkit/html/images/OrderingListIconBase.java 2007-11-14 20:42:09 UTC (rev 3998)
@@ -72,9 +72,9 @@
g2d.setRenderingHint(RenderingHints.KEY_INTERPOLATION, RenderingHints.VALUE_INTERPOLATION_BICUBIC);
g2d.setRenderingHint(RenderingHints.KEY_RENDERING, RenderingHints.VALUE_RENDER_QUALITY);
- Dimension dim = getDimensions(context);
+ /*Dimension dim = getDimensions(context);
g2d.setColor(backgroundColor);
- g2d.fillRect(0, 0, dim.width, dim.height);
+ g2d.fillRect(0, 0, dim.width, dim.height);*/
Dimension dimension = getDimensions(context);
Modified: trunk/sandbox/ui/orderingList/src/main/resources/org/richfaces/renderkit/html/css/orderingList.xcss
===================================================================
--- trunk/sandbox/ui/orderingList/src/main/resources/org/richfaces/renderkit/html/css/orderingList.xcss 2007-11-14 20:22:08 UTC (rev 3997)
+++ trunk/sandbox/ui/orderingList/src/main/resources/org/richfaces/renderkit/html/css/orderingList.xcss 2007-11-14 20:42:09 UTC (rev 3998)
@@ -40,17 +40,27 @@
height: 18px;
}
-.ol_button_layout {
- padding : 15px 8px 15px 0px;
- vertical-align : top;
+.ol_button {
+ background : repeat scroll left top;
+ border : 1px solid #bfbfc0;
+ margin-bottom : 3px;
+ cursor : pointer;
+ padding : 1px;
}
+.ol_button_clicked {
+ background : repeat scroll left top;
+ border : 1px solid #bfbfc0;
+ margin-bottom : 3px;
+ cursor : pointer;
+ padding : 1px;
+}
+
.ol_button_layout{padding : 15px 8px 15px 0px;}
.ol_button_border{border : 1px solid #bfbfc0; margin-bottom : 3px;}
+
-.ol_button{background : url(ol_images/bg_header.png) top left #C6D6EA repeat-x; cursor : pointer; padding : 2px; font-family : Arial; font-size :11px;}
-
.ol_button_dis {
background : #bfbfc0;
border : 1px solid #bfbfc0;
@@ -66,10 +76,25 @@
}
.ol_internal_header_tab {
+ background : repeat scroll left top;
width : 100%;
}
+<<<<<<< .mine
+.ol_internal_header_tab th {
+ color : #FFFFFF;
+
+ font-family : Arial;
+ font-size :11px;
+ font-weight : normal;
+ border-bottom : 1px solid #bfbfc0;
+ border-right : 1px solid #bfbfc0;
+ padding : 2px;
+ white-space: nowrap;
+}
+=======
.ol_internal_header_tab th{background : url(ol_images/bg_header.png) top left repeat-x #C6D6EA; color : #000000; font-family : Arial; font-size :11px; font-weight : normal; border-bottom : 1px solid #bfbfc0;border-right : 1px solid #bfbfc0;border-left : 1px solid #EAF0F8;border-top : 1px solid #FFFFFF; padding : 2px}
+>>>>>>> .r3997
.ol_internal_header_tab .ol_endcol {
border-right : 0px;
@@ -85,10 +110,20 @@
.ol_internal_tab td{font-family : Arial; font-size :11px; border-bottom : 1px solid #bfbfc0;border-top : 1px solid #FFFFFF; padding : 2px}
+<<<<<<< .mine
+.ol_internal_tab tr.ol_select {
+ background : repeat scroll left top;
+}
+=======
.ol_internal_tab tr.ol_select{background : #EAF0F8}
+>>>>>>> .r3997
.ol_internal_tab tr.ol_active {
+<<<<<<< .mine
+ background : repeat scroll left top;
+=======
background : #EAF0F8; color : #4A75B5;
+>>>>>>> .r3997
}
.ol_internal_tab tr.ol_normal {
@@ -182,4 +217,40 @@
<f:resource f:key="org.richfaces.renderkit.html.images.OrderingListIconBottomDisabled" />
</u:style>
</u:selector>
+
+<u:selector name=".ol_button">
+ <u:style name="background-image">
+ <f:resource f:key="org.richfaces.renderkit.html.gradientimages.OrderingListHeaderGradient" />
+ </u:style>
+ <u:style name="background-color" skin="headerBackgroundColor" />
+</u:selector>
+
+<u:selector name=".ol_button_clicked">
+ <u:style name="background-image">
+ <f:resource f:key="org.richfaces.renderkit.html.gradientimages.OrderingListClickedGradient" />
+ </u:style>
+ <u:style name="background-color" skin="headerBackgroundColor" />
+</u:selector>
+
+<u:selector name=".ol_internal_header_tab th">
+ <u:style name="background-image">
+ <f:resource f:key="org.richfaces.renderkit.html.gradientimages.OrderingListHeaderGradient" />
+ </u:style>
+ <u:style name="background-color" skin="headerBackgroundColor" />
+</u:selector>
+
+<u:selector name=".ol_internal_tab tr.ol_select">
+ <u:style name="background-image">
+ <f:resource f:key="org.richfaces.renderkit.html.gradientimages.OrderingListSelectGradient" />
+ </u:style>
+ <u:style name="background-color" skin="additionalBackgroundColor" />
+</u:selector>
+
+<u:selector name=".ol_internal_tab tr.ol_active">
+ <u:style name="background-image">
+ <f:resource f:key="org.richfaces.renderkit.html.gradientimages.OrderingListSelectGradient" />
+ </u:style>
+ <u:style name="background-color" skin="additionalBackgroundColor" />
+ <u:style name="color" skin="hoverLinkColor" />
+</u:selector>
</f:template>
\ No newline at end of file
18 years, 5 months
JBoss Rich Faces SVN: r3997 - in trunk/sandbox/ui/componentControl/src/main: java/org/richfaces/sandbox/component and 2 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2007-11-14 15:22:08 -0500 (Wed, 14 Nov 2007)
New Revision: 3997
Modified:
trunk/sandbox/ui/componentControl/src/main/java/org/richfaces/renderkit/ComponentControlRendererBase.java
trunk/sandbox/ui/componentControl/src/main/java/org/richfaces/sandbox/component/UIComponentControl.java
trunk/sandbox/ui/componentControl/src/main/resources/org/richfaces/renderkit/html/script/controlUtils.js
trunk/sandbox/ui/componentControl/src/main/templates/htmlComponentControl.jspx
Log:
- componentControl code reviewed
- event parameters added
- parameters encoding added
Modified: trunk/sandbox/ui/componentControl/src/main/java/org/richfaces/renderkit/ComponentControlRendererBase.java
===================================================================
--- trunk/sandbox/ui/componentControl/src/main/java/org/richfaces/renderkit/ComponentControlRendererBase.java 2007-11-14 19:06:26 UTC (rev 3996)
+++ trunk/sandbox/ui/componentControl/src/main/java/org/richfaces/renderkit/ComponentControlRendererBase.java 2007-11-14 20:22:08 UTC (rev 3997)
@@ -4,55 +4,36 @@
import javax.faces.component.UIComponent;
import javax.faces.context.FacesContext;
-import org.ajax4jsf.javascript.JSEncoder;
import org.ajax4jsf.renderkit.HeaderResourcesRendererBase;
-import org.richfaces.sandbox.component.UIComponentControl;
import org.richfaces.component.util.HtmlUtil;
+import org.richfaces.sandbox.component.UIComponentControl;
public class ComponentControlRendererBase extends HeaderResourcesRendererBase {
- protected Class getComponentClass() {
- return UIComponentControl.class;
- }
+ protected Class getComponentClass() {
+ return UIComponentControl.class;
+ }
-
-
protected void checkValidity(String clientId, String name, String attachTiming, String forAttr, String operation) {
-
- if ( ! "onJScall".equals(attachTiming) &&
- ! "onload".equals(attachTiming) &&
+
+ if ( ! "onload".equals(attachTiming) &&
! "immediate".equals(attachTiming) ) {
throw new FacesException(
- "The attachTiming attribute of the controlComponent (id='"+clientId+"') has an invalid value:'"+ attachTiming +
+ "The attachTiming attribute of the controlComponent (id='"+clientId+"') has an invalid value:'"+ attachTiming +
"'. It may have only the following values: 'immediate', 'onload', 'onJScall'");
}
-
- if ( name == null ) {
- throw new FacesException(
- "The name attribute of the controlComponent (id='"+clientId+"') might not be null" );
-
- }
- if ( "".equals(operation.trim()) || operation==null ) {
+ if (operation==null || "".equals(operation.trim())) {
throw new FacesException(
"The operation attribute of the controlComponent (id='"+clientId+"') must be specified" );
}
-
-
- if ( "".equals(name.trim()) && "onJScall".equals(attachTiming) ) {
- throw new FacesException(
- "The name attribute of the controlComponent (id='"+clientId+"') must be specified when timing attribute equals to 'onJScall'" );
- }
-
+
}
+
protected String replaceClientIds(FacesContext context, UIComponent component, String selector) {
return HtmlUtil.expandIdSelector(selector, component, context);
}
-
-
-
-
}
Modified: trunk/sandbox/ui/componentControl/src/main/java/org/richfaces/sandbox/component/UIComponentControl.java
===================================================================
--- trunk/sandbox/ui/componentControl/src/main/java/org/richfaces/sandbox/component/UIComponentControl.java 2007-11-14 19:06:26 UTC (rev 3996)
+++ trunk/sandbox/ui/componentControl/src/main/java/org/richfaces/sandbox/component/UIComponentControl.java 2007-11-14 20:22:08 UTC (rev 3997)
@@ -4,15 +4,22 @@
package org.richfaces.sandbox.component;
-import org.ajax4jsf.Messages;
-import org.ajax4jsf.component.EventValueBinding;
+import java.util.Iterator;
+
+import javax.faces.component.UIComponent;
import javax.faces.component.UIComponentBase;
+import javax.faces.component.UIParameter;
import javax.faces.context.FacesContext;
-import javax.faces.component.UIComponent;
+import javax.faces.el.ValueBinding;
+
+import org.ajax4jsf.Messages;
import org.ajax4jsf.component.AjaxSupport;
+import org.ajax4jsf.component.EventValueBinding;
+import org.ajax4jsf.component.JavaScriptParameter;
+import org.ajax4jsf.javascript.JSReference;
+import org.ajax4jsf.javascript.ScriptUtils;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
-import org.ajax4jsf.renderkit.RendererUtils;
import org.richfaces.component.util.HtmlUtil;
/**
@@ -20,66 +27,109 @@
*
*/
public abstract class UIComponentControl extends UIComponentBase implements AjaxSupport {
-
+
public static final String COMPONENT_TYPE = "org.richfaces.sandbox.ComponentControl";
-
+
public static final String COMPONENT_FAMILY = "org.richfaces.sandbox.ComponentControl";
private static final Log log = LogFactory.getLog(UIComponentControl.class);
-
- /**
- * @return JavaScript eventString. Rebuild on every call, since
- * can be in loop ( as in dataTable ) with different parameters.
- */
- public String getEventString()
- {
- StringBuffer buildOnEvent = new StringBuffer();
-
- String targetId="#" + getFor();
+ /**
+ * @return JavaScript eventString. Rebuild on every call, since
+ * can be in loop ( as in dataTable ) with different parameters.
+ */
+ public String getEventString()
+ {
+ StringBuffer buildOnEvent = new StringBuffer();
+
+ String targetId="#" + getFor();
+
targetId=HtmlUtil.expandIdSelector(targetId, this, FacesContext.getCurrentInstance());
- buildOnEvent.append("Richfaces.componentControl.performOperation( null,");
- buildOnEvent.append("'" + targetId + "',");
- buildOnEvent.append("'" + getOperation() + "',");
- buildOnEvent.append("{" + getParams() + "});");
-
- return buildOnEvent.toString();
+ buildOnEvent.append("Richfaces.componentControl.performOperation(event, ");
+ buildOnEvent.append("'" + targetId + "',");
+ buildOnEvent.append("'" + getOperation() + "',");
+ buildOnEvent.append("{" + getEncodedParametersMap() + "});");
+ return buildOnEvent.toString();
- }
-
-
- public abstract String getEvent();
- public abstract void setEvent(String event);
- public abstract String getFor();
- public abstract void setFor(String value);
+ }
- public abstract String getParams();
- public abstract void setParams(String value);
+ public String getEncodedParametersMap() {
+ StringBuffer result = new StringBuffer();
+
+ boolean shouldClose = false;
- public abstract String getOperation();
- public abstract void setOperation(String value);
+ String params = this.getParams();
+ if (params != null && params.trim().length() != 0) {
+ result.append(params);
+ shouldClose = true;
+ }
+
+ for (Iterator it = this.getChildren().iterator(); it.hasNext();) {
+ UIComponent child = (UIComponent) it.next();
+ if (child instanceof UIParameter) {
+ String name = ((UIParameter) child).getName();
+ Object value = ((UIParameter) child).getValue();
+ if (null == name) {
+ FacesContext context = FacesContext.getCurrentInstance();
+ throw new IllegalArgumentException(Messages.getMessage(
+ Messages.UNNAMED_PARAMETER_ERROR, this
+ .getClientId(context)));
+ }
+
+ boolean escape = true;
+ if (child instanceof JavaScriptParameter) {
+ JavaScriptParameter actionParam = (JavaScriptParameter) child;
+ escape = !actionParam.isNoEscape();
+ }
+
+ if (shouldClose) {
+ result.append(", ");
+ }
- public abstract String getAttachTo();
- public abstract void setAttachTo(String value);
-
+ ScriptUtils.addEncodedString(result, name);
+ result.append(": ");
+ result.append(ScriptUtils.toScript(escape ? value : new JSReference(value.toString())));
+
+ shouldClose = true;
+ }
+ }
+
+ return result.toString();
+ }
+
+ public abstract String getEvent();
+ public abstract void setEvent(String event);
+
+ public abstract String getFor();
+ public abstract void setFor(String value);
+
+ public abstract String getParams();
+ public abstract void setParams(String value);
+
+ public abstract String getOperation();
+ public abstract void setOperation(String value);
+
+ public abstract String getAttachTo();
+ public abstract void setAttachTo(String value);
+
protected String replaceClientIds(FacesContext context, UIComponent component, String selector) {
return HtmlUtil.expandIdSelector(selector, component, context);
}
-
- /**
- * After nornal setting <code>parent</code> property in case of
- * created component set Ajax properties for parent.
- * @see javax.faces.component.UIComponentBase#setParent(javax.faces.component.UIComponent)
- */
- public void setParent(UIComponent parent)
- {
- super.setParent(parent);
- if (null != parent && parent.getFamily() != null ) {
+
+ /**
+ * After nornal setting <code>parent</code> property in case of
+ * created component set Ajax properties for parent.
+ * @see javax.faces.component.UIComponentBase#setParent(javax.faces.component.UIComponent)
+ */
+ public void setParent(UIComponent parent)
+ {
+ super.setParent(parent);
+ if (null != parent && parent.getFamily() != null ) {
if (log.isDebugEnabled()) {
log.debug(Messages.getMessage(Messages.CALLED_SET_PARENT, parent.getClass().getName()));
}
@@ -96,14 +146,24 @@
}
}
- }
+ }
- public void setParentProperties(UIComponent parent){
- if (getAttachTo() == "" && getEvent() !="" ) {
- parent.setValueBinding(getEvent(), new EventValueBinding(this));
+ public void setParentProperties(UIComponent parent){
+ String event = getEvent();
+ String attachTo = getAttachTo();
+
+ if (event != null && event.length() != 0) {
+ if (attachTo == null || attachTo.length() == 0) {
+ parent.setValueBinding(event, new EventValueBinding(this));
+ } else {
+ ValueBinding vb = parent.getValueBinding(event);
+ if (vb instanceof EventValueBinding) {
+ //TODO check if that's EventValueBinding for us
+ parent.setValueBinding(event, null);
+ }
+ }
+ }
}
- }
-
}
Modified: trunk/sandbox/ui/componentControl/src/main/resources/org/richfaces/renderkit/html/script/controlUtils.js
===================================================================
--- trunk/sandbox/ui/componentControl/src/main/resources/org/richfaces/renderkit/html/script/controlUtils.js 2007-11-14 19:06:26 UTC (rev 3996)
+++ trunk/sandbox/ui/componentControl/src/main/resources/org/richfaces/renderkit/html/script/controlUtils.js 2007-11-14 20:22:08 UTC (rev 3997)
@@ -6,8 +6,8 @@
Richfaces.componentControl = {};
}
-Richfaces.componentControl.attachEvent = function(attachTo, cevent, aevent, forAttr, operation, params) {
- jQuery(attachTo).bind(Richfaces.effectEventOnOut(aevent), function() {
+Richfaces.componentControl.attachEvent = function(attachTo, aevent, forAttr, operation, params) {
+ jQuery(attachTo).bind(Richfaces.effectEventOnOut(aevent), function(cevent) {
jQuery( forAttr)[0].component[operation](cevent, params);
});
};
Modified: trunk/sandbox/ui/componentControl/src/main/templates/htmlComponentControl.jspx
===================================================================
--- trunk/sandbox/ui/componentControl/src/main/templates/htmlComponentControl.jspx 2007-11-14 19:06:26 UTC (rev 3996)
+++ trunk/sandbox/ui/componentControl/src/main/templates/htmlComponentControl.jspx 2007-11-14 20:22:08 UTC (rev 3997)
@@ -17,7 +17,7 @@
<c:set var="attachTo" value="#{component.attributes['attachTo']}"/>
<c:set var="name" value="#{component.attributes['name']}"/>
<c:set var="operation" value="#{component.attributes['operation']}"/>
- <c:set var="params" value="#{component.attributes['params']}"/>
+ <c:set var="params" value="#{component.encodedParametersMap}"/>
<f:clientid var="clientId"/>
@@ -39,9 +39,9 @@
<jsp:scriptlet><![CDATA[ if (! "".equals(name.trim()) ) { ]]></jsp:scriptlet>
<script type="text/javascript">
//<![CDATA[
-function #{name}() {
+function #{name}(cevent) {
Richfaces.componentControl.performOperation(
- null, '#{forAttr}', '#{operation}', {#{params}} );
+ cevent, '#{forAttr}', '#{operation}', {#{params}} );
}
//]]>
</script>
@@ -54,7 +54,7 @@
{
Richfaces.componentControl.attachEvent(
- '#{attachTo}', null, '#{event}', '#{forAttr}', '#{operation}', {#{params}} );
+ '#{attachTo}', '#{event}', '#{forAttr}', '#{operation}', {#{params}} );
}
//]]>
@@ -68,7 +68,7 @@
//<![CDATA[
jQuery(document).ready(function() {
Richfaces.componentControl.attachEvent(
- '#{attachTo}', null, '#{event}', '#{forAttr}', '#{operation}', {#{params}} );
+ '#{attachTo}', '#{event}', '#{forAttr}', '#{operation}', {#{params}} );
});
//]]>
18 years, 5 months