JBoss Rich Faces SVN: r21015 - in modules/docs/trunk/Component_Reference/src/main/docbook/en-US: images and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: SeanRogers
Date: 2011-01-14 00:53:15 -0500 (Fri, 14 Jan 2011)
New Revision: 21015
Added:
modules/docs/trunk/Component_Reference/src/main/docbook/en-US/images/figu-Component_Reference-richdataScroller-The_richdataScroller_component.png
Modified:
modules/docs/trunk/Component_Reference/src/main/docbook/en-US/chap-Component_Reference-Tables_and_grids.xml
Log:
Draft of dataScroller
Modified: modules/docs/trunk/Component_Reference/src/main/docbook/en-US/chap-Component_Reference-Tables_and_grids.xml
===================================================================
--- modules/docs/trunk/Component_Reference/src/main/docbook/en-US/chap-Component_Reference-Tables_and_grids.xml 2011-01-14 02:24:51 UTC (rev 21014)
+++ modules/docs/trunk/Component_Reference/src/main/docbook/en-US/chap-Component_Reference-Tables_and_grids.xml 2011-01-14 05:53:15 UTC (rev 21015)
@@ -593,42 +593,74 @@
</section>
</section>
- <!-- TODO not in M2 -->
- <!--
+ <!--<rich:dataScroller>-->
<section id="sect-Component_Reference-Tables_and_grids-richdataScroller">
<title><sgmltag><rich:dataScroller></sgmltag></title>
- <itemizedlist>
- <listitem>
- <para>
- <parameter>component-type</parameter>: <classname>org.richfaces.DataTable</classname>
- </para>
- </listitem>
- <listitem>
- <para>
- <parameter>component-class</parameter>: <classname>org.richfaces.component.html.HtmlDataTable</classname>
- </para>
- </listitem>
- <listitem>
- <para>
- <parameter>component-family</parameter>: <classname>org.richfaces.DataTable</classname>
- </para>
- </listitem>
- <listitem>
- <para>
- <parameter>renderer-type</parameter>: <classname>org.richfaces.DataTableRenderer</classname>
- </para>
- </listitem>
- <listitem>
- <para>
- <parameter>tag-class</parameter>: <classname>org.richfaces.taglib.DataTableTag</classname>
- </para>
- </listitem>
- </itemizedlist>
<para>
- Incomplete
+ The <sgmltag><rich:dataScroller></sgmltag> component is used for navigating through multiple pages of tables or grids.
</para>
+ <figure id="figu-Component_Reference-richdataScroller-The_richdataScroller_component">
+ <title>The <sgmltag><rich:dataScroller></sgmltag> component</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/figu-Component_Reference-richdataScroller-The_richdataScroller_component.png" format="PNG" />
+ </imageobject>
+ <textobject>
+ <para>
+ A <sgmltag><rich:dataTable></sgmltag> component with a <sgmltag><rich:dataScroller></sgmltag> component contained in the <literal>footer</literal> facet.
+ </para>
+ </textobject>
+ </mediaobject>
+ </figure>
+
+ <section id="sect-Component_Reference-richdataScroller-Basic_usage">
+ <title>Basic usage</title>
+ <para>
+ The <sgmltag><rich:dataScroller></sgmltag> must be placed in the <literal>footer</literal> facet of the table or grid it needs to control. Alternatively, use the <varname>for</varname> attribute to bind the parent table or grid to the scroller.
+ </para>
+ <para>
+ The bound table or grid should also have the <varname>rows</varname> attribute defined to limit the number of rows per page.
+ </para>
+ </section>
+
+ <section id="sect-Component_Reference-richdataScroller-Appearance">
+ <title>Appearance</title>
+ <para>
+ The <sgmltag><rich:dataScroller></sgmltag> must be placed in the footer of the table or grid it needs to control. Alternatively, use the <varname>for</varname> attribute to bind the parent table or grid to the scroller.
+ </para>
+ </section>
+
+ <section id="sect-Component_Reference-richdataScroller-Reference_data">
+ <title>Reference data</title>
+ <itemizedlist>
+ <listitem>
+ <para>
+ <parameter>component-type</parameter>: <classname>org.richfaces.DataScroller</classname>
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <parameter>component-class</parameter>: <classname>org.richfaces.component.html.HtmlDataScroller</classname>
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <parameter>component-family</parameter>: <classname>org.richfaces.DataScroller</classname>
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <parameter>renderer-type</parameter>: <classname>org.richfaces.DataScrollerRenderer</classname>
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <parameter>tag-class</parameter>: <classname>org.richfaces.taglib.DataScrollerTag</classname>
+ </para>
+ </listitem>
+ </itemizedlist>
+ </section>
</section>
- -->
<!--<rich:dataTable>-->
<section id="sect-Component_Reference-Tables_and_grids-richdataTable">
Added: modules/docs/trunk/Component_Reference/src/main/docbook/en-US/images/figu-Component_Reference-richdataScroller-The_richdataScroller_component.png
===================================================================
(Binary files differ)
Property changes on: modules/docs/trunk/Component_Reference/src/main/docbook/en-US/images/figu-Component_Reference-richdataScroller-The_richdataScroller_component.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
13 years, 11 months
JBoss Rich Faces SVN: r21014 - modules/docs/trunk/Component_Reference/src/main/docbook/en-US.
by richfaces-svn-commits@lists.jboss.org
Author: SeanRogers
Date: 2011-01-13 21:24:51 -0500 (Thu, 13 Jan 2011)
New Revision: 21014
Modified:
modules/docs/trunk/Component_Reference/src/main/docbook/en-US/chap-Component_Reference-Menus_and_toolbars.xml
Log:
Revised dropdownmenu based on review RFPL-973
Modified: modules/docs/trunk/Component_Reference/src/main/docbook/en-US/chap-Component_Reference-Menus_and_toolbars.xml
===================================================================
--- modules/docs/trunk/Component_Reference/src/main/docbook/en-US/chap-Component_Reference-Menus_and_toolbars.xml 2011-01-14 01:03:54 UTC (rev 21013)
+++ modules/docs/trunk/Component_Reference/src/main/docbook/en-US/chap-Component_Reference-Menus_and_toolbars.xml 2011-01-14 02:24:51 UTC (rev 21014)
@@ -48,10 +48,10 @@
<section id="sect-Component_Reference-richdropDownMenu-Basic_usage">
<title>Basic usage</title>
<para>
- The <sgmltag><rich:dropDownMenu></sgmltag> component only requires the <varname>value</varname> attribute for basic usage. Use the <varname>value</varname> attribute to define the text label that appears as the title of the menu. Clicking on the title drops the menu down.
+ The <sgmltag><rich:dropDownMenu></sgmltag> component only requires the <varname>label</varname> attribute for basic usage. Use the <varname>label</varname> attribute to define the text label that appears as the title of the menu. Clicking on the title drops the menu down.
</para>
<para>
- Alternatively, use the <literal>label</literal> facet to define the menu title. If the <literal>label</literal> facet is used, the <varname>value</varname> attribute is not necessary.
+ Alternatively, use the <literal>label</literal> facet to define the menu title. If the <literal>label</literal> facet is used, the <varname>label</varname> attribute is not necessary.
</para>
</section>
@@ -62,23 +62,86 @@
</para>
</section>
- <!-- TODO not in M5 -->
- <!--
<section id="sect-Component_Reference-richdropDownMenu-Appearance">
<title>Appearance</title>
<para>
- To determine the direction and location of the menu when it appears, use the <varname>direction</varname> and <varname>jointPoint</varname> attributes.
+ Use the <varname>jointPoint</varname> and <varname>direction</varname> attributes to determine the direction and location of the menu when it appears. The <varname>jointPoint</varname> and <varname>direction</varname> attributes both use the following settings:
</para>
-
+ <variablelist>
+ <varlistentry>
+ <term><literal>topLeft</literal></term>
+ <term><literal>topRight</literal></term>
+ <term><literal>bottomLeft</literal></term>
+ <term><literal>bottomRight</literal></term>
+ <listitem>
+ <para>
+ When used with the <varname>jointPoint</varname> attribute, the menu is attached to the top-left, top-right, bottom-left, or bottom-right of the control as appropriate.
+ </para>
+ <para>
+ When used with the <varname>direction</varname> attribute, the menu appears to the top-left, top-right, bottom-left, or bottom-right of the joint location as appropriate.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><literal>auto</literal></term>
+ <listitem>
+ <para>
+ The direction or joint location is determined automatically.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><literal>autoLeft</literal></term>
+ <term><literal>autoRight</literal></term>
+ <term><literal>autoTop</literal></term>
+ <term><literal>autoBottom</literal></term>
+ <listitem>
+ <para>
+ When used with the <varname>jointPoint</varname> attribute, the joint location is determined automatically, but defaults to either the left, right, top, or bottom of the control as appropriate.
+ </para>
+ <para>
+ When used with the <varname>direction</varname> attribute, the menu direction is determined automatically, but defaults to either the left, right, top, or bottom of the joint location as appropriate.
+ </para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
</section>
- -->
<section id="sect-Component_Reference-richdropDownMenu-Expanding_and_collapsing_the_menu">
<title>Expanding and collapsing the menu</title>
<para>
- By default, the menu drops down when the title is clicked. To drop down with a different event, use the <varname>event</varname> attribute to define the event instead.
+ By default, the menu drops down when the title is clicked. To drop down with a different event, use the <varname>eventShow</varname> attribute to define the event instead.
</para>
<para>
+ Menus can be navigated using the keyboard. Additionally, menus can be navigated programmatically using the JavaScript <acronym>API</acronym>. The JavaScript API allows the following methods:
+ </para>
+ <variablelist>
+ <varlistentry>
+ <term><methodname>show()</methodname></term>
+ <listitem>
+ <para>
+ The <methodname>show()</methodname> method shows the menu.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><methodname>hide()</methodname></term>
+ <listitem>
+ <para>
+ The <methodname>hide()</methodname> method hides the menu.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><methodname>activateItem(menuItemId)</methodname></term>
+ <listitem>
+ <para>
+ The <methodname>activateItem(menuItemId)</methodname> activates the menu item with the <parameter>menuItemId</parameter> identifier.
+ </para>
+ </listitem>
+ </varlistentry>
+ </variablelistentry>
+ <para>
Use the <varname>mode</varname> attribute to determine how the menu requests are submitted:
</para>
<itemizedlist>
@@ -94,7 +157,7 @@
</listitem>
<listitem>
<para>
- <literal>client</literal> causes the <varname>action</varname> and <varname>actionListener</varname> items to be ignored, and the behavior is fully defined by the nested components instead of responses from submissions.
+ <literal>client</literal> causes the <varname>action</varname> and <varname>actionListener</varname> items to be ignored, and the behavior is fully defined by the nested components or custom JavaScript instead of responses from submissions.
</para>
</listitem>
</itemizedlist>
@@ -142,13 +205,13 @@
<section id="sect-Component_Reference-Menus_and_toolbars-richmenuItem">
<title><sgmltag><rich:menuItem></sgmltag></title>
<para>
- The <sgmltag><rich:menuItem></sgmltag> component represents a single item in a menu control.
+ The <sgmltag><rich:menuItem></sgmltag> component represents a single item in a menu control. The <sgmltag><rich:menuItem></sgmltag> component can be also be used as a seperate component without a parent menu component, such as on a toolbar.
</para>
<section id="sect-Component_Reference-richmenuItem-Basic_usage">
<title>Basic usage</title>
<para>
- The <sgmltag><rich:menuItem></sgmltag> component requires the <varname>value</varname> attribute for basic usage. The <varname>value</varname> attribute is the text label for the menu item.
+ The <sgmltag><rich:menuItem></sgmltag> component requires the <varname>label</varname> attribute for basic usage. The <varname>label</varname> attribute is the text label for the menu item.
</para>
</section>
@@ -247,8 +310,12 @@
<para>
Alternatively, define facets with the names <literal>icon</literal> and <literal>iconDisabled</literal> to set the icons. If facets are defined, the <varname>icon</varname> and <varname>iconDisabled</varname> attributes are ignored.
</para>
+ <para>
+ The <sgmltag><rich:menuGroup></sgmltag> component can be positioned using the <varname>jointPoint</varname> and <varname>direction</varname> attributes, the same as the parent menu control. For details on the <varname>jointPoint</varname> and <varname>direction</varname> attributes, refer to <xref linkend="sect-Component_Reference-richdropDownMenu-Appearance"/>.
+ </para>
</section>
+ <!--
<section id="sect-Component_Reference-richmenuGroup-Submission_modes">
<title>Submission modes</title>
<para>
@@ -272,6 +339,7 @@
</listitem>
</itemizedlist>
</section>
+ -->
<section id="sect-Component_Reference-richmenuGroup-Reference_data">
<title>Reference data</title>
13 years, 11 months
JBoss Rich Faces SVN: r21013 - in branches/RF-9797: ui/validator/ui/src/main/java/org/richfaces/renderkit/html and 1 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: alexsmirnov
Date: 2011-01-13 20:03:54 -0500 (Thu, 13 Jan 2011)
New Revision: 21013
Modified:
branches/RF-9797/examples/validator-demo/pom.xml
branches/RF-9797/ui/validator/ui/src/main/java/org/richfaces/renderkit/html/ClientAndAjaxScript.java
branches/RF-9797/ui/validator/ui/src/main/java/org/richfaces/renderkit/html/ClientOnlyScript.java
branches/RF-9797/ui/validator/ui/src/main/java/org/richfaces/renderkit/html/ClientValidatorRenderer.java
branches/RF-9797/ui/validator/ui/src/main/java/org/richfaces/renderkit/html/LibraryScriptFunction.java
branches/RF-9797/ui/validator/ui/src/main/java/org/richfaces/renderkit/html/ValidatorScriptBase.java
branches/RF-9797/ui/validator/ui/src/test/java/org/richfaces/renderkit/html/RendererGetClientSideScriptTest.java
branches/RF-9797/ui/validator/ui/src/test/java/org/richfaces/renderkit/html/RendererGetComponentScriptTest.java
Log:
CODING IN PROGRESS - issue RF-9797: CSV: make client code compatible with the current wiki document
https://issues.jboss.org/browse/RF-9797
Modified: branches/RF-9797/examples/validator-demo/pom.xml
===================================================================
--- branches/RF-9797/examples/validator-demo/pom.xml 2011-01-13 20:32:21 UTC (rev 21012)
+++ branches/RF-9797/examples/validator-demo/pom.xml 2011-01-14 01:03:54 UTC (rev 21013)
@@ -60,5 +60,20 @@
<groupId>javax.validation</groupId>
<artifactId>validation-api</artifactId>
</dependency>
+ <dependency>
+ <groupId>org.hibernate</groupId>
+ <artifactId>hibernate-validator</artifactId>
+ <version>4.0.0.GA</version>
+ </dependency>
+ <dependency>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-api</artifactId>
+ <version>1.5.11</version>
+ </dependency>
+ <dependency>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-simple</artifactId>
+ <version>1.5.11</version>
+ </dependency>
</dependencies>
</project>
Modified: branches/RF-9797/ui/validator/ui/src/main/java/org/richfaces/renderkit/html/ClientAndAjaxScript.java
===================================================================
--- branches/RF-9797/ui/validator/ui/src/main/java/org/richfaces/renderkit/html/ClientAndAjaxScript.java 2011-01-13 20:32:21 UTC (rev 21012)
+++ branches/RF-9797/ui/validator/ui/src/main/java/org/richfaces/renderkit/html/ClientAndAjaxScript.java 2011-01-14 01:03:54 UTC (rev 21013)
@@ -2,7 +2,6 @@
import java.util.Collection;
-import org.ajax4jsf.javascript.ScriptWithDependencies;
import org.richfaces.resource.ResourceKey;
import com.google.common.collect.Iterables;
@@ -14,8 +13,8 @@
final String ajaxScript;
- public ClientAndAjaxScript(ScriptWithDependencies clientSideConverterScript,
- Collection<? extends ScriptWithDependencies> validatorScripts, String ajaxScript) {
+ public ClientAndAjaxScript(LibraryScriptFunction clientSideConverterScript,
+ Collection<? extends LibraryScriptFunction> validatorScripts, String ajaxScript) {
super(clientSideConverterScript,validatorScripts);
this.ajaxScript = ajaxScript;
}
Modified: branches/RF-9797/ui/validator/ui/src/main/java/org/richfaces/renderkit/html/ClientOnlyScript.java
===================================================================
--- branches/RF-9797/ui/validator/ui/src/main/java/org/richfaces/renderkit/html/ClientOnlyScript.java 2011-01-13 20:32:21 UTC (rev 21012)
+++ branches/RF-9797/ui/validator/ui/src/main/java/org/richfaces/renderkit/html/ClientOnlyScript.java 2011-01-14 01:03:54 UTC (rev 21013)
@@ -5,36 +5,34 @@
import org.ajax4jsf.javascript.JSFunction;
import org.ajax4jsf.javascript.JSReference;
-import org.ajax4jsf.javascript.ScriptWithDependencies;
import org.richfaces.resource.ResourceKey;
+import com.google.common.collect.ImmutableSet;
import com.google.common.collect.Iterables;
import com.google.common.collect.Sets;
public class ClientOnlyScript extends ValidatorScriptBase {
- protected final ScriptWithDependencies converter;
- protected final Collection<? extends ScriptWithDependencies> validators;
+ protected final LibraryScriptFunction converter;
+ protected final Collection<? extends LibraryScriptFunction> validators;
+ private final ImmutableSet<ResourceKey> resources;
- public ClientOnlyScript(ScriptWithDependencies clientSideConverterScript,
- Collection<? extends ScriptWithDependencies> validatorScripts) {
+ public ClientOnlyScript(LibraryScriptFunction clientSideConverterScript,
+ Collection<? extends LibraryScriptFunction> validatorScripts) {
super();
- if(null==clientSideConverterScript){
- this.converter = NULL_CONVERTER_SCRIPT;
- } else {
- this.converter = clientSideConverterScript;
- }
+ this.converter = clientSideConverterScript;
this.validators = validatorScripts;
-
+ LinkedHashSet<ResourceKey> resources = Sets.newLinkedHashSet();
+ if (null != converter) {
+ Iterables.addAll(resources, converter.getResources());
+ }
+ for (LibraryScriptFunction scriptString : validators) {
+ Iterables.addAll(resources, scriptString.getResources());
+ }
+ this.resources = ImmutableSet.copyOf(resources);
}
public Iterable<ResourceKey> getResources() {
- // TODO - make immutable.
- LinkedHashSet<ResourceKey> resources = Sets.newLinkedHashSet();
- Iterables.addAll(resources,converter.getResources());
- for (ScriptWithDependencies scriptString : validators) {
- Iterables.addAll(resources,scriptString.getResources());
- }
return resources;
}
@@ -42,33 +40,19 @@
protected Object buildBody() {
StringBuilder body = new StringBuilder();
// Get component value by clientId.
- /*body.append("var ").append(ClientValidatorRenderer.VALUE_VAR).append("=");
- GET_VALUE_FUNCTION.appendScriptToStringBuilder(body);
- body.append(EOL);
- // Try client-side validation
- body.append("try {\n");
- // convert value
- body.append("var ").append(ClientValidatorRenderer.CONVERTED_VALUE_VAR).append("=");
- converter.appendScriptToStringBuilder(body);
- body.append(EOL);
- // call validators
- for (ScriptWithDependencies validatorScript : validators) {
- validatorScript.appendScriptToStringBuilder(body);
- body.append(EOL);
- }
- finishValidation(body);
- body.append("return true;\n");
- // Catch errors
- body.append("} catch(e) {\n");
- SEND_ERROR_FUNCTION.appendScriptToStringBuilder(body);body.append(EOL);
- body.append("return false;\n}");*/
- JSFunction callValidator = new JSFunction("RichFaces.csv.validate",
- new JSReference("event"),
- new JSReference("id"),
- new JSReference("element"),
- new JSReference("c"),
- new JSReference("v"),
- new JSReference("p"));
+ /*
+ * body.append("var ").append(ClientValidatorRenderer.VALUE_VAR).append("=");
+ * GET_VALUE_FUNCTION.appendScriptToStringBuilder(body); body.append(EOL); // Try client-side validation
+ * body.append("try {\n"); // convert value
+ * body.append("var ").append(ClientValidatorRenderer.CONVERTED_VALUE_VAR).append("=");
+ * converter.appendScriptToStringBuilder(body); body.append(EOL); // call validators for (ScriptWithDependencies
+ * validatorScript : validators) { validatorScript.appendScriptToStringBuilder(body); body.append(EOL); }
+ * finishValidation(body); body.append("return true;\n"); // Catch errors body.append("} catch(e) {\n");
+ * SEND_ERROR_FUNCTION.appendScriptToStringBuilder(body);body.append(EOL); body.append("return false;\n}");
+ */
+ JSFunction callValidator =
+ new JSFunction("RichFaces.csv.validate", new JSReference("event"), new JSReference("id"), new JSReference(
+ "element"), new JSReference("c"), new JSReference("v"), new JSReference("p"));
body.append(callValidator);
return body;
}
@@ -80,7 +64,9 @@
body.append(EOL).append("}\n");
}
- /* (non-Javadoc)
+ /*
+ * (non-Javadoc)
+ *
* @see java.lang.Object#hashCode()
*/
@Override
@@ -92,7 +78,9 @@
return result;
}
- /* (non-Javadoc)
+ /*
+ * (non-Javadoc)
+ *
* @see java.lang.Object#equals(java.lang.Object)
*/
@Override
@@ -124,5 +112,4 @@
return true;
}
-
}
Modified: branches/RF-9797/ui/validator/ui/src/main/java/org/richfaces/renderkit/html/ClientValidatorRenderer.java
===================================================================
--- branches/RF-9797/ui/validator/ui/src/main/java/org/richfaces/renderkit/html/ClientValidatorRenderer.java 2011-01-13 20:32:21 UTC (rev 21012)
+++ branches/RF-9797/ui/validator/ui/src/main/java/org/richfaces/renderkit/html/ClientValidatorRenderer.java 2011-01-14 01:03:54 UTC (rev 21013)
@@ -19,7 +19,6 @@
import org.ajax4jsf.javascript.JSReference;
import org.ajax4jsf.javascript.ScriptUtils;
-import org.ajax4jsf.javascript.ScriptWithDependencies;
import org.richfaces.application.ServiceTracker;
import org.richfaces.component.behavior.ClientValidatorBehavior;
import org.richfaces.component.behavior.ConverterNotFoundException;
@@ -38,7 +37,6 @@
*/
public class ClientValidatorRenderer extends ClientBehaviorRenderer {
-
public static final String RENDERER_TYPE = "org.richfaces.ClientValidatorRenderer";
public static final String VALUE_VAR = "value";
@@ -80,48 +78,46 @@
throw new IllegalArgumentException(
"Instance of org.ruchvaces.component.behaviot.ClientValidatorBehavior required: " + behavior);
}
- ClientValidatorBehavior ajaxBehavior = (ClientValidatorBehavior)behavior;
+ ClientValidatorBehavior ajaxBehavior = (ClientValidatorBehavior) behavior;
// First things first - if AjaxBehavior is disabled, we are done.
if (!ajaxBehavior.isDisabled()) {
component.queueEvent(createEvent(component, ajaxBehavior));
- }
+ }
}
// Creates an AjaxBehaviorEvent for the specified component/behavior
- private static AjaxBehaviorEvent createEvent(UIComponent component,
- ClientValidatorBehavior ajaxBehavior) {
+ private static AjaxBehaviorEvent createEvent(UIComponent component, ClientValidatorBehavior ajaxBehavior) {
AjaxBehaviorEvent event = new AjaxBehaviorEvent(component, ajaxBehavior);
- PhaseId phaseId = isImmediate(component, ajaxBehavior) ?
- PhaseId.APPLY_REQUEST_VALUES :
- PhaseId.PROCESS_VALIDATIONS;
+ PhaseId phaseId =
+ isImmediate(component, ajaxBehavior) ? PhaseId.APPLY_REQUEST_VALUES : PhaseId.PROCESS_VALIDATIONS;
event.setPhaseId(phaseId);
return event;
}
-
- // Tests whether we should perform immediate processing. Note
+ // Tests whether we should perform immediate processing. Note
// that we "inherit" immediate from the parent if not specified
// on the behavior.
- private static boolean isImmediate(UIComponent component,
- ClientValidatorBehavior ajaxBehavior) {
+ private static boolean isImmediate(UIComponent component, ClientValidatorBehavior ajaxBehavior) {
boolean immediate = false;
if (ajaxBehavior.isImmediateSet()) {
immediate = ajaxBehavior.isImmediate();
} else if (component instanceof EditableValueHolder) {
- immediate = ((EditableValueHolder)component).isImmediate();
+ immediate = ((EditableValueHolder) component).isImmediate();
} else if (component instanceof ActionSource) {
- immediate = ((ActionSource)component).isImmediate();
+ immediate = ((ActionSource) component).isImmediate();
}
return immediate;
- } /**
+ }
+
+ /**
* <p class="changed_added_4_0">
* This method builds client-side validation script and stores it in View resource component
* </p>
@@ -136,14 +132,13 @@
FacesContext facesContext = behaviorContext.getFacesContext();
JavaScriptService javaScriptService = ServiceTracker.getService(JavaScriptService.class);
validatorScript = javaScriptService.addScript(facesContext, validatorScript);
- return validatorScript.createCallScript(behaviorContext.getComponent().getClientId(facesContext),behaviorContext.getSourceId());
+ return validatorScript.createCallScript(behaviorContext.getComponent().getClientId(facesContext),
+ behaviorContext.getSourceId());
} else {
return null;
}
}
-
-
ComponentValidatorScript createValidatorScript(ClientBehaviorContext behaviorContext,
ClientValidatorBehavior behavior) {
ValidatorScriptBase validatorScript;
@@ -153,9 +148,10 @@
ConverterDescriptor converter = behavior.getConverter(behaviorContext);
if (null != converter) {
try {
- ScriptWithDependencies clientSideConverterScript =
+ LibraryScriptFunction clientSideConverterScript =
getClientSideConverterScript(behaviorContext.getFacesContext(), converter);
- validatorScript = createValidatorScript(behaviorContext, behavior, validators, clientSideConverterScript);
+ validatorScript =
+ createValidatorScript(behaviorContext, behavior, validators, clientSideConverterScript);
} catch (ScriptNotFoundException e) {
// ajax-only validation
validatorScript = new AjaxOnlyScript(createAjaxScript(behaviorContext, behavior));
@@ -167,7 +163,7 @@
throw new FacesException(e);
}
String clientId = getComponentClientId(behaviorContext);
- String name = ScriptUtils.getValidJavascriptName(clientId+":v");
+ String name = ScriptUtils.getValidJavascriptName(clientId + ":v");
validatorScript.setName(name);
return validatorScript;
} else {
@@ -182,13 +178,14 @@
private ValidatorScriptBase createValidatorScript(ClientBehaviorContext behaviorContext,
ClientValidatorBehavior behavior, Collection<ValidatorDescriptor> validators,
- ScriptWithDependencies clientSideConverterScript) {
- Collection<? extends ScriptWithDependencies> validatorScripts = getClientSideValidatorScript(behaviorContext.getFacesContext(), validators);
+ LibraryScriptFunction clientSideConverterScript) {
+ Collection<? extends LibraryScriptFunction> validatorScripts =
+ getClientSideValidatorScript(behaviorContext.getFacesContext(), validators);
if (validatorScripts.isEmpty()) {
return new AjaxOnlyScript(createAjaxScript(behaviorContext, behavior));
} else if (validatorScripts.size() < validators.size()) {
- return new ClientAndAjaxScript(clientSideConverterScript, validatorScripts,
- createAjaxScript(behaviorContext, behavior));
+ return new ClientAndAjaxScript(clientSideConverterScript, validatorScripts, createAjaxScript(
+ behaviorContext, behavior));
} else {
return new ClientOnlyScript(clientSideConverterScript, validatorScripts);
}
@@ -196,19 +193,19 @@
private String createAjaxScript(ClientBehaviorContext behaviorContext, ClientValidatorBehavior behavior) {
String ajaxScript = behavior.getAjaxScript(behaviorContext);
- ajaxScript=ajaxScript.replace("this", ValidatorScriptBase.ELEMENT);
+ ajaxScript = ajaxScript.replace("this", ValidatorScriptBase.ELEMENT);
String clientId = getComponentClientId(behaviorContext);
ajaxScript = replaceTextToVariable(ajaxScript, clientId, ValidatorScriptBase.CLIENT_ID);
String sourceId = behaviorContext.getSourceId();
- if(null != sourceId){
+ if (null != sourceId) {
ajaxScript = replaceTextToVariable(ajaxScript, sourceId, ValidatorScriptBase.ELEMENT);
}
return ajaxScript;
}
private String replaceTextToVariable(String ajaxScript, String clientId, String variableName) {
- ajaxScript=ajaxScript.replace("'"+clientId+"'",variableName);
- ajaxScript=ajaxScript.replace("\""+clientId+"\"",variableName);
+ ajaxScript = ajaxScript.replace("'" + clientId + "'", variableName);
+ ajaxScript = ajaxScript.replace("\"" + clientId + "\"", variableName);
return ajaxScript;
}
@@ -231,17 +228,16 @@
* @return
* @throws ScriptNotFoundException
*/
- ScriptWithDependencies getClientSideConverterScript(FacesContext facesContext,
- ConverterDescriptor converter) throws ScriptNotFoundException {
- ClientScriptService clientScriptService =
- ServiceTracker.getService(facesContext, ClientScriptService.class);
- return createClientFunction(facesContext, converter, VALUE_LITERAL, clientScriptService);
+ LibraryScriptFunction getClientSideConverterScript(FacesContext facesContext, ConverterDescriptor converter)
+ throws ScriptNotFoundException {
+ ClientScriptService clientScriptService = ServiceTracker.getService(facesContext, ClientScriptService.class);
+ return createClientFunction(facesContext, converter, clientScriptService);
}
- private ScriptWithDependencies createClientFunction(FacesContext facesContext, FacesObjectDescriptor descriptor,
- JSReference variable, ClientScriptService clientScriptService) throws ScriptNotFoundException {
+ private LibraryScriptFunction createClientFunction(FacesContext facesContext, FacesObjectDescriptor descriptor,
+ ClientScriptService clientScriptService) throws ScriptNotFoundException {
LibraryFunction script = clientScriptService.getScript(facesContext, descriptor.getImplementationClass());
- return new LibraryScriptFunction(script, variable, descriptor.getMessage(), descriptor.getAdditionalParameters());
+ return new LibraryScriptFunction(script, descriptor.getMessage(), descriptor.getAdditionalParameters());
}
/**
@@ -254,14 +250,14 @@
* @return
* @throws ScriptNotFoundException
*/
- Collection<? extends ScriptWithDependencies> getClientSideValidatorScript(FacesContext facesContext,
+ Collection<? extends LibraryScriptFunction> getClientSideValidatorScript(FacesContext facesContext,
Collection<ValidatorDescriptor> validators) {
- ClientScriptService clientScriptService =
- ServiceTracker.getService(facesContext, ClientScriptService.class);
- List<ScriptWithDependencies> scripts = Lists.newArrayList();
+ ClientScriptService clientScriptService = ServiceTracker.getService(facesContext, ClientScriptService.class);
+ List<LibraryScriptFunction> scripts = Lists.newArrayList();
for (FacesObjectDescriptor validator : validators) {
try {
- scripts.add(createClientFunction(facesContext, validator, CONVERTED_VALUE_LITERAL, clientScriptService));
+ scripts
+ .add(createClientFunction(facesContext, validator, clientScriptService));
} catch (ScriptNotFoundException e) {
// Skip this validator for AJAX call.
}
Modified: branches/RF-9797/ui/validator/ui/src/main/java/org/richfaces/renderkit/html/LibraryScriptFunction.java
===================================================================
--- branches/RF-9797/ui/validator/ui/src/main/java/org/richfaces/renderkit/html/LibraryScriptFunction.java 2011-01-13 20:32:21 UTC (rev 21012)
+++ branches/RF-9797/ui/validator/ui/src/main/java/org/richfaces/renderkit/html/LibraryScriptFunction.java 2011-01-14 01:03:54 UTC (rev 21013)
@@ -23,11 +23,13 @@
package org.richfaces.renderkit.html;
-import org.ajax4jsf.javascript.JSFunction;
-import org.ajax4jsf.javascript.ScriptWithDependencies;
import org.richfaces.javascript.LibraryFunction;
+import org.richfaces.javascript.Message;
import org.richfaces.resource.ResourceKey;
+import org.richfaces.resource.ResourceLibrary;
+import com.google.common.collect.ImmutableSet;
+
/**
* <p class="changed_added_4_0">
* This class represents call to function in external library.
@@ -36,14 +38,17 @@
* @author asmirnov(a)exadel.com
*
*/
-public class LibraryScriptFunction extends JSFunction implements ScriptWithDependencies {
+public class LibraryScriptFunction implements ResourceLibrary {
- private final Iterable<ResourceKey> resources;
+ private final ImmutableSet<ResourceKey> resources;
private final String name;
+ private final Message message;
+ private final Object parameters;
- public LibraryScriptFunction(LibraryFunction libraryScript, Object... parameters) {
- super(libraryScript.getName(), parameters);
- this.resources = libraryScript.getResources();
+ public LibraryScriptFunction(LibraryFunction libraryScript, Message message, Object parameters) {
+ this.message = message;
+ this.parameters = parameters;
+ this.resources = ImmutableSet.copyOf(libraryScript.getResources());
this.name = libraryScript.getName();
}
@@ -60,6 +65,26 @@
return resources;
}
+ /**
+ * <p class="changed_added_4_0">
+ * </p>
+ *
+ * @return the message
+ */
+ public Message getMessage() {
+ return this.message;
+ }
+
+ /**
+ * <p class="changed_added_4_0">
+ * </p>
+ *
+ * @return the parameters
+ */
+ public Object getParameters() {
+ return this.parameters;
+ }
+
/*
* (non-Javadoc)
*
@@ -69,9 +94,10 @@
public int hashCode() {
final int prime = 31;
int result = 1;
- result = prime * result + ((name == null) ? 0 : name.hashCode());
- result = prime * result + ((resources == null) ? 0 : resources.hashCode());
- result = prime * result + getParameters().hashCode();
+ result = prime * result + ((this.message == null) ? 0 : this.message.hashCode());
+ result = prime * result + ((this.name == null) ? 0 : this.name.hashCode());
+ result = prime * result + ((this.parameters == null) ? 0 : this.parameters.hashCode());
+ result = prime * result + ((this.resources == null) ? 0 : this.resources.hashCode());
return result;
}
@@ -92,29 +118,35 @@
return false;
}
LibraryScriptFunction other = (LibraryScriptFunction) obj;
- if (name == null) {
+ if (this.message == null) {
+ if (other.message != null) {
+ return false;
+ }
+ } else if (!this.message.equals(other.message)) {
+ return false;
+ }
+ if (this.name == null) {
if (other.name != null) {
return false;
}
- } else if (!name.equals(other.name)) {
+ } else if (!this.name.equals(other.name)) {
return false;
}
- if (resources == null) {
+ if (this.parameters == null) {
+ if (other.parameters != null) {
+ return false;
+ }
+ } else if (!this.parameters.equals(other.parameters)) {
+ return false;
+ }
+ if (this.resources == null) {
if (other.resources != null) {
return false;
}
- } else if (!resources.equals(other.resources)) {
+ } else if (!this.resources.equals(other.resources)) {
return false;
- } else if (!getParameters().equals(other.getParameters())) {
- return false;
}
return true;
}
- /*
- * (non-Javadoc)
- *
- * @see java.lang.Object#hashCode()
- */
-
}
Modified: branches/RF-9797/ui/validator/ui/src/main/java/org/richfaces/renderkit/html/ValidatorScriptBase.java
===================================================================
--- branches/RF-9797/ui/validator/ui/src/main/java/org/richfaces/renderkit/html/ValidatorScriptBase.java 2011-01-13 20:32:21 UTC (rev 21012)
+++ branches/RF-9797/ui/validator/ui/src/main/java/org/richfaces/renderkit/html/ValidatorScriptBase.java 2011-01-14 01:03:54 UTC (rev 21013)
@@ -28,7 +28,7 @@
private boolean bodyProcessed = false;
public ValidatorScriptBase() {
- super(CLIENT_ID,EVENT,ELEMENT);
+ super(CLIENT_ID,ELEMENT,EVENT);
}
public void appendScript(Appendable target) throws IOException {
Modified: branches/RF-9797/ui/validator/ui/src/test/java/org/richfaces/renderkit/html/RendererGetClientSideScriptTest.java
===================================================================
--- branches/RF-9797/ui/validator/ui/src/test/java/org/richfaces/renderkit/html/RendererGetClientSideScriptTest.java 2011-01-13 20:32:21 UTC (rev 21012)
+++ branches/RF-9797/ui/validator/ui/src/test/java/org/richfaces/renderkit/html/RendererGetClientSideScriptTest.java 2011-01-14 01:03:54 UTC (rev 21013)
@@ -10,7 +10,6 @@
import javax.faces.convert.NumberConverter;
import javax.faces.validator.RegexValidator;
-import org.ajax4jsf.javascript.ScriptWithDependencies;
import org.jboss.test.faces.mock.Mock;
import org.jboss.test.faces.mock.MockTestRunner;
import org.junit.After;
@@ -62,7 +61,7 @@
expect(scriptService.getScript(environment.getFacesContext(), RegexValidator.class)).andThrow(new ScriptNotFoundException());
controller.replay();
- Collection<? extends ScriptWithDependencies> clientSideValidatorScript = renderer.getClientSideValidatorScript(
+ Collection<? extends LibraryScriptFunction> clientSideValidatorScript = renderer.getClientSideValidatorScript(
environment.getFacesContext(), descriptors);
assertTrue(clientSideValidatorScript.isEmpty());
controller.verify();
@@ -87,11 +86,10 @@
expect(script.getName()).andReturn(REGEX_VALIDATOR).atLeastOnce();
expect(script.getResources()).andReturn(CLIENT_VALIDATOR_LIBRARY);
controller.replay();
- Collection<? extends ScriptWithDependencies> clientSideScripts = renderer.getClientSideValidatorScript(environment.getFacesContext(), descriptors);
+ Collection<? extends LibraryScriptFunction> clientSideScripts = renderer.getClientSideValidatorScript(environment.getFacesContext(), descriptors);
LibraryScriptFunction clientSideScript = (LibraryScriptFunction) Iterables.getOnlyElement(clientSideScripts);
- assertEquals(ClientValidatorRenderer.CONVERTED_VALUE_LITERAL, clientSideScript.getParameters().get(0));
- assertEquals(VALIDATOR_MESSAGE, clientSideScript.getParameters().get(1));
- assertEquals(VALIDATOR_PARAMS, clientSideScript.getParameters().get(2));
+ assertEquals(VALIDATOR_MESSAGE, clientSideScript.getMessage());
+ assertEquals(VALIDATOR_PARAMS, clientSideScript.getParameters());
assertEquals(CLIENT_VALIDATOR_LIBRARY, clientSideScript.getResources());
controller.verify();
}
@@ -108,9 +106,8 @@
controller.replay();
LibraryScriptFunction clientSideScript =
(LibraryScriptFunction) renderer.getClientSideConverterScript(environment.getFacesContext(), converterDescriptor);
- assertEquals(ClientValidatorRenderer.VALUE_LITERAL, clientSideScript.getParameters().get(0));
- assertEquals(VALIDATOR_MESSAGE, clientSideScript.getParameters().get(1));
- assertEquals(VALIDATOR_PARAMS, clientSideScript.getParameters().get(2));
+ assertEquals(VALIDATOR_MESSAGE, clientSideScript.getMessage());
+ assertEquals(VALIDATOR_PARAMS, clientSideScript.getParameters());
assertEquals(CLIENT_VALIDATOR_LIBRARY, clientSideScript.getResources());
controller.verify();
}
Modified: branches/RF-9797/ui/validator/ui/src/test/java/org/richfaces/renderkit/html/RendererGetComponentScriptTest.java
===================================================================
--- branches/RF-9797/ui/validator/ui/src/test/java/org/richfaces/renderkit/html/RendererGetComponentScriptTest.java 2011-01-13 20:32:21 UTC (rev 21012)
+++ branches/RF-9797/ui/validator/ui/src/test/java/org/richfaces/renderkit/html/RendererGetComponentScriptTest.java 2011-01-14 01:03:54 UTC (rev 21013)
@@ -9,15 +9,12 @@
import java.util.Collection;
import java.util.Map;
-import javax.faces.application.FacesMessage;
import javax.faces.context.FacesContext;
import javax.faces.convert.Converter;
import javax.faces.convert.NumberConverter;
import javax.validation.constraints.Max;
import javax.validation.constraints.Min;
-import org.ajax4jsf.javascript.JSReference;
-import org.ajax4jsf.javascript.ScriptWithDependencies;
import org.hamcrest.BaseMatcher;
import org.hamcrest.Description;
import org.hamcrest.Matcher;
@@ -26,6 +23,7 @@
import org.junit.Test;
import org.junit.runner.RunWith;
import org.richfaces.javascript.LibraryFunction;
+import org.richfaces.javascript.Message;
import org.richfaces.javascript.ScriptNotFoundException;
import org.richfaces.resource.ResourceKey;
import org.richfaces.validator.ConverterDescriptor;
@@ -200,14 +198,15 @@
}
private LibraryScriptFunction createValidatorFunction() {
- return createFunction(REGEX_VALIDATOR, ClientValidatorRenderer.CONVERTED_VALUE_VAR, FACES_VALIDATOR_MESSAGE);
+ return createFunction(REGEX_VALIDATOR, VALIDATOR_MESSAGE);
}
private LibraryScriptFunction createConverterFunction() {
- return createFunction(NUMBER_CONVERTER, ClientValidatorRenderer.VALUE_VAR, FACES_VALIDATOR_MESSAGE);
+ return createFunction(NUMBER_CONVERTER, VALIDATOR_MESSAGE);
}
- private LibraryScriptFunction createFunction(final String name, String var, FacesMessage validatorMessage) {
+
+ private LibraryScriptFunction createFunction(final String name, Message validatorMessage) {
LibraryFunction libraryScript = new LibraryFunction() {
@@ -220,7 +219,7 @@
return CLIENT_VALIDATOR_LIBRARY;
}
};
- return new LibraryScriptFunction(libraryScript, new JSReference(var), validatorMessage, VALIDATOR_PARAMS);
+ return new LibraryScriptFunction(libraryScript, validatorMessage, VALIDATOR_PARAMS);
}
private ClientValidatorRenderer createStubRenderer(final LibraryScriptFunction converterFunction,
@@ -238,7 +237,7 @@
}
@Override
- Collection<? extends ScriptWithDependencies> getClientSideValidatorScript(FacesContext facesContext,
+ Collection<? extends LibraryScriptFunction> getClientSideValidatorScript(FacesContext facesContext,
Collection<ValidatorDescriptor> validators) {
return Lists.newArrayList(validatorFunctions);
}
13 years, 11 months
JBoss Rich Faces SVN: r21012 - in modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest: richCollapsibleSubTableToggler and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: lfryc(a)redhat.com
Date: 2011-01-13 15:32:21 -0500 (Thu, 13 Jan 2011)
New Revision: 21012
Added:
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richCollapsibleSubTableToggler/
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richCollapsibleSubTableToggler/CollapsibleSubTableTogglerAttributes.java
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richCollapsibleSubTableToggler/TestCollapsibleSubTableToggler.java
Log:
rich:collapsibleSubTableToggler - Simple sample automation (RFPL-732)
Added: modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richCollapsibleSubTableToggler/CollapsibleSubTableTogglerAttributes.java
===================================================================
--- modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richCollapsibleSubTableToggler/CollapsibleSubTableTogglerAttributes.java (rev 0)
+++ modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richCollapsibleSubTableToggler/CollapsibleSubTableTogglerAttributes.java 2011-01-13 20:32:21 UTC (rev 21012)
@@ -0,0 +1,55 @@
+/*******************************************************************************
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010, Red Hat, Inc. and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ *******************************************************************************/
+package org.richfaces.tests.metamer.ftest.richCollapsibleSubTableToggler;
+
+import org.jboss.test.selenium.dom.Event;
+import org.richfaces.tests.metamer.ftest.AbstractComponentAttributes;
+
+/**
+ * @author <a href="mailto:lfryc@redhat.com">Lukas Fryc</a>
+ * @version $Revision$
+ */
+public class CollapsibleSubTableTogglerAttributes extends AbstractComponentAttributes {
+ public void setCollapseIcon(String collapseIcon) {
+ setProperty("collapseIcon", collapseIcon);
+ }
+
+ public void setCollapseLabel(String collapseLabel) {
+ setProperty("collapseLabel", collapseLabel);
+ }
+
+ public void setEvent(Event event) {
+ setProperty("event", event);
+ }
+
+ public void setExpandIcon(String expandIcon) {
+ setProperty("expandIcon", expandIcon);
+ }
+
+ public void setExpandLabel(String expandLabel) {
+ setProperty("expandLabel", expandLabel);
+ }
+
+ public void setRendered(Boolean rendered) {
+ setProperty("rendered", rendered);
+ }
+}
Added: modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richCollapsibleSubTableToggler/TestCollapsibleSubTableToggler.java
===================================================================
--- modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richCollapsibleSubTableToggler/TestCollapsibleSubTableToggler.java (rev 0)
+++ modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richCollapsibleSubTableToggler/TestCollapsibleSubTableToggler.java 2011-01-13 20:32:21 UTC (rev 21012)
@@ -0,0 +1,264 @@
+/*******************************************************************************
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010, Red Hat, Inc. and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ *******************************************************************************/
+package org.richfaces.tests.metamer.ftest.richCollapsibleSubTableToggler;
+
+/**
+ * @author <a href="mailto:lfryc@redhat.com">Lukas Fryc</a>
+ * @version $Revision$
+ */
+import static org.jboss.test.selenium.locator.Attribute.SRC;
+import static org.jboss.test.selenium.dom.Event.*;
+import static org.jboss.test.selenium.locator.LocatorFactory.jq;
+import static org.jboss.test.selenium.utils.URLUtils.buildUrl;
+import static org.testng.Assert.assertEquals;
+import static org.testng.Assert.assertFalse;
+import static org.testng.Assert.assertTrue;
+
+import java.net.URL;
+
+import org.jboss.test.selenium.dom.Event;
+import org.jboss.test.selenium.locator.JQueryLocator;
+import org.richfaces.tests.metamer.ftest.AbstractMetamerTest;
+import org.richfaces.tests.metamer.ftest.annotations.Inject;
+import org.richfaces.tests.metamer.ftest.annotations.IssueTracking;
+import org.richfaces.tests.metamer.ftest.annotations.Use;
+import org.testng.annotations.Test;
+
+public class TestCollapsibleSubTableToggler extends AbstractMetamerTest {
+
+ private final static String IMAGE_URL = "/resources/images/star.png";
+ private final static String LABEL = "Label";
+
+ @Override
+ public URL getTestUrl() {
+ return buildUrl(contextPath, "faces/components/richCollapsibleSubTableToggler/simple.xhtml");
+ }
+
+ CollapsibleSubTableTogglerAttributes attributes = new CollapsibleSubTableTogglerAttributes();
+
+ JQueryLocator togglers = pjq("span[id$=richSTTControl]");
+ JQueryLocator collapsedTogglers = togglers.getChild(jq("span[id$=expand]"));
+ JQueryLocator expandedTogglers = togglers.getChild(jq("span[id$=collapse]"));
+ JQueryLocator link = jq("a");
+ JQueryLocator image = jq("img");
+
+ JQueryLocator subtables = pjq("table.rf-dt > tbody.rf-cst");
+
+ @Inject
+ @Use(empty = true)
+ Event event;
+
+ Event[] events = new Event[] { DBLCLICK, MOUSEDOWN, MOUSEUP };
+
+ @Test
+ @Use(field = "event", value = "events")
+ public void testEvent() {
+ attributes.setEvent(Event.DBLCLICK);
+
+ TogglerTester togglerTester = new TogglerTester(image, image);
+ togglerTester.event = Event.DBLCLICK;
+ togglerTester.testToggler();
+ }
+
+ @Test
+ public void testRendered() {
+ attributes.setRendered(false);
+
+ assertFalse(selenium.isElementPresent(togglers));
+ }
+
+ @Test
+ public void testCollapsedLabel() {
+ attributes.setCollapseLabel(LABEL);
+
+ new TogglerTester(link, image) {
+
+ @Override
+ public void verifyBefore() {
+ assertEquals(selenium.getText(togglerExpanded), LABEL);
+ }
+
+ @Override
+ public void verifyMiddle() {
+ assertFalse(selenium.isVisible(togglerExpanded));
+ assertTrue(selenium.isVisible(togglerCollapsed));
+ }
+
+ @Override
+ public void verifyAfter() {
+ assertTrue(selenium.isVisible(togglerExpanded));
+ assertFalse(selenium.isVisible(togglerCollapsed));
+ assertEquals(selenium.getText(togglerExpanded), LABEL);
+ }
+ }.testToggler();
+ }
+
+ @Test
+ public void testExpandedLabel() {
+ attributes.setExpandLabel(LABEL);
+
+ new TogglerTester(image, link) {
+ String imageUrl;
+
+ @Override
+ public void verifyBefore() {
+ selenium.getAttribute(togglerExpanded.getAttribute(SRC));
+ assertTrue(selenium.isVisible(togglerExpanded));
+ assertFalse(selenium.isVisible(togglerCollapsed));
+ imageUrl = selenium.getAttribute(togglerExpanded.getAttribute(SRC));
+ }
+
+ @Override
+ public void verifyAfter() {
+ assertTrue(selenium.isVisible(togglerExpanded));
+ assertFalse(selenium.isVisible(togglerCollapsed));
+ assertEquals(selenium.getAttribute(togglerExpanded.getAttribute(SRC)), imageUrl);
+ }
+
+ @Override
+ public void verifyMiddle() {
+ assertFalse(selenium.isVisible(togglerExpanded));
+ assertTrue(selenium.isVisible(togglerCollapsed));
+ assertEquals(selenium.getText(togglerCollapsed), LABEL);
+ }
+ }.testToggler();
+ }
+
+ @IssueTracking("https://issues.jboss.org/browse/RF-9725")
+ @Test
+ public void testExpandedIcon() {
+ attributes.setExpandIcon(IMAGE_URL);
+
+ new TogglerTester(image, image) {
+
+ @Override
+ public void verifyBefore() {
+ assertTrue(selenium.isVisible(togglerExpanded));
+ assertFalse(selenium.isVisible(togglerCollapsed));
+ assertTrue(selenium.getAttribute(togglerCollapsed.getAttribute(SRC)).contains(IMAGE_URL));
+
+ }
+
+ @Override
+ public void verifyMiddle() {
+ assertFalse(selenium.isVisible(togglerExpanded));
+ assertTrue(selenium.isVisible(togglerCollapsed));
+ assertFalse(selenium.getAttribute(togglerCollapsed.getAttribute(SRC)).contains(IMAGE_URL));
+ }
+
+ @Override
+ public void verifyAfter() {
+ assertTrue(selenium.isVisible(togglerExpanded));
+ assertFalse(selenium.isVisible(togglerCollapsed));
+ assertTrue(selenium.getAttribute(togglerCollapsed.getAttribute(SRC)).contains(IMAGE_URL));
+ }
+ }.testToggler();
+ }
+
+ @IssueTracking("https://issues.jboss.org/browse/RF-9725")
+ @Test
+ public void testCollapsedIcon() {
+ attributes.setCollapseIcon(IMAGE_URL);
+
+ new TogglerTester(image, image) {
+
+ String imageUrl;
+
+ @Override
+ public void verifyBefore() {
+ assertTrue(selenium.isVisible(togglerExpanded));
+ assertFalse(selenium.isVisible(togglerCollapsed));
+ imageUrl = selenium.getAttribute(togglerExpanded.getAttribute(SRC));
+ }
+
+ @Override
+ public void verifyMiddle() {
+ assertFalse(selenium.isVisible(togglerExpanded));
+ assertTrue(selenium.isVisible(togglerCollapsed));
+ assertTrue(selenium.getAttribute(togglerCollapsed.getAttribute(SRC)).contains(IMAGE_URL));
+ }
+
+ @Override
+ public void verifyAfter() {
+ assertTrue(selenium.isVisible(togglerExpanded));
+ assertFalse(selenium.isVisible(togglerCollapsed));
+ assertEquals(selenium.getAttribute(togglerExpanded.getAttribute(SRC)), imageUrl);
+ }
+ }.testToggler();
+ }
+
+ public class TogglerTester {
+
+ Event event = Event.CLICK;
+
+ JQueryLocator expander;
+ JQueryLocator collapser;
+ JQueryLocator togglerRoot;
+
+ JQueryLocator subtable;
+ JQueryLocator togglerExpanded;
+ JQueryLocator togglerCollapsed;
+
+ public TogglerTester(JQueryLocator expander, JQueryLocator collapser) {
+ this.expander = expander;
+ this.collapser = collapser;
+ }
+
+ public void testToggler() {
+ for (int i = 1; i <= 2; i++) {
+ subtable = subtables.getNthOccurence(i);
+ togglerRoot = togglers.getNthOccurence(i);
+ togglerExpanded = expandedTogglers.getNthOccurence(i).getChild(expander);
+ togglerCollapsed = collapsedTogglers.getNthOccurence(i).getChild(collapser);
+
+ verifyBefore();
+
+ if (event == Event.CLICK) {
+ selenium.click(togglerExpanded);
+ } else {
+ selenium.fireEvent(togglerRoot, event);
+ }
+ waitGui.until(isNotDisplayed.locator(subtable));
+
+ verifyMiddle();
+
+ if (event == Event.CLICK) {
+ selenium.click(togglerCollapsed);
+ } else {
+ selenium.fireEvent(togglerRoot, event);
+ }
+ waitGui.until(isDisplayed.locator(subtable));
+
+ verifyAfter();
+ }
+ }
+
+ public void verifyBefore() {
+ }
+
+ public void verifyMiddle() {
+ }
+
+ public void verifyAfter() {
+ }
+ }
+}
13 years, 11 months
JBoss Rich Faces SVN: r21011 - modules/tests/metamer/trunk/ftest-source/src/main/java/org/jboss/test/selenium/locator/reference.
by richfaces-svn-commits@lists.jboss.org
Author: lfryc(a)redhat.com
Date: 2011-01-13 15:31:36 -0500 (Thu, 13 Jan 2011)
New Revision: 21011
Modified:
modules/tests/metamer/trunk/ftest-source/src/main/java/org/jboss/test/selenium/locator/reference/ReferencedLocator.java
Log:
changed ReferencedLocator according to library (added getAllOccurences() method
Modified: modules/tests/metamer/trunk/ftest-source/src/main/java/org/jboss/test/selenium/locator/reference/ReferencedLocator.java
===================================================================
--- modules/tests/metamer/trunk/ftest-source/src/main/java/org/jboss/test/selenium/locator/reference/ReferencedLocator.java 2011-01-13 20:02:02 UTC (rev 21010)
+++ modules/tests/metamer/trunk/ftest-source/src/main/java/org/jboss/test/selenium/locator/reference/ReferencedLocator.java 2011-01-13 20:31:36 UTC (rev 21011)
@@ -112,6 +112,10 @@
public Iterable<T> getAllChildren() {
return getReferenced().getAllChildren();
}
+
+ public Iterable<T> getAllOccurrences() {
+ return getReferenced().getAllOccurrences();
+ }
public Iterable<T> getChildren(T elementLocator) {
return getReferenced().getChildren(elementLocator);
13 years, 11 months
JBoss Rich Faces SVN: r21010 - in branches/RF-9797: cdk/attributes/src/main/resources/META-INF/cdk/attributes and 18 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: alexsmirnov
Date: 2011-01-13 15:02:02 -0500 (Thu, 13 Jan 2011)
New Revision: 21010
Modified:
branches/RF-9797/
branches/RF-9797/cdk/attributes/src/main/resources/META-INF/cdk/attributes/javax.faces.component.UIComponent.xml
branches/RF-9797/cdk/generator/src/main/java/org/richfaces/cdk/templatecompiler/RendererClassVisitor.java
branches/RF-9797/cdk/generator/src/main/java/org/richfaces/cdk/templatecompiler/model/CdkObjectElement.java
branches/RF-9797/cdk/generator/src/main/java/org/richfaces/cdk/templatecompiler/statements/DefineObjectStatement.java
branches/RF-9797/cdk/generator/src/main/java/org/richfaces/cdk/xmlconfig/model/ElementAdapterBase.java
branches/RF-9797/cdk/generator/src/main/java/org/richfaces/cdk/xmlconfig/model/ElementBeanBase.java
branches/RF-9797/cdk/generator/src/main/resources/META-INF/schema/cdk-template.xsd
branches/RF-9797/cdk/generator/src/main/resources/META-INF/templates/java/define-object.ftl
branches/RF-9797/cdk/generator/src/test/java/org/richfaces/cdk/templatecompiler/statements/DefineObjectTest.java
branches/RF-9797/core/impl/src/main/java/org/richfaces/application/push/impl/jms/MessagingContext.java
branches/RF-9797/core/impl/src/main/java/org/richfaces/application/push/impl/jms/PushContextImpl.java
branches/RF-9797/core/impl/src/main/resources/META-INF/resources/skinning_classes.ecss
branches/RF-9797/examples/output-demo/src/main/webapp/examples/toolbar.xhtml
branches/RF-9797/examples/richfaces-showcase/src/main/webapp/richfaces/progressBar/samples/ajaxProgressBar-sample.xhtml
branches/RF-9797/ui/input/ui/src/main/java/org/richfaces/component/AbstractInplaceInput.java
branches/RF-9797/ui/input/ui/src/main/java/org/richfaces/renderkit/InplaceInputRendererBase.java
branches/RF-9797/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/inplaceSelect.js
branches/RF-9797/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/select.js
branches/RF-9797/ui/input/ui/src/main/templates/inplaceInput.template.xml
branches/RF-9797/ui/input/ui/src/main/templates/inplaceSelect.template.xml
branches/RF-9797/ui/input/ui/src/main/templates/input.template.inc
branches/RF-9797/ui/input/ui/src/main/templates/inputnumberslider.template.xml
branches/RF-9797/ui/input/ui/src/test/java/org/richfaces/renderkit/AutocompleteRendererTest.java
branches/RF-9797/ui/iteration/ui/src/main/java/org/richfaces/renderkit/AbstractRowsRenderer.java
branches/RF-9797/ui/iteration/ui/src/main/java/org/richfaces/renderkit/AbstractTableBaseRenderer.java
branches/RF-9797/ui/iteration/ui/src/main/java/org/richfaces/renderkit/ExtendedDataTableRenderer.java
branches/RF-9797/ui/iteration/ui/src/main/java/org/richfaces/renderkit/RowHolder.java
branches/RF-9797/ui/output/ui/src/main/java/org/richfaces/renderkit/html/ToolbarRendererBase.java
Log:
Merged revisions 20981,20983,20991-20992,20995-21000,21002-21004 via svnmerge from
https://svn.jboss.org/repos/richfaces/trunk
.......
r20981 | abelevich | 2011-01-13 03:50:08 -0800 (Thu, 13 Jan 2011) | 2 lines
RF-9777 rich:dataTable Attributes columnClasses and headerClass not working
-rowClasses and columnClasses attribute were applied to ExtendedDataTable.
.......
r20983 | abelevich | 2011-01-13 05:45:42 -0800 (Thu, 13 Jan 2011) | 1 line
RF-9663 select: click to input field - should cause popup to be appeared.
.......
r20991 | nbelaevski | 2011-01-13 06:46:11 -0800 (Thu, 13 Jan 2011) | 1 line
https://issues.jboss.org/browse/RF-10198
.......
r20992 | nbelaevski | 2011-01-13 07:28:51 -0800 (Thu, 13 Jan 2011) | 1 line
https://issues.jboss.org/browse/RF-10191
.......
r20995 | konstantin.mishin | 2011-01-13 08:26:56 -0800 (Thu, 13 Jan 2011) | 1 line
RF-10095
.......
r20996 | abelevich | 2011-01-13 08:36:05 -0800 (Thu, 13 Jan 2011) | 2 lines
RF-9072 Unit tests development for autocomplete component
- waiting interval was prolonged.
.......
r20997 | abelevich | 2011-01-13 08:40:17 -0800 (Thu, 13 Jan 2011) | 1 line
RF-10096 Inline default values: input components III
.......
r20998 | konstantin.mishin | 2011-01-13 08:44:18 -0800 (Thu, 13 Jan 2011) | 1 line
RF-10095
.......
r20999 | artdaw | 2011-01-13 08:48:52 -0800 (Thu, 13 Jan 2011) | 1 line
RF-9817: bug with inplaceSelect width is fixed
.......
r21000 | nbelaevski | 2011-01-13 08:51:27 -0800 (Thu, 13 Jan 2011) | 1 line
https://issues.jboss.org/browse/RF-10060
.......
r21002 | artdaw | 2011-01-13 10:01:32 -0800 (Thu, 13 Jan 2011) | 1 line
RF-10182: class 'rf-tb-emp' for empty cell in Toolbar
.......
r21003 | artdaw | 2011-01-13 11:31:58 -0800 (Thu, 13 Jan 2011) | 1 line
RF-10210: Character entity reference is replaced with numeric "\u00a0" since it brakes XHTML
.......
r21004 | alexsmirnov | 2011-01-13 11:45:26 -0800 (Thu, 13 Jan 2011) | 2 lines
RESOLVED - issue RF-9949: Faces-config: several components have attribute actionExpression
https://issues.jboss.org/browse/RF-9949
.......
Property changes on: branches/RF-9797
___________________________________________________________________
Name: svnmerge-integrated
- /trunk:1-20978
+ /trunk:1-21009
Modified: branches/RF-9797/cdk/attributes/src/main/resources/META-INF/cdk/attributes/javax.faces.component.UIComponent.xml
===================================================================
--- branches/RF-9797/cdk/attributes/src/main/resources/META-INF/cdk/attributes/javax.faces.component.UIComponent.xml 2011-01-13 19:52:30 UTC (rev 21009)
+++ branches/RF-9797/cdk/attributes/src/main/resources/META-INF/cdk/attributes/javax.faces.component.UIComponent.xml 2011-01-13 20:02:02 UTC (rev 21010)
@@ -180,5 +180,9 @@
<icon />
<property-name>binding</property-name>
<property-class>javax.faces.component.UIComponent</property-class>
+ <property-extension>
+ <cdk:generate>false</cdk:generate>
+ <cdk:literal>false</cdk:literal>
+ </property-extension>
</property>
</cdk:properties>
Modified: branches/RF-9797/cdk/generator/src/main/java/org/richfaces/cdk/templatecompiler/RendererClassVisitor.java
===================================================================
--- branches/RF-9797/cdk/generator/src/main/java/org/richfaces/cdk/templatecompiler/RendererClassVisitor.java 2011-01-13 19:52:30 UTC (rev 21009)
+++ branches/RF-9797/cdk/generator/src/main/java/org/richfaces/cdk/templatecompiler/RendererClassVisitor.java 2011-01-13 20:02:02 UTC (rev 21010)
@@ -540,7 +540,7 @@
}
String type = cdkObjectElement.getType();
DefineObjectStatement statement = addStatement(DefineObjectStatement.class);
- statement.setObject(name, type, value);
+ statement.setObject(name, type, value, cdkObjectElement.isCast());
}
/*
Modified: branches/RF-9797/cdk/generator/src/main/java/org/richfaces/cdk/templatecompiler/model/CdkObjectElement.java
===================================================================
--- branches/RF-9797/cdk/generator/src/main/java/org/richfaces/cdk/templatecompiler/model/CdkObjectElement.java 2011-01-13 19:52:30 UTC (rev 21009)
+++ branches/RF-9797/cdk/generator/src/main/java/org/richfaces/cdk/templatecompiler/model/CdkObjectElement.java 2011-01-13 20:02:02 UTC (rev 21010)
@@ -48,6 +48,9 @@
@XmlAttribute(required = true)
private String type;
+ @XmlAttribute
+ private boolean cast;
+
@XmlAttribute(name = "type-arguments")
private String typeArguments;
@@ -126,4 +129,12 @@
visitor.visitElement(this);
}
+ public void setCast(boolean cast) {
+ this.cast = cast;
+ }
+
+ public boolean isCast() {
+ return cast;
+ }
+
}
Modified: branches/RF-9797/cdk/generator/src/main/java/org/richfaces/cdk/templatecompiler/statements/DefineObjectStatement.java
===================================================================
--- branches/RF-9797/cdk/generator/src/main/java/org/richfaces/cdk/templatecompiler/statements/DefineObjectStatement.java 2011-01-13 19:52:30 UTC (rev 21009)
+++ branches/RF-9797/cdk/generator/src/main/java/org/richfaces/cdk/templatecompiler/statements/DefineObjectStatement.java 2011-01-13 20:02:02 UTC (rev 21010)
@@ -44,6 +44,8 @@
private String name;
+ private boolean cast;
+
private final ELParser parser;
private final Logger log;
@@ -69,9 +71,10 @@
* the initializationExpression to set
* @throws ParsingException
*/
- public void setObject(String name, String type, String initializationExpression) {
+ public void setObject(String name, String type, String initializationExpression, boolean cast) {
try {
this.name = name;
+ this.cast = cast;
if (!Strings.isEmpty(initializationExpression)) {
initializationStatement = parser.parse(initializationExpression, this, TypesFactory.OBJECT_TYPE);
initializationStatement.setParent(this);
@@ -117,4 +120,8 @@
return null != initializationStatement ? Collections.<TemplateStatement> singletonList(initializationStatement)
: Collections.<TemplateStatement> emptyList();
}
+
+ public boolean isCast() {
+ return cast;
+ }
}
Modified: branches/RF-9797/cdk/generator/src/main/java/org/richfaces/cdk/xmlconfig/model/ElementAdapterBase.java
===================================================================
--- branches/RF-9797/cdk/generator/src/main/java/org/richfaces/cdk/xmlconfig/model/ElementAdapterBase.java 2011-01-13 19:52:30 UTC (rev 21009)
+++ branches/RF-9797/cdk/generator/src/main/java/org/richfaces/cdk/xmlconfig/model/ElementAdapterBase.java 2011-01-13 20:02:02 UTC (rev 21010)
@@ -30,5 +30,8 @@
*/
public abstract class ElementAdapterBase<Bean extends ElementBeanBase, Model extends BeanModelBase> extends AdapterBase<Bean, Model> {
+ protected void postMarshal(Model model, Bean bean) {
+ bean.setFilterHiddenAttributes(true);
+ };
}
Modified: branches/RF-9797/cdk/generator/src/main/java/org/richfaces/cdk/xmlconfig/model/ElementBeanBase.java
===================================================================
--- branches/RF-9797/cdk/generator/src/main/java/org/richfaces/cdk/xmlconfig/model/ElementBeanBase.java 2011-01-13 19:52:30 UTC (rev 21009)
+++ branches/RF-9797/cdk/generator/src/main/java/org/richfaces/cdk/xmlconfig/model/ElementBeanBase.java 2011-01-13 20:02:02 UTC (rev 21010)
@@ -35,6 +35,7 @@
/**
* TODO - is the tho different collections are necessary ?
+ *
* @author akolonitsky
* @since Mar 19, 2010
*/
@@ -55,29 +56,64 @@
}
};
+ private static final Predicate<PropertyBase> VISIBLE_PROPERTY_PREDICATE = new Predicate<PropertyBase>() {
+ @Override
+ public boolean apply(PropertyBase input) {
+ if (input instanceof PropertyModel) {
+ return !input.isHidden();
+ }
+ return false;
+ }
+ };
+
+ private static final Predicate<PropertyBase> VISIBLE_ATTRIBUTE_PREDICATE = new Predicate<PropertyBase>() {
+ @Override
+ public boolean apply(PropertyBase input) {
+ if (input instanceof AttributeModel) {
+ return !input.isHidden();
+ }
+ return false;
+ }
+ };
+
private Collection<? extends PropertyBase> attributes = Lists.newArrayList();
-
- private Collection<PropertyModel> properties = (Collection<PropertyModel>) Collections2.filter(attributes, PROPERTY_PREDICATE);
- private Collection<AttributeModel> facesAttributes = (Collection<AttributeModel>) Collections2.filter(attributes, ATTRIBUTE_PREDICATE);
+ private Collection<PropertyModel> properties = (Collection<PropertyModel>) Collections2.filter(attributes,
+ PROPERTY_PREDICATE);
+ private Collection<AttributeModel> facesAttributes = (Collection<AttributeModel>) Collections2.filter(attributes,
+ ATTRIBUTE_PREDICATE);
+
public Collection<PropertyModel> getProperties() {
return properties;
}
-
public Collection<AttributeModel> getFacesAttributes() {
return this.facesAttributes;
}
-
public Collection<PropertyBase> getAttributes() {
return (Collection<PropertyBase>) attributes;
}
- public void setAttributes(Collection<PropertyBase> attributes) {
- this.attributes = attributes;
- properties = (Collection<PropertyModel>) Collections2.filter(this.attributes, PROPERTY_PREDICATE);
- facesAttributes = (Collection<AttributeModel>) Collections2.filter(this.attributes, ATTRIBUTE_PREDICATE);
+ /**
+ * <p class="changed_added_4_0">Set filtering visible properties and attributes, to unmarshall public properties only.</p>
+ * @param filter
+ */
+ public void setFilterHiddenAttributes(boolean filter) {
+ if (filter) {
+ properties = (Collection<PropertyModel>) Collections2.filter(this.attributes, VISIBLE_PROPERTY_PREDICATE);
+ facesAttributes =
+ (Collection<AttributeModel>) Collections2.filter(this.attributes, VISIBLE_ATTRIBUTE_PREDICATE);
+ } else {
+ properties = (Collection<PropertyModel>) Collections2.filter(this.attributes, PROPERTY_PREDICATE);
+ facesAttributes = (Collection<AttributeModel>) Collections2.filter(this.attributes, ATTRIBUTE_PREDICATE);
+ }
}
+
+ // public void setAttributes(Collection<PropertyBase> attributes) {
+ // this.attributes = attributes;
+ // properties = (Collection<PropertyModel>) Collections2.filter(this.attributes, PROPERTY_PREDICATE);
+ // facesAttributes = (Collection<AttributeModel>) Collections2.filter(this.attributes, ATTRIBUTE_PREDICATE);
+ // }
}
Modified: branches/RF-9797/cdk/generator/src/main/resources/META-INF/schema/cdk-template.xsd
===================================================================
--- branches/RF-9797/cdk/generator/src/main/resources/META-INF/schema/cdk-template.xsd 2011-01-13 19:52:30 UTC (rev 21009)
+++ branches/RF-9797/cdk/generator/src/main/resources/META-INF/schema/cdk-template.xsd 2011-01-13 20:02:02 UTC (rev 21010)
@@ -531,6 +531,11 @@
</xs:documentation>
</xs:annotation>
</xs:attribute>
+ <xs:attribute type="xs:boolean" name="cast">
+ <xs:annotation>
+ <xs:documentation><p>Defines whether type cast is needed.</p></xs:documentation>
+ </xs:annotation>
+ </xs:attribute>
</xs:extension>
</xs:simpleContent>
</xs:complexType>
Modified: branches/RF-9797/cdk/generator/src/main/resources/META-INF/templates/java/define-object.ftl
===================================================================
--- branches/RF-9797/cdk/generator/src/main/resources/META-INF/templates/java/define-object.ftl 2011-01-13 19:52:30 UTC (rev 21009)
+++ branches/RF-9797/cdk/generator/src/main/resources/META-INF/templates/java/define-object.ftl 2011-01-13 20:02:02 UTC (rev 21010)
@@ -1 +1 @@
-${type} ${name} <#if initializationStatement?exists> = ${initializationStatement}</#if>;
\ No newline at end of file
+${type} ${name} <#if initializationStatement?exists> = <#if cast>(${type})</#if>${initializationStatement}</#if>;
\ No newline at end of file
Modified: branches/RF-9797/cdk/generator/src/test/java/org/richfaces/cdk/templatecompiler/statements/DefineObjectTest.java
===================================================================
--- branches/RF-9797/cdk/generator/src/test/java/org/richfaces/cdk/templatecompiler/statements/DefineObjectTest.java 2011-01-13 19:52:30 UTC (rev 21009)
+++ branches/RF-9797/cdk/generator/src/test/java/org/richfaces/cdk/templatecompiler/statements/DefineObjectTest.java 2011-01-13 20:02:02 UTC (rev 21010)
@@ -25,7 +25,7 @@
public void testDefineVariable() throws Exception {
expect(typesFactory.getType("java.lang.String")).andReturn(TypesFactory.STRING_TYPE);
controller.replay();
- statement.setObject("foo","java.lang.String",null);
+ statement.setObject("foo","java.lang.String",null, false);
String code = statement.getCode();
controller.verify();
verifyCode(code, "String"," foo","!=");
@@ -41,9 +41,9 @@
expect(typesFactory.getType("java.lang.String")).andReturn(TypesFactory.STRING_TYPE);
parsedExpression.setParent(statement);expectLastCall();
controller.replay();
- statement.setObject("foo","java.lang.String",HTTP_EXAMPLE_COM);
+ statement.setObject("foo","java.lang.String",HTTP_EXAMPLE_COM, false);
String code = statement.getCode();
- verifyCode(code, HTTP_EXAMPLE_COM,"String","=");
+ verifyCode(code, HTTP_EXAMPLE_COM,"String","=", "!(String)");
controller.verify();
}
@Test
@@ -55,9 +55,9 @@
expect(parsedExpression.getRequiredMethods()).andStubReturn(Collections.<HelperMethod>emptySet());
parsedExpression.setParent(statement);expectLastCall();
controller.replay();
- statement.setObject("foo",null,HTTP_EXAMPLE_COM);
+ statement.setObject("foo",null,HTTP_EXAMPLE_COM, true);
String code = statement.getCode();
- verifyCode(code, "Integer","foo","=");
+ verifyCode(code, "Integer","foo","=", "(Integer)");
controller.verify();
}
Modified: branches/RF-9797/core/impl/src/main/java/org/richfaces/application/push/impl/jms/MessagingContext.java
===================================================================
--- branches/RF-9797/core/impl/src/main/java/org/richfaces/application/push/impl/jms/MessagingContext.java 2011-01-13 19:52:30 UTC (rev 21009)
+++ branches/RF-9797/core/impl/src/main/java/org/richfaces/application/push/impl/jms/MessagingContext.java 2011-01-13 20:02:02 UTC (rev 21010)
@@ -115,7 +115,7 @@
}
public void stop() throws Exception {
- connection.stop();
+ connection.close();
connection = null;
}
Modified: branches/RF-9797/core/impl/src/main/java/org/richfaces/application/push/impl/jms/PushContextImpl.java
===================================================================
--- branches/RF-9797/core/impl/src/main/java/org/richfaces/application/push/impl/jms/PushContextImpl.java 2011-01-13 19:52:30 UTC (rev 21009)
+++ branches/RF-9797/core/impl/src/main/java/org/richfaces/application/push/impl/jms/PushContextImpl.java 2011-01-13 20:02:02 UTC (rev 21010)
@@ -32,9 +32,9 @@
import javax.faces.event.PreDestroyApplicationEvent;
import javax.faces.event.SystemEvent;
import javax.faces.event.SystemEventListener;
-import javax.naming.CompositeName;
import javax.naming.InitialContext;
import javax.naming.Name;
+import javax.naming.NameParser;
import javax.servlet.ServletContext;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
@@ -81,8 +81,11 @@
ConfigurationService configurationService = ServiceTracker.getService(ConfigurationService.class);
InitialContext initialContext = new InitialContext();
- Name cnfName = new CompositeName(configurationService.getStringValue(facesContext, pushJMSConnectionFactory));
- Name topicsNamespace = new CompositeName(configurationService.getStringValue(facesContext, pushJMSTopicsNamespace));
+
+ NameParser nameParser = initialContext.getNameParser("");
+
+ Name cnfName = nameParser.parse(configurationService.getStringValue(facesContext, pushJMSConnectionFactory));
+ Name topicsNamespace = nameParser.parse(configurationService.getStringValue(facesContext, pushJMSTopicsNamespace));
messagingContext = new MessagingContext(initialContext, cnfName, topicsNamespace,
getApplicationName(facesContext),
Modified: branches/RF-9797/core/impl/src/main/resources/META-INF/resources/skinning_classes.ecss
===================================================================
--- branches/RF-9797/core/impl/src/main/resources/META-INF/resources/skinning_classes.ecss 2011-01-13 19:52:30 UTC (rev 21009)
+++ branches/RF-9797/core/impl/src/main/resources/META-INF/resources/skinning_classes.ecss 2011-01-13 20:02:02 UTC (rev 21010)
@@ -311,53 +311,6 @@
color: '#{richSkin.selectControlColor}';
}
- /*gradient styles*/
-
-.rfs-gradient-header-inverse{
- background-image : "url(#{resource['org.richfaces.renderkit.html.gradientimages.HeaderInverseGradientImage']})";
- background-repeat : repeat-x;
-}
-
-.rfs-gradient-header{
- background-image : "url(#{resource['org.richfaces.renderkit.html.gradientimages.HeaderGradientImage']})";
- background-repeat : repeat-x;
-}
-
-.rfs-gradient-tab{
- background-image : "url(#{resource['org.richfaces.renderkit.html.gradientimages.TabGradientImage']})";
- background-repeat : repeat-x;
-}
-
-.rfs-gradient-tab-inverse{
- background-image : "url(#{resource['org.richfaces.renderkit.html.gradientimages.TabInverseGradientImage']})";
- background-repeat : repeat-x;
-}
-
-.rfs-gradient-input{
- background-image : "url(#{resource['org.richfaces.renderkit.html.gradientimages.InputGradientImage']})";
- background-repeat : repeat-x;
-}
-
-.rfs-gradient-menu-inverse{
- background-image : "url(#{resource['org.richfaces.renderkit.html.gradientimages.MenuInverseGradientImage']})";
- background-repeat : repeat-x;
-}
-
-.rfs-gradient-menu{
- background-image : "url(#{resource['org.richfaces.renderkit.html.gradientimages.MenuGradientImage']})";
- background-repeat : repeat-x;
-}
-
-.rfs-gradient-btn-inverse{
- background-image : "url(#{resource['org.richfaces.renderkit.html.gradientimages.ButtonInverseGradientImage']})";
- background-repeat : repeat-x;
-}
-
-.rfs-gradient-btn{
- background-image : "url(#{resource['org.richfaces.renderkit.html.gradientimages.ButtonGradientImage']})";
- background-repeat : repeat-x;
-}
-
/* extended skinning styles */
.rfs-ctn input, .rfs-input,
Modified: branches/RF-9797/examples/output-demo/src/main/webapp/examples/toolbar.xhtml
===================================================================
--- branches/RF-9797/examples/output-demo/src/main/webapp/examples/toolbar.xhtml 2011-01-13 19:52:30 UTC (rev 21009)
+++ branches/RF-9797/examples/output-demo/src/main/webapp/examples/toolbar.xhtml 2011-01-13 20:02:02 UTC (rev 21010)
@@ -3,77 +3,86 @@
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:h="http://java.sun.com/jsf/html"
- xmlns:tb="http://richfaces.org/output">
- <h:head>
- <title>toolbar sample</title>
- <style>
-
- </style>
- </h:head>
- <h:body>
- <tb:toolbar height="45" itemSeparator="grid" itemStyle="color:red;" itemClass="custom-item">
+ xmlns:tb="http://richfaces.org/output" xmlns:a4j="http://richfaces.org/a4j">
+<f:view contentType="application/xhtml+xml">
+<h:head>
+ <title>toolbar sample</title>
+ <style>
+
+ </style>
+</h:head>
+
+<h:body>
+ <tb:toolbar id="tb" height="45" itemSeparator="grid" itemStyle="color:red;" itemClass="custom-item">
<f:facet name="itemSeparator">
||
- </f:facet>
- <tb:toolbarGroup itemStyle="border: 1px solid green" itemClass="custom-item-group" itemSeparator="line" onitemclick="22">
- <h:graphicImage value="/images/icons/create_doc.gif"/>
- <a href="#">link 1</a> Text
- <a href="#">link 2</a>
- <h:graphicImage value="/images/icons/create_folder.gif" onclick="q1"/>
- <h:graphicImage value="/images/icons/copy.gif"/>
- <a href="#">link 3</a> Text
- <a href="#">link 4</a>
- </tb:toolbarGroup>
- <tb:toolbarGroup itemSeparator="none">
- <h:graphicImage value="/images/icons/save.gif" onclick="q2"/>
- <h:graphicImage value="/images/icons/save.gif" onclick="q2"/>
- <h:graphicImage value="/images/icons/save.gif" onclick="q2"/>
- <h:graphicImage value="/images/icons/save.gif" onclick="q2"/>
- </tb:toolbarGroup>
- <tb:toolbarGroup itemSeparator="line">
- <h:graphicImage value="/images/icons/save.gif" onclick="q2"/>
- <h:graphicImage value="/images/icons/save.gif" onclick="q2"/>
- </tb:toolbarGroup>
-
- <tb:toolbarGroup location="right" itemSeparator="square">
- <h:graphicImage value="/images/icons/find.gif" />
- <h:graphicImage value="/images/icons/filter.gif" />
- </tb:toolbarGroup>
- </tb:toolbar>
- <br/>
- <tb:toolbar itemSeparator="grid" itemStyle="border: 1px solid green" itemClass="custom-item">
- <tb:toolbarGroup itemSeparator="line" itemStyle="border: 1px solid green" itemClass="custom-item-group">
- <h:graphicImage value="/images/icons/create_doc.gif"/>
- <h:graphicImage value="/images/icons/create_folder.gif"/>
- <h:graphicImage value="/images/icons/copy.gif"/>
- </tb:toolbarGroup>
- <tb:toolbarGroup itemSeparator="disc">
- <h:graphicImage value="/images/icons/save.gif"/>
- <h:graphicImage value="/images/icons/save_as.gif"/>
- <h:graphicImage value="/images/icons/save_all.gif"/>
- </tb:toolbarGroup>
- <tb:toolbarGroup location="right" itemSeparator="square">
- <h:graphicImage value="/images/icons/find.gif"/>
- <h:graphicImage value="/images/icons/filter.gif"/>
- </tb:toolbarGroup>
- </tb:toolbar>
-
- <br/>
- <tb:toolbar height="26" itemSeparator="grid">
- <tb:toolbarGroup itemSeparator="line">
- <h:graphicImage value="/images/icons/create_doc.gif"/>
- <h:graphicImage value="/images/icons/create_folder.gif"/>
- <h:graphicImage value="/images/icons/copy.gif"/>
- </tb:toolbarGroup>
- <tb:toolbarGroup itemSeparator="disc">
- <h:graphicImage value="/images/icons/save.gif"/>
- <h:graphicImage value="/images/icons/save_as.gif"/>
- <h:graphicImage value="/images/icons/save_all.gif"/>
- </tb:toolbarGroup>
- <tb:toolbarGroup location="right" itemSeparator="square">
- <h:graphicImage value="/images/icons/find.gif"/>
- <h:graphicImage value="/images/icons/filter.gif"/>
- </tb:toolbarGroup>
- </tb:toolbar>
- </h:body>
+ </f:facet>
+ <tb:toolbarGroup itemStyle="border: 1px solid green" itemClass="custom-item-group" itemSeparator="line"
+ onitemclick="22">
+ <h:graphicImage value="/images/icons/create_doc.gif"/>
+ <a href="#">link 1</a> Text
+ <a href="#">link 2</a>
+ <h:graphicImage value="/images/icons/create_folder.gif" onclick="q1"/>
+ <h:graphicImage value="/images/icons/copy.gif"/>
+ <a href="#">link 3</a> Text
+ <a href="#">link 4</a>
+ </tb:toolbarGroup>
+ <tb:toolbarGroup itemSeparator="none">
+ <h:graphicImage value="/images/icons/save.gif" onclick="q2"/>
+ <h:graphicImage value="/images/icons/save.gif" onclick="q2"/>
+ <h:graphicImage value="/images/icons/save.gif" onclick="q2"/>
+ <h:graphicImage value="/images/icons/save.gif" onclick="q2"/>
+ </tb:toolbarGroup>
+ <tb:toolbarGroup itemSeparator="line">
+ <h:graphicImage value="/images/icons/save.gif" onclick="q2"/>
+ <h:graphicImage value="/images/icons/save.gif" onclick="q2"/>
+ </tb:toolbarGroup>
+
+ <tb:toolbarGroup location="right" itemSeparator="square">
+ <h:graphicImage value="/images/icons/find.gif"/>
+ <h:graphicImage value="/images/icons/filter.gif"/>
+ </tb:toolbarGroup>
+ </tb:toolbar>
+ <br/>
+ <tb:toolbar itemSeparator="grid" itemStyle="border: 1px solid green" itemClass="custom-item">
+ <tb:toolbarGroup itemSeparator="line" itemStyle="border: 1px solid green" itemClass="custom-item-group">
+ <h:graphicImage value="/images/icons/create_doc.gif"/>
+ <h:graphicImage value="/images/icons/create_folder.gif"/>
+ <h:graphicImage value="/images/icons/copy.gif"/>
+ </tb:toolbarGroup>
+ <tb:toolbarGroup itemSeparator="disc">
+ <h:graphicImage value="/images/icons/save.gif"/>
+ <h:graphicImage value="/images/icons/save_as.gif"/>
+ <h:graphicImage value="/images/icons/save_all.gif"/>
+ </tb:toolbarGroup>
+ <tb:toolbarGroup location="right" itemSeparator="square">
+ <h:graphicImage value="/images/icons/find.gif"/>
+ <h:graphicImage value="/images/icons/filter.gif"/>
+ </tb:toolbarGroup>
+ </tb:toolbar>
+
+ <br/>
+ <tb:toolbar height="26" itemSeparator="grid">
+ <tb:toolbarGroup itemSeparator="line">
+ <h:graphicImage value="/images/icons/create_doc.gif"/>
+ <h:graphicImage value="/images/icons/create_folder.gif"/>
+ <h:graphicImage value="/images/icons/copy.gif"/>
+ </tb:toolbarGroup>
+ <tb:toolbarGroup itemSeparator="disc">
+ <h:graphicImage value="/images/icons/save.gif"/>
+ <h:graphicImage value="/images/icons/save_as.gif"/>
+ <h:graphicImage value="/images/icons/save_all.gif"/>
+ </tb:toolbarGroup>
+ <tb:toolbarGroup location="right" itemSeparator="square">
+ <h:graphicImage value="/images/icons/find.gif"/>
+ <h:graphicImage value="/images/icons/filter.gif"/>
+ </tb:toolbarGroup>
+ </tb:toolbar>
+
+ <h:form>
+ <a4j:commandLink value="Ajax Rerender Toolbar" render="tb" />
+ <a4j:log />
+ </h:form>
+</h:body>
+</f:view>
</html>
\ No newline at end of file
Modified: branches/RF-9797/examples/richfaces-showcase/src/main/webapp/richfaces/progressBar/samples/ajaxProgressBar-sample.xhtml
===================================================================
--- branches/RF-9797/examples/richfaces-showcase/src/main/webapp/richfaces/progressBar/samples/ajaxProgressBar-sample.xhtml 2011-01-13 19:52:30 UTC (rev 21009)
+++ branches/RF-9797/examples/richfaces-showcase/src/main/webapp/richfaces/progressBar/samples/ajaxProgressBar-sample.xhtml 2011-01-13 20:02:02 UTC (rev 21010)
@@ -22,7 +22,7 @@
<h:panelGroup>
<h:outputText value="Process Done" />
<a4j:commandButton action="#{progressBarBean.startProcess}"
- value="Restart Process" execute="@form"
+ value="Restart Process" execute="@form" render="pb"
rendered="#{progressBarBean.buttonRendered}"
style="margin: 9px 0px 5px;" />
</h:panelGroup>
Modified: branches/RF-9797/ui/input/ui/src/main/java/org/richfaces/component/AbstractInplaceInput.java
===================================================================
--- branches/RF-9797/ui/input/ui/src/main/java/org/richfaces/component/AbstractInplaceInput.java 2011-01-13 19:52:30 UTC (rev 21009)
+++ branches/RF-9797/ui/input/ui/src/main/java/org/richfaces/component/AbstractInplaceInput.java 2011-01-13 20:02:02 UTC (rev 21010)
@@ -55,16 +55,16 @@
@Attribute(defaultValue="true")
public abstract boolean isSaveOnBlur();
- @Attribute(defaultValue="InplaceState.ready")
+ @Attribute()
public abstract InplaceState getState();
- @Attribute(defaultValue="click")
+ @Attribute()
public abstract String getEditEvent();
- @Attribute(defaultValue="false")
+ @Attribute()
public abstract boolean isShowControls();
- @Attribute(defaultValue="100%")
+ @Attribute()
public abstract String getInputWidth();
@Attribute
Modified: branches/RF-9797/ui/input/ui/src/main/java/org/richfaces/renderkit/InplaceInputRendererBase.java
===================================================================
--- branches/RF-9797/ui/input/ui/src/main/java/org/richfaces/renderkit/InplaceInputRendererBase.java 2011-01-13 19:52:30 UTC (rev 21009)
+++ branches/RF-9797/ui/input/ui/src/main/java/org/richfaces/renderkit/InplaceInputRendererBase.java 2011-01-13 20:02:02 UTC (rev 21010)
@@ -127,7 +127,11 @@
}
public InplaceState getInplaceState(UIComponent component) {
- return ((InplaceComponent) component).getState();
+ InplaceState state = ((InplaceComponent) component).getState();
+ if (state == null) {
+ state = InplaceState.ready;
+ }
+ return state;
}
public String getValue(FacesContext facesContext, UIComponent component) throws IOException {
@@ -197,4 +201,20 @@
String css = component.getNoneClass();
return concatClasses("rf-ii-none", css);
}
+
+ protected String getInputWidth(UIComponent component) {
+ String value = ((AbstractInplaceInput) component).getInputWidth();
+ if (value == null || "".equals(value)) {
+ value = "100%";
+ }
+ return value;
+ }
+
+ protected String getEditEvent(UIComponent component) {
+ String value = ((AbstractInplaceInput) component).getEditEvent();
+ if (value == null || "".equals(value)) {
+ value = "click";
+ }
+ return value;
+ }
}
Modified: branches/RF-9797/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/inplaceSelect.js
===================================================================
--- branches/RF-9797/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/inplaceSelect.js 2011-01-13 19:52:30 UTC (rev 21009)
+++ branches/RF-9797/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/inplaceSelect.js 2011-01-13 20:02:02 UTC (rev 21010)
@@ -17,6 +17,10 @@
this.openOnEdit = mergedOptions.openOnEdit;
this.saveOnSelect = mergedOptions.saveOnSelect;
this.savedIndex = -1;
+
+ this.inputItem = $(document.getElementById(id + "Input"));
+ this.inputItemWidth = this.inputItem.width();
+ this.inputWidthDefined = options.inputWidth !== undefined;
}
rf.ui.InplaceInput.extend(rf.ui.InplaceSelect);
@@ -62,6 +66,7 @@
showPopup: function() {
this.popupList.show();
+ this.__hideLabel();
},
hidePopup: function() {
@@ -128,6 +133,7 @@
saveItemValue: function(value) {
this.selValueInput.val(value);
+ this.__showLabel();
},
getItemLabel: function(item) {
@@ -207,7 +213,21 @@
__onListMouseUp: function(e) {
this.isMouseDown = false;
this.__setInputFocus();
- }
+ },
+
+ __showLabel: function(e) {
+ this.label.show();
+ this.editContainer.css("position", "absolute");
+ this.inputItem.width(this.inputItemWidth);
+ },
+
+ __hideLabel: function(e) {
+ this.label.hide();
+ this.editContainer.css("position", "static");
+ if(!this.inputWidthDefined) {
+ this.inputItem.width(this.label.width());
+ }
+ }
}
})());
Modified: branches/RF-9797/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/select.js
===================================================================
--- branches/RF-9797/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/select.js 2011-01-13 19:52:30 UTC (rev 21009)
+++ branches/RF-9797/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/select.js 2011-01-13 20:02:02 UTC (rev 21010)
@@ -117,6 +117,10 @@
this.btn = $(document.getElementById(id+"Button"));
this.btn.bind("mousedown", $.proxy(this.__onBtnMouseDown, this));
this.btn.bind("mouseup", $.proxy(this.__onMouseUp, this));
+
+ this.fld = $(document.getElementById(id+"Field"));
+ this.fld.bind("mousedown", $.proxy(this.__onBtnMouseDown, this));
+ this.fld.bind("mouseup", $.proxy(this.__onMouseUp, this));
}
this.selectFirst = mergedOptions.selectFirst;
Modified: branches/RF-9797/ui/input/ui/src/main/templates/inplaceInput.template.xml
===================================================================
--- branches/RF-9797/ui/input/ui/src/main/templates/inplaceInput.template.xml 2011-01-13 19:52:30 UTC (rev 21009)
+++ branches/RF-9797/ui/input/ui/src/main/templates/inplaceInput.template.xml 2011-01-13 20:02:02 UTC (rev 21010)
@@ -51,7 +51,7 @@
<input id="#{clientId}Focus" type="image" style="position: absolute; top: 0px; left: 0px; outline-style: none;" class="rf-ii-none"/>
<span id="#{clientId}Edit" class="#{getEditStyleClass(component, inplaceState)}">
<input id="#{clientId}Input" autocomplete="off" name="#{clientId}"
- type="text" value="#{getInputValue(facesContext, component)}" class="rf-ii-fld" style="width: #{component.attributes['inputWidth']};" cdk:passThrough="tabindex">
+ type="text" value="#{getInputValue(facesContext, component)}" class="rf-ii-fld" style="width: #{getInputWidth(component)};" cdk:passThrough="tabindex">
<cdk:call expression="renderInputHandlers(facesContext, component);"/>
</input>
<c:if test="#{component.attributes['showControls']}">
@@ -87,7 +87,8 @@
<cdk:scriptOption name="noneCss" value="#{concatClasses('rf-ii-none', component.attributes['noneStateClass'])}"/>
<cdk:scriptOption name="changedCss" value="#{concatClasses('rf-ii-c-s', component.attributes['changedStateClass'])}"/>
<cdk:scriptOption name="editCss" value="#{concatClasses('rf-ii-e-s', component.attributes['editStateClass'])}"/>
- <cdk:scriptOption attributes="editEvent state defaultLabel saveOnBlur showControls" />
+ <cdk:scriptOption name="editEvent" value="#{getEditEvent(component)}"/>
+ <cdk:scriptOption attributes="state defaultLabel saveOnBlur showControls" />
<cdk:scriptOption attributes="onbegin oncomplete onerror onbeforedomupdate onselectitem onchange onblur onfocus" wrapper="eventHandler"/>
</cdk:scriptObject>
new RichFaces.ui.InplaceInput("#{clientId}", #{toScriptArgs(options)});
Modified: branches/RF-9797/ui/input/ui/src/main/templates/inplaceSelect.template.xml
===================================================================
--- branches/RF-9797/ui/input/ui/src/main/templates/inplaceSelect.template.xml 2011-01-13 19:52:30 UTC (rev 21009)
+++ branches/RF-9797/ui/input/ui/src/main/templates/inplaceSelect.template.xml 2011-01-13 20:02:02 UTC (rev 21010)
@@ -104,7 +104,7 @@
<cdk:scriptOption name="changedCss" value="#{concatClasses('rf-is-c-s', component.attributes['changedStateClass'])}"/>
<cdk:scriptOption name="editCss" value="#{concatClasses('rf-is-e-s', component.attributes['editStateClass'])}"/>
<cdk:scriptOption name="selectItemCss" value="#{concatClasses('rf-is-sel', component.attributes['selectItemClass'])}"/>
- <cdk:scriptOption attributes="editEvent state defaultLabel saveOnBlur showControls openOnEdit saveOnSelect" />
+ <cdk:scriptOption attributes="editEvent state defaultLabel saveOnBlur showControls openOnEdit saveOnSelect inputWidth" />
<cdk:scriptOption attributes="onbegin oncomplete onerror onbeforedomupdate onselectitem onchange onblur onfocus" wrapper="eventHandler"/>
</cdk:scriptObject>
new RichFaces.ui.InplaceSelect("#{clientId}", #{toScriptArgs(options)});
Modified: branches/RF-9797/ui/input/ui/src/main/templates/input.template.inc
===================================================================
--- branches/RF-9797/ui/input/ui/src/main/templates/input.template.inc 2011-01-13 19:52:30 UTC (rev 21009)
+++ branches/RF-9797/ui/input/ui/src/main/templates/input.template.inc 2011-01-13 20:02:02 UTC (rev 21010)
@@ -25,6 +25,7 @@
<span class="rf-insl-inp-cntr">
<input xmlns:cdk="http://jboss.org/schema/richfaces/cdk/core" name="#{clientId}" type="text"
class="rf-insl-inp #{component.attributes['inputClass']}" value="#{getInputValue(facesContext, component)}"
- cdk:passThrough="accesskey disabled size:inputSize tabindex" readonly="#{!component.attributes['enableManualInput']}"
- style="#{component.attributes['showInput'] ? null : 'display: none;'}" maxlength="#{maxlength > 0 ? maxlength : null}"/>
+ cdk:passThrough="accesskey disabled tabindex" readonly="#{!component.attributes['enableManualInput']}"
+ style="#{component.attributes['showInput'] ? null : 'display: none;'}" maxlength="#{maxlength > 0 ? maxlength : null}"
+ size="#{inputSize > 0 ? inputSize : null}"/>
</span>
\ No newline at end of file
Modified: branches/RF-9797/ui/input/ui/src/main/templates/inputnumberslider.template.xml
===================================================================
--- branches/RF-9797/ui/input/ui/src/main/templates/inputnumberslider.template.xml 2011-01-13 19:52:30 UTC (rev 21009)
+++ branches/RF-9797/ui/input/ui/src/main/templates/inputnumberslider.template.xml 2011-01-13 20:02:02 UTC (rev 21010)
@@ -39,7 +39,8 @@
</cc:interface>
<cc:implementation>
<span id="#{clientId}" class="rf-insl #{component.attributes['styleClass']}" cdk:passThroughWithExclusions="id class">
- <cdk:call expression='int maxlength = (Integer) component.getAttributes().get("maxlength");' />
+ <cdk:object name="maxlength" type="Integer" cast="true" value="#{component.attributes['maxlength']}" />
+ <cdk:object name="inputSize" type="Integer" cast="true" value="#{component.attributes['inputSize']}" />
<c:if test="#{isInputPosition(component, 'left') || isInputPosition(component, 'top')}">
<xi:include xpointer="xpointer(/*)" href="input.template.inc" />
<c:if test="#{isInputPosition(component, 'top') and component.attributes['showInput']}">
Modified: branches/RF-9797/ui/input/ui/src/test/java/org/richfaces/renderkit/AutocompleteRendererTest.java
===================================================================
--- branches/RF-9797/ui/input/ui/src/test/java/org/richfaces/renderkit/AutocompleteRendererTest.java 2011-01-13 19:52:30 UTC (rev 21009)
+++ branches/RF-9797/ui/input/ui/src/test/java/org/richfaces/renderkit/AutocompleteRendererTest.java 2011-01-13 20:02:02 UTC (rev 21010)
@@ -55,8 +55,8 @@
Assert.assertNotNull(input);
input.type("al");
- //try 5 times to wait .5 second each for filling the page.
- for (int i = 0; i < 5; i++) {
+ //try 7 times to wait .5 second each for filling the page.
+ for (int i = 0; i < 7; i++) {
synchronized (page) {
page.wait(500);
}
Modified: branches/RF-9797/ui/iteration/ui/src/main/java/org/richfaces/renderkit/AbstractRowsRenderer.java
===================================================================
--- branches/RF-9797/ui/iteration/ui/src/main/java/org/richfaces/renderkit/AbstractRowsRenderer.java 2011-01-13 19:52:30 UTC (rev 21009)
+++ branches/RF-9797/ui/iteration/ui/src/main/java/org/richfaces/renderkit/AbstractRowsRenderer.java 2011-01-13 20:02:02 UTC (rev 21010)
@@ -34,6 +34,7 @@
import org.ajax4jsf.model.DataVisitResult;
import org.ajax4jsf.model.DataVisitor;
import org.richfaces.component.Row;
+import org.richfaces.component.UIDataTableBase;
/**
* @author Anton Belevich
@@ -109,4 +110,46 @@
protected void put(FacesContext context, String key, String value) {
context.getAttributes().put(key, value);
}
+
+ protected String[] getRowClasses(RowHolderBase rowHolder) {
+ String[] rowClasses = new String[0];
+ if (rowHolder.getRow() instanceof UIDataTableBase) {
+ String classes = ((UIDataTableBase)rowHolder.getRow()).getRowClasses();
+ if(null != classes){
+ rowClasses=classes.split(",");
+ }
+ }
+ return rowClasses;
+ }
+
+ protected String[] getColumnClasses(RowHolderBase rowHolder) {
+ String[] columnClasses = new String[0];
+ if (rowHolder.getRow() instanceof UIDataTableBase) {
+ String classes = ((UIDataTableBase)rowHolder.getRow()).getColumnClasses();
+ if(null != classes){
+ columnClasses=classes.split(",");
+ }
+ }
+ return columnClasses;
+ }
+
+ protected String getColumnClass(RowHolderBase rowHolder, int columnNumber) {
+ String styleClass = "";
+ String[] columnClasses = getColumnClasses(rowHolder);
+ if (columnClasses.length > columnNumber) {
+ styleClass = columnClasses[columnNumber];
+ }
+
+ return styleClass;
+ }
+
+ protected String getRowClass(RowHolderBase rowHolder) {
+ String styleClass = "";
+ String[] rowClasses = getRowClasses(rowHolder);
+ if (rowClasses.length > 0) {
+ int styleIndex = rowHolder.getCurrentRow() % rowClasses.length;
+ styleClass = rowClasses[styleIndex];
+ }
+ return styleClass;
+ }
}
Modified: branches/RF-9797/ui/iteration/ui/src/main/java/org/richfaces/renderkit/AbstractTableBaseRenderer.java
===================================================================
--- branches/RF-9797/ui/iteration/ui/src/main/java/org/richfaces/renderkit/AbstractTableBaseRenderer.java 2011-01-13 19:52:30 UTC (rev 21009)
+++ branches/RF-9797/ui/iteration/ui/src/main/java/org/richfaces/renderkit/AbstractTableBaseRenderer.java 2011-01-13 20:02:02 UTC (rev 21010)
@@ -54,15 +54,6 @@
protected static final String CELL_CLASS_KEY = "cellClass";
- public String getColumnClass(RowHolder rowHolder, int columnNumber) {
- String styleClass = "";
- if (rowHolder.getColumnClasses().length > columnNumber) {
- styleClass = rowHolder.getColumnClasses()[columnNumber];
- }
-
- return styleClass;
- }
-
public void encodeColumn(FacesContext context, ResponseWriter writer, UIColumn component, RowHolder rowHolder) throws IOException {
String parentId = rowHolder.getParentClientId();
@@ -77,9 +68,10 @@
if (rowHolder.isRowStart()) {
int currentRow = rowHolder.getCurrentRow();
- if (rowHolder.getRowClasses().length > 0) {
- int indeStyleClass = currentRow % rowHolder.getRowClasses().length;
- String rowClass = rowHolder.getRowClasses()[indeStyleClass];
+ String[] rowClasses = getRowClasses(rowHolder);
+ if (rowClasses.length > 0) {
+ int indeStyleClass = currentRow % rowClasses.length;
+ String rowClass = rowClasses[indeStyleClass];
component.getAttributes().put(ROW_CLASS, rowClass);
}
if (rowHolder.getCurrentRow() == 0) {
Modified: branches/RF-9797/ui/iteration/ui/src/main/java/org/richfaces/renderkit/ExtendedDataTableRenderer.java
===================================================================
--- branches/RF-9797/ui/iteration/ui/src/main/java/org/richfaces/renderkit/ExtendedDataTableRenderer.java 2011-01-13 19:52:30 UTC (rev 21009)
+++ branches/RF-9797/ui/iteration/ui/src/main/java/org/richfaces/renderkit/ExtendedDataTableRenderer.java 2011-01-13 20:02:02 UTC (rev 21010)
@@ -759,6 +759,12 @@
RendererState state = (RendererState) rowHolder;
UIDataTableBase table = state.getRow();
writer.startElement(HtmlConstants.TR_ELEMENT, table);
+
+ String rowClass = getRowClass(rowHolder);
+ if (!"".equals(rowClass)) {
+ writer.writeAttribute(HtmlConstants.CLASS_ATTRIBUTE, rowClass, null);
+ }
+
StringBuilder builder = new StringBuilder();
Collection<Object> selection = table.getSelection();
if (selection != null && selection.contains(table.getRowKey())) {
@@ -784,10 +790,18 @@
writer.writeAttribute(HtmlConstants.ID_ATTRIBUTE,
table.getClientId(facesContext) + ":" + part.getName().getId(), null);
columns = part.getColumns().iterator();
+ int columnNumber = 0;
while (columns.hasNext()) {
UIComponent column = (UIComponent) columns.next();
if (column.isRendered()) {
writer.startElement(HtmlConstants.TD_ELEM, table);
+
+ String columnClass = getColumnClass(rowHolder, columnNumber);
+ if (!"".equals(columnClass)) {
+ writer.writeAttribute(HtmlConstants.CLASS_ATTRIBUTE, columnClass, null);
+ }
+ columnNumber++;
+
writer.startElement(HtmlConstants.DIV_ELEM, table);
writer.writeAttribute(HtmlConstants.CLASS_ATTRIBUTE, "rf-edt-c rf-edt-c-"
+ column.getId(), null);
Modified: branches/RF-9797/ui/iteration/ui/src/main/java/org/richfaces/renderkit/RowHolder.java
===================================================================
--- branches/RF-9797/ui/iteration/ui/src/main/java/org/richfaces/renderkit/RowHolder.java 2011-01-13 19:52:30 UTC (rev 21009)
+++ branches/RF-9797/ui/iteration/ui/src/main/java/org/richfaces/renderkit/RowHolder.java 2011-01-13 20:02:02 UTC (rev 21010)
@@ -25,7 +25,6 @@
import javax.faces.context.FacesContext;
import org.richfaces.component.Row;
-import org.richfaces.component.UIDataTableBase;
/**
* @author Anton Belevich
@@ -43,10 +42,6 @@
private boolean encodeParentTBody;
- private String[] rowClasses = new String[0];
-
- private String[] columnClasses = new String[0];
-
public RowHolder(FacesContext context, Row row) {
this(context, row, 0, true);
}
@@ -55,17 +50,6 @@
super(context);
this.row = row;
this.parentClientId = row.getClientId(context);
-
- if (row instanceof UIDataTableBase) {
- String classes = ((UIDataTableBase)row).getRowClasses();
- if(null != classes){
- rowClasses=classes.split(",");
- }
- classes = (String) ((UIDataTableBase)row).getColumnClasses();
- if(null != classes){
- columnClasses=classes.split(",");
- }
- }
}
public boolean isEncodeParentTBody() {
@@ -103,12 +87,4 @@
public void setRowStart(boolean isRowStart) {
this.isRowStart = isRowStart;
}
-
- public String[] getRowClasses() {
- return this.rowClasses;
- }
-
- public String[] getColumnClasses() {
- return this.columnClasses;
- }
}
Modified: branches/RF-9797/ui/output/ui/src/main/java/org/richfaces/renderkit/html/ToolbarRendererBase.java
===================================================================
--- branches/RF-9797/ui/output/ui/src/main/java/org/richfaces/renderkit/html/ToolbarRendererBase.java 2011-01-13 19:52:30 UTC (rev 21009)
+++ branches/RF-9797/ui/output/ui/src/main/java/org/richfaces/renderkit/html/ToolbarRendererBase.java 2011-01-13 20:02:02 UTC (rev 21010)
@@ -243,7 +243,8 @@
}
writer.startElement(HtmlConstants.TD_ELEM, component);
- writer.write(" ");
+ writer.writeAttribute(HtmlConstants.CLASS_ATTRIBUTE, concatClasses("rf-tb-emp", itemClass), null);
+ writer.writeText("\u00a0", null);
writer.endElement(HtmlConstants.TD_ELEM);
for (Iterator<UIComponent> it = childrenToTheRight.iterator(); it.hasNext();) {
@@ -325,7 +326,7 @@
String itemSeparatorClass = "rf-tb-sep-" + separator.toString().toLowerCase();
writer.startElement(HtmlConstants.DIV_ELEM, component);
writer.writeAttribute(HtmlConstants.CLASS_ATTRIBUTE, itemSeparatorClass, null);
- writer.write(" ");
+ writer.writeText("\u00a0", null);
writer.endElement(HtmlConstants.DIV_ELEM);
} else {
13 years, 11 months
JBoss Rich Faces SVN: r21009 - branches/RF-9797.
by richfaces-svn-commits@lists.jboss.org
Author: alexsmirnov
Date: 2011-01-13 14:52:30 -0500 (Thu, 13 Jan 2011)
New Revision: 21009
Modified:
branches/RF-9797/
Log:
Initialized merge tracking via "svnmerge" with revisions "1-20978" from
https://svn.jboss.org/repos/richfaces/trunk
Property changes on: branches/RF-9797
___________________________________________________________________
Name: svnmerge-integrated
+ /trunk:1-20978
13 years, 11 months
JBoss Rich Faces SVN: r21007 - branches/RF-9797.
by richfaces-svn-commits@lists.jboss.org
Author: alexsmirnov
Date: 2011-01-13 14:51:13 -0500 (Thu, 13 Jan 2011)
New Revision: 21007
Modified:
branches/RF-9797/
Log:
Removed merge tracking for "svnmerge" for
https://svn.jboss.org/repos/richfaces/branches/RF-9309
Property changes on: branches/RF-9797
___________________________________________________________________
Name: svnmerge-integrated
- /branches/RF-9309:1-19112,19378 /branches/RF-9323:1-20621
+ /branches/RF-9323:1-20621
13 years, 11 months
JBoss Rich Faces SVN: r21006 - branches/RF-9797.
by richfaces-svn-commits@lists.jboss.org
Author: alexsmirnov
Date: 2011-01-13 14:50:59 -0500 (Thu, 13 Jan 2011)
New Revision: 21006
Modified:
branches/RF-9797/
Log:
Removed merge tracking for "svnmerge" for
https://svn.jboss.org/repos/richfaces/branches/RF-8742
Property changes on: branches/RF-9797
___________________________________________________________________
Name: svnmerge-integrated
- /branches/RF-8742:1-19867 /branches/RF-9309:1-19112,19378 /branches/RF-9323:1-20621
+ /branches/RF-9309:1-19112,19378 /branches/RF-9323:1-20621
13 years, 11 months