JBoss Rich Faces SVN: r10246 - in trunk/ui/inplaceSelect/src/main: templates and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: vmolotkov
Date: 2008-08-29 14:12:51 -0400 (Fri, 29 Aug 2008)
New Revision: 10246
Modified:
trunk/ui/inplaceSelect/src/main/resources/org/richfaces/renderkit/html/scripts/inplaceselect.js
trunk/ui/inplaceSelect/src/main/templates/inplaceselect.jspx
Log:
https://jira.jboss.org/jira/browse/RF-4337
Modified: trunk/ui/inplaceSelect/src/main/resources/org/richfaces/renderkit/html/scripts/inplaceselect.js
===================================================================
--- trunk/ui/inplaceSelect/src/main/resources/org/richfaces/renderkit/html/scripts/inplaceselect.js 2008-08-29 18:12:15 UTC (rev 10245)
+++ trunk/ui/inplaceSelect/src/main/resources/org/richfaces/renderkit/html/scripts/inplaceselect.js 2008-08-29 18:12:51 UTC (rev 10246)
@@ -57,6 +57,7 @@
endEditableState : function($super) {
$super();
+ //this.button.style.display = 'none';
this.button.hide();
},
@@ -279,6 +280,7 @@
$super(e, "");
}
}
+
});
Modified: trunk/ui/inplaceSelect/src/main/templates/inplaceselect.jspx
===================================================================
--- trunk/ui/inplaceSelect/src/main/templates/inplaceselect.jspx 2008-08-29 18:12:15 UTC (rev 10245)
+++ trunk/ui/inplaceSelect/src/main/templates/inplaceselect.jspx 2008-08-29 18:12:51 UTC (rev 10246)
@@ -16,6 +16,7 @@
<h:scripts>
new org.ajax4jsf.javascript.PrototypeScript(),
+ /org/richfaces/renderkit/html/scripts/jquery/jquery.js,
scripts/comboboxUtils.js,
scripts/combolist.js,
scripts/inplaceinput.js,
16 years, 4 months
JBoss Rich Faces SVN: r10245 - in trunk/ui/combobox/src/main: templates and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: vmolotkov
Date: 2008-08-29 14:12:15 -0400 (Fri, 29 Aug 2008)
New Revision: 10245
Modified:
trunk/ui/combobox/src/main/resources/org/richfaces/renderkit/html/scripts/combolist.js
trunk/ui/combobox/src/main/templates/combobox.jspx
Log:
https://jira.jboss.org/jira/browse/RF-4337
Modified: trunk/ui/combobox/src/main/resources/org/richfaces/renderkit/html/scripts/combolist.js
===================================================================
--- trunk/ui/combobox/src/main/resources/org/richfaces/renderkit/html/scripts/combolist.js 2008-08-29 18:08:43 UTC (rev 10244)
+++ trunk/ui/combobox/src/main/resources/org/richfaces/renderkit/html/scripts/combolist.js 2008-08-29 18:12:15 UTC (rev 10245)
@@ -88,9 +88,10 @@
this.listParent.hide();
this.listParent.style.visibility = "visible";
+ //attach list to the document body
+ this.injectListToBody(this.listParent);
+
this.setPosition(this.fieldDimensions.top, this.fieldDimensions.left, this.fieldDimensions.height);
- //attach list to the document body
- this.injectListToBody(this.listParent);
if (this.selectedItem) {
//was created new item list, so necessary to recreate selectedItem
@@ -221,25 +222,32 @@
setPosition : function(fieldTop, fieldLeft, fieldHeight) {
var component = this.listParent.parentNode;
- component.style.position = "relative";
+ //component.style.position = "relative";
component.style.zIndex = 2;
var docHeight = Richfaces.getDocumentHeight();
var comBottom = fieldTop + fieldHeight;
var listHeight = parseInt(this.list.style.height) + Richfaces.getBorderWidth(this.list.parentNode, "tb");
var topPosition = comBottom;
-
+
+ var showPoint = fieldHeight;
if (parseInt(listHeight) > (docHeight - comBottom)) {
if (topPosition > (docHeight - comBottom)) {
- topPosition = fieldTop - parseInt(listHeight);
+ //topPosition = fieldTop - parseInt(listHeight);
+ showPoint = -parseInt(listHeight);
+
}
}
- this.listParent.style.left = fieldLeft + "px";
+ /*this.listParent.style.left = fieldLeft + "px";
this.listParent.style.top = topPosition + "px";
if (this.iframe) {
this.iframe.style.top = topPosition + "px";
this.iframe.style.left = fieldLeft + "px";
+ }*/
+ this.clonePosition(this.listParent, this.fieldElem, showPoint);
+ if (this.iframe) {
+ this.clonePosition(this.iframe, this.fieldElem, showPoint);
}
},
@@ -422,7 +430,60 @@
// parentElem.appendChild(iframe);
parentElem.insertBefore(iframe,parentElem.firstChild);
this.iframe = $(iframe.id);
- }
+ },
+
+ PX_REGEX: /px$/,
+
+ parseToPx: function(value) {
+ var v = value.strip();
+ if (this.PX_REGEX.test(v)) {
+ try {
+ return parseFloat(v.replace(this.PX_REGEX, ""));
+ } catch (e) {
+
+ }
+ }
+
+ return NaN;
+ },
+
+ clonePosition: function(target, source, vOffset) {
+ var jqt = jQuery(target);
+ var jqs = jQuery(source);
+ var so = jqs.offset();
+
+ var hidden = (jqt.css('display') == 'none');
+ var oldVisibility;
+
+ if (hidden) {
+ oldVisibility = jqt.css('visibility');
+ jqt.css('visibility', 'hidden').css('display', '');
+ }
+
+ var left = this.parseToPx(jqt.css('left'));
+ if (isNaN(left)) {
+ left = 0;
+ jqt.css('left', '0px');
+ }
+
+ var top = this.parseToPx(jqt.css('top'));
+ if (isNaN(top)) {
+ top = 0;
+ jqt.css('top', '0px');
+ }
+
+ var to = jqt.offset();
+
+ if (hidden) {
+ jqt.css('display', 'none').css('visibility', oldVisibility);
+ }
+
+ // set position
+ jqt.css({
+ left: (so.left - to.left + left) + 'px',
+ top: (so.top - to.top + top + vOffset) + 'px'
+ });
+ }
}
Richfaces.ComboBoxList.getElemXY = function(elem) {
Modified: trunk/ui/combobox/src/main/templates/combobox.jspx
===================================================================
--- trunk/ui/combobox/src/main/templates/combobox.jspx 2008-08-29 18:08:43 UTC (rev 10244)
+++ trunk/ui/combobox/src/main/templates/combobox.jspx 2008-08-29 18:12:15 UTC (rev 10245)
@@ -17,6 +17,7 @@
<h:styles>css/combobox.xcss</h:styles>
<h:scripts>
new org.ajax4jsf.javascript.PrototypeScript(),
+ /org/richfaces/renderkit/html/scripts/jquery/jquery.js,
scripts/comboboxUtils.js,
scripts/combolist.js,
scripts/combobox.js,
16 years, 4 months
JBoss Rich Faces SVN: r10244 - in trunk/ui/fileUpload/src/main: templates/org/richfaces and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: dmorozov
Date: 2008-08-29 14:08:43 -0400 (Fri, 29 Aug 2008)
New Revision: 10244
Modified:
trunk/ui/fileUpload/src/main/resources/org/richfaces/renderkit/html/css/fileUpload.xcss
trunk/ui/fileUpload/src/main/templates/org/richfaces/fileUpload.jspx
Log:
https://jira.jboss.org/jira/browse/RF-4252
Modified: trunk/ui/fileUpload/src/main/resources/org/richfaces/renderkit/html/css/fileUpload.xcss
===================================================================
--- trunk/ui/fileUpload/src/main/resources/org/richfaces/renderkit/html/css/fileUpload.xcss 2008-08-29 15:56:54 UTC (rev 10243)
+++ trunk/ui/fileUpload/src/main/resources/org/richfaces/renderkit/html/css/fileUpload.xcss 2008-08-29 18:08:43 UTC (rev 10244)
@@ -91,15 +91,12 @@
<u:style name="padding" value="2px" />
</u:selector>
-
-
-<u:selector name="a.rich-fileupload-button-selection">
+<u:selector name=".rich-fileupload-button-content">
<u:style name="color" skin="generalTextColor" />
<u:style name="text-decoration" value="none" />
<u:style name="display" value="block" />
</u:selector>
-
<u:selector name=".rich-fileupload-button">
<u:style name="background-repeat" value="repeat-x" />
<u:style name="background-position" value="top left" />
Modified: trunk/ui/fileUpload/src/main/templates/org/richfaces/fileUpload.jspx
===================================================================
--- trunk/ui/fileUpload/src/main/templates/org/richfaces/fileUpload.jspx 2008-08-29 15:56:54 UTC (rev 10243)
+++ trunk/ui/fileUpload/src/main/templates/org/richfaces/fileUpload.jspx 2008-08-29 18:08:43 UTC (rev 10244)
@@ -83,8 +83,7 @@
<div class="rich-fileupload-button-border" style=" float:left;">
<div class="#{addButtonClass}" onmouseover="this.className='rich-fileupload-button-light rich-fileupload-font'" onmousedown="this.className='rich-fileupload-button-press rich-fileupload-font'" onmouseup="this.className='rich-fileupload-button rich-fileupload-font'" onmouseout="this.className='rich-fileupload-button rich-fileupload-font'"
style="position: relative;"
- id="#{clientId}:add1"
- >
+ id="#{clientId}:add1">
<div class="#{addButtonClassContent}"
id="#{clientId}:add2"
style="position: relative;">#{addLabel}</div>
@@ -101,14 +100,13 @@
<div class="rich-fileupload-button-border" style=" float:left; display: none;">
<div class="rich-file-upload-button rich-fileupload-font #{component.attributes['uploadButtonClass']}" onmouseover="this.className='rich-fileupload-button-light rich-fileupload-font'" onmousedown="this.className='rich-fileupload-button-press rich-fileupload-font'" onmouseup="this.className='rich-fileupload-button rich-fileupload-font'"
onmouseout="this.className='rich-fileupload-button rich-fileupload-font'"
+ style="position: relative;"
id="#{clientId}:upload1"
onclick="return $('#{clientId}').component.upload();">
- <a href="#" class="rich-fileupload-button-selection">
<div class="rich-fileupload-button-content rich-fileupload-font rich-fileupload-ico rich-fileupload-ico-start #{component.attributes['uploadButtonClass']}"
id="#{clientId}:upload2">
#{uploadLabel}
</div>
- </a>
</div>
</div>
@@ -116,11 +114,10 @@
<div class="rich-fileupload-button rich-fileupload-font #{component.attributes['cleanButtonClass']}" onmouseover="this.className='rich-fileupload-button-light rich-fileupload-font'" onmousedown="this.className='rich-fileupload-button-press rich-fileupload-font'" onmouseup="this.className='rich-fileupload-button rich-fileupload-font'"
onmouseout="this.className='rich-fileupload-button rich-fileupload-font'"
onclick="return $('#{clientId}').component.clear();"
+ style="position: relative;"
id="#{clientId}:clean1">
- <a href="#" class="rich-fileupload-button-selection">
<div class="rich-fileupload-button-content rich-fileupload-font rich-fileupload-ico rich-fileupload-ico-clear-dis #{component.attributes['cleanButtonClass']}"
id="#{clientId}:clean2">#{clearAllLabel}</div>
- </a>
</div>
</div>
</td>
16 years, 4 months
JBoss Rich Faces SVN: r10243 - trunk/docs/userguide/en/src/main/docbook/included.
by richfaces-svn-commits@lists.jboss.org
Author: atsebro
Date: 2008-08-29 11:56:54 -0400 (Fri, 29 Aug 2008)
New Revision: 10243
Modified:
trunk/docs/userguide/en/src/main/docbook/included/extendedDataTable.desc.xml
Log:
RF-4131:extendedDataTable-Documenting
Modified: trunk/docs/userguide/en/src/main/docbook/included/extendedDataTable.desc.xml
===================================================================
--- trunk/docs/userguide/en/src/main/docbook/included/extendedDataTable.desc.xml 2008-08-29 15:45:48 UTC (rev 10242)
+++ trunk/docs/userguide/en/src/main/docbook/included/extendedDataTable.desc.xml 2008-08-29 15:56:54 UTC (rev 10243)
@@ -16,7 +16,8 @@
<title>Description</title>
<note>
<title>Note:</title>
- <para>The component is released with "Preview" marker</para>
+ <para>The component is in a preview state for 3.2.2 release because it was
+ not fully tested and reviewed by the RF team.</para>
</note>
<para>The component for tables extending standard component <emphasis
role="bold">
16 years, 4 months
JBoss Rich Faces SVN: r10242 - in trunk/samples/richfaces-demo/src/main/webapp/richfaces: suggestionBox and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: smukhina
Date: 2008-08-29 11:45:48 -0400 (Fri, 29 Aug 2008)
New Revision: 10242
Modified:
trunk/samples/richfaces-demo/src/main/webapp/richfaces/extendedDataTable/usage.xhtml
trunk/samples/richfaces-demo/src/main/webapp/richfaces/suggestionBox/usage.xhtml
Log:
https://jira.jboss.org/jira/browse/RF-398- text on demo site is corrected
Modified: trunk/samples/richfaces-demo/src/main/webapp/richfaces/extendedDataTable/usage.xhtml
===================================================================
--- trunk/samples/richfaces-demo/src/main/webapp/richfaces/extendedDataTable/usage.xhtml 2008-08-29 15:41:11 UTC (rev 10241)
+++ trunk/samples/richfaces-demo/src/main/webapp/richfaces/extendedDataTable/usage.xhtml 2008-08-29 15:45:48 UTC (rev 10242)
@@ -10,19 +10,19 @@
<style>
.top{
vertical-align:top;
- }
+ }
</style>
<p>
This is <b>dataTable extension component</b> contributed to the Rich Faces from
- the community. It adds next features to the rich:dataTable component:
+ the community. It adds the next features to the rich:dataTable component:
</p>
<ul>
- <li><b>Scrolling data</b> on the client and usage scrolling together with paggination</li>
- <li><b>Selection of rows</b> with management of the selection on server through simple binding</li>
- <li>Management the <b>modes of the selection</b> (none, single line or multiple lines)</li>
+ <li><b>Scrolling data</b> on the client and usage scrolling together with pagination</li>
+ <li><b>Selection of rows</b> with management of the selection on server via simple binding</li>
+ <li>Management of the <b>modes of the selection</b> (none, single line or multiple lines)</li>
<li><b>Columns reordering</b> using drag and drop of the headers</li>
- <li><b>Showing/hiding columns </b>through built-in context menu</li>
- <li><b>State saving </b>through value binding</li>
+ <li><b>Showing/hiding columns </b>via built-in context menu</li>
+ <li><b>State saving </b>via value binding</li>
<li><b>Grouping rows </b>by any column</li>
</ul>
<p>
Modified: trunk/samples/richfaces-demo/src/main/webapp/richfaces/suggestionBox/usage.xhtml
===================================================================
--- trunk/samples/richfaces-demo/src/main/webapp/richfaces/suggestionBox/usage.xhtml 2008-08-29 15:41:11 UTC (rev 10241)
+++ trunk/samples/richfaces-demo/src/main/webapp/richfaces/suggestionBox/usage.xhtml 2008-08-29 15:45:48 UTC (rev 10242)
@@ -12,8 +12,8 @@
<p>RichFaces Suggestion Box component adds the autocomplete
capability to the existing input component such as h:inputText or
- t:inputText. Use the attribute 'for', in order to pint to the necessary input component
- to add the autocomplete capabity to it.</p>
+ t:inputText. Use the attribute 'for', in order to ping to the necessary input component
+ to add the autocomplete capability to it.</p>
<p>Working with Suggestion Box is similar to the h:dataTable
component, but instead of the 'value' attribute it has a
suggestionAction attribute that points to the method that returns the
@@ -32,12 +32,12 @@
</fieldset>
<p>
- And below there is second example of new JS API and Objects selection feature usage.
+ And below there is the second example of new JS API and Objects selection feature usage.
</p>
<p>
Just choose some state from suggestion and capital name property will be fetched
using client side API (Some of the capitals could be fetched separated with coma).
- No requests need anymore. You could just store needed
+ No requests are required anymore. You could just store needed
properties in the same manner in hidden fields for example.
</p>
<fieldset class="demo_fieldset">
16 years, 4 months
JBoss Rich Faces SVN: r10241 - trunk/docs/userguide/en/src/main/docbook/included.
by richfaces-svn-commits@lists.jboss.org
Author: atsebro
Date: 2008-08-29 11:41:11 -0400 (Fri, 29 Aug 2008)
New Revision: 10241
Modified:
trunk/docs/userguide/en/src/main/docbook/included/ajaxValidator.xml
trunk/docs/userguide/en/src/main/docbook/included/beanValidator.xml
trunk/docs/userguide/en/src/main/docbook/included/graphValidator.xml
Log:
RF-3903: Documenting-Validator tags
Modified: trunk/docs/userguide/en/src/main/docbook/included/ajaxValidator.xml
===================================================================
--- trunk/docs/userguide/en/src/main/docbook/included/ajaxValidator.xml 2008-08-29 15:37:53 UTC (rev 10240)
+++ trunk/docs/userguide/en/src/main/docbook/included/ajaxValidator.xml 2008-08-29 15:41:11 UTC (rev 10241)
@@ -1,202 +1,190 @@
<?xml version="1.0" encoding="UTF-8"?>
<section>
- <sectioninfo>
- <keywordset>
- <keyword>rich:ajaxValidator</keyword>
- </keywordset>
- </sectioninfo>
+ <sectioninfo>
+ <keywordset>
+ <keyword>rich:ajaxValidator</keyword>
+ </keywordset>
+ </sectioninfo>
- <table>
- <title>Component identification parameters</title>
+ <table>
+ <title>Component identification parameters</title>
- <tgroup cols="2">
- <thead>
- <row>
- <entry>Name</entry>
+ <tgroup cols="2">
+ <thead>
+ <row>
+ <entry>Name</entry>
- <entry>Value</entry>
- </row>
- </thead>
+ <entry>Value</entry>
+ </row>
+ </thead>
- <tbody>
- <row>
- <entry>component-type</entry>
+ <tbody>
+ <row>
+ <entry>component-type</entry>
- <entry>org.richfaces.ajaxValidator</entry>
- </row>
+ <entry>org.richfaces.ajaxValidator</entry>
+ </row>
- <row>
- <entry>component-class</entry>
+ <row>
+ <entry>component-class</entry>
- <entry>org.richfaces.component.html.HtmlajaxValidator</entry>
- </row>
+ <entry>org.richfaces.component.html.HtmlajaxValidator</entry>
+ </row>
- <row>
- <entry>component-family</entry>
+ <row>
+ <entry>component-family</entry>
- <entry>org.richfaces.ajaxValidator</entry>
- </row>
+ <entry>org.richfaces.ajaxValidator</entry>
+ </row>
- <row>
- <entry>renderer-type</entry>
+ <row>
+ <entry>renderer-type</entry>
- <entry>org.richfaces.ajaxValidatorRenderer</entry>
- </row>
+ <entry>org.richfaces.ajaxValidatorRenderer</entry>
+ </row>
- <row>
- <entry>tag-class</entry>
+ <row>
+ <entry>tag-class</entry>
- <entry>org.richfaces.taglib.ajaxValidatorTag</entry>
- </row>
- </tbody>
- </tgroup>
- </table>
+ <entry>org.richfaces.taglib.ajaxValidatorTag</entry>
+ </row>
+ </tbody>
+ </tgroup>
+ </table>
- <section>
- <title>Creating the Component with a Page Tag</title>
+ <section>
+ <title>Creating the Component with a Page Tag</title>
- <para>To create the simplest variant on a page use the following syntax:</para>
+ <para>To create the simplest variant on a page use the following syntax:</para>
- <para>
- <emphasis role="bold">Example:</emphasis>
- </para>
- <programlisting role="XML"><![CDATA[...
- <h:outputText value="Name:" />
- <h:inputText value="#{userBean.name}" id="name" required="true">
- <f:validateLength minimum="3" maximum="12"/>
- <rich:ajaxValidator event="onblur"/>
- </h:inputText>
+ <para>
+ <emphasis role="bold">Example:</emphasis>
+ </para>
+ <programlisting role="XML"><![CDATA[...
+<h:outputText value="Name:" />
+<h:inputText value="#{userBean.name}" id="name" required="true">
+ <f:validateLength minimum="3" maximum="12"/>
+ <rich:ajaxValidator event="onblur"/>
+</h:inputText>
...]]></programlisting>
- </section>
+ </section>
- <section>
- <title>Creating the Component Dynamically Using Java</title>
+ <section>
+ <title>Creating the Component Dynamically Using Java</title>
- <para>
- <emphasis role="bold">Example:</emphasis>
- </para>
- <programlisting role="JAVA"><![CDATA[import org.richfaces.component.html.HtmlCalendar;
+ <para>
+ <emphasis role="bold">Example:</emphasis>
+ </para>
+ <programlisting role="JAVA"><![CDATA[import org.richfaces.component.html.HtmlCalendar;
...
HtmlAjaxValidator myAjaxValidator= new HtmlAjaxValidator();
...
]]></programlisting>
- </section>
- <section>
- <title>Details of Usage</title>
-
- <para>The <emphasis role="bold"><property><rich:ajaxValidator></property></emphasis> component should
- be added as a child component to an input JSF tag which data
- should be validated and an event that triggers validation should be specified as well.
- The component is ajaxSingle by default so only the current field will be validated.</para>
-
-
- <para>The following example demonstrates how the <emphasis role="bold"><property><rich:ajaxValidator></property></emphasis> adds AJAX functionality to standard JSF validators.
- The request is sent when the input field loses focus,
- the action is determined by the <emphasis><property>"event"</property></emphasis> attribute that is set to <code>"onblur"</code>.
- </para>
-
-
-
- <programlisting role="XML"><![CDATA[...
- <h:form>
- <rich:panel>
- <f:facet name="header">
- <h:outputText value="User Info:" />
- </f:facet>
- <h:panelGrid columns="3">
-
- <h:outputText value="Name:" />
- <h:inputText value="#{userBean.name}" id="name" required="true">
- <f:validateLength minimum="3" maximum="12"/>
- <rich:ajaxValidator event="onblur"/>
- </h:inputText>
- <rich:message for="name" />
-
- <h:outputText value="Age:" />
- <h:inputText value="#{userBean.age}" id="age" required="true">
- <f:convertNumber integerOnly="true"/>
- <f:validateLongRange minimum="18" maximum="99"/>
- <rich:ajaxValidator event="onblur"/>
- </h:inputText>
- <rich:message for="age"/>
-
- </h:panelGrid>
- </rich:panel>
- </h:form>
- ...]]></programlisting>
-
- <para>This is the result of the snippet. </para>
-
-
- <figure>
- <title>Simple example of <emphasis role="bold"><property><rich:ajaxValidator></property></emphasis>with
-</title>
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/ajaxValidator1.png"/>
- </imageobject>
- </mediaobject>
- </figure>
-
-
- <para>In the example above it's show how to work with standard JSF validators.
- The <emphasis role="bold"><property><rich:ajaxValidator></property></emphasis> component also works perfectly with
- custom validators enhancing their usage with AJAX.
- </para>
+ </section>
+ <section>
+ <title>Details of Usage</title>
- <para>
- Custom validation can be performed in two ways:
- </para>
-
- <itemizedlist>
- <listitem><para>Using JSF Validation API is available in javax.faces.validator package</para></listitem>
- <listitem><para>Using Hibernate Validator, specifying a constraint for the data to be validated. A reference on Hibernate Validator can be found <ulink url="http://www.hibernate.org/hib_docs/validator/reference/en/html_single/">here</ulink>.</para></listitem>
- </itemizedlist>
-
- <para>
- The following example shows how the data entered by user can be validated using Hibernate Validator.
- </para>
+ <para>The <emphasis role="bold">
+ <property><rich:ajaxValidator></property>
+ </emphasis> component should be added as a child component to an input
+ JSF tag which data should be validated and an event that triggers
+ validation should be specified as well. The component is ajaxSingle by
+ default so only the current field will be validated.</para>
- <programlisting role="XML"><![CDATA[...
- <rich:panel>
- <f:facet name="header">
- <h:outputText value="User Info:" />
- </f:facet>
- <h:panelGrid columns="3">
-
- <h:outputText value="Name:" />
- <h:inputText value="#{validationBean.name}" id="name" required="true">
- <rich:ajaxValidator event="onblur" />
- </h:inputText>
- <rich:message for="name" />
- <h:outputText value="Email:" />
- <h:inputText value="#{validationBean.email}" id="email">
- <rich:ajaxValidator event="onblur" />
- </h:inputText>
- <rich:message for="email" />
- <h:outputText value="Age:" />
- <h:inputText value="#{validationBean.age}" id="age">
- <rich:ajaxValidator event="onblur" />
- </h:inputText>
- <rich:message for="age" />
- </h:panelGrid>
- </rich:panel>
- ...]]></programlisting>
-
-
- <para>Here is the source code of the managed bean.</para>
-
-
- <programlisting role="JAVA"><![CDATA[...
+
+ <para>The following example demonstrates how the <emphasis role="bold">
+ <property><rich:ajaxValidator></property>
+ </emphasis> adds AJAX functionality to standard JSF validators. The
+ request is sent when the input field loses focus, the action is
+ determined by the <emphasis>
+ <property>"event"</property>
+ </emphasis> attribute that is set to
+ <code>"onblur"</code>. </para>
+
+
+
+ <programlisting role="XML"><![CDATA[...
+<rich:panel>
+ <f:facet name="header">
+ <h:outputText value="User Info:" />
+ </f:facet>
+ <h:panelGrid columns="3">
+ <h:outputText value="Name:" />
+ <h:inputText value="#{userBean.name}" id="name" required="true">
+ <f:validateLength minimum="3" maximum="12"/>
+ <rich:ajaxValidator event="onblur"/>
+ </h:inputText>
+ <rich:message for="name" />
+ </h:panelGrid>
+</rich:panel>
+...]]></programlisting>
+
+ <para>This is the result of the snippet. </para>
+
+
+ <figure>
+ <title>Simple example of <emphasis role="bold">
+ <property><rich:ajaxValidator></property>
+ </emphasis>with </title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/ajaxValidator1.png"/>
+ </imageobject>
+ </mediaobject>
+ </figure>
+
+
+ <para>In the example above it's show how to work with standard JSF validators.
+ The <emphasis role="bold">
+ <property><rich:ajaxValidator></property>
+ </emphasis> component also works perfectly with custom validators
+ enhancing their usage with AJAX. </para>
+
+ <para> Custom validation can be performed in two ways: </para>
+
+ <itemizedlist>
+ <listitem>
+ <para>Using JSF Validation API is available in
+ javax.faces.validator package</para>
+ </listitem>
+ <listitem>
+ <para>Using Hibernate Validator, specifying a constraint for
+ the data to be validated. A reference on Hibernate
+ Validator can be found <ulink
+ url="http://www.hibernate.org/hib_docs/validator/reference/en/html_single/"
+ >here</ulink>.</para>
+ </listitem>
+ </itemizedlist>
+
+ <para> The following example shows how the data entered by user can be validated
+ using Hibernate Validator. </para>
+
+ <programlisting role="XML"><![CDATA[...
+<rich:panel>
+ <f:facet name="header">
+ <h:outputText value="User Info:" />
+ </f:facet>
+ <h:panelGrid columns="3">
+ <h:outputText value="Name:" />
+ <h:inputText value="#{validationBean.name}" id="name" required="true">
+ <rich:ajaxValidator event="onblur" />
+ </h:inputText>
+ <rich:message for="name" />
+ </h:panelGrid>
+</rich:panel>
+...]]></programlisting>
+
+
+ <para>Here is the source code of the managed bean.</para>
+
+
+ <programlisting role="JAVA"><![CDATA[...
package org.richfaces.demo.validation;
+import org.hibernate.validator.NotEmpty;
import org.hibernate.validator.Email;
import org.hibernate.validator.Length;
-import org.hibernate.validator.Max;
-import org.hibernate.validator.Min;
-import org.hibernate.validator.NotEmpty;
-import org.hibernate.validator.NotNull;
public class ValidationBean {
@@ -206,11 +194,7 @@
@Email (message="wrong email format")
@NotEmpty
private String email;
- @NotNull
- @Min(18)
- @Max(100)
- private int age;
-
+
public ValidationBean() {
}
public String getName() {
@@ -225,32 +209,26 @@
public void setEmail(String email) {
this.email = email;
}
- public int getAge() {
- return age;
- }
- public void setAge(int age) {
- this.age = age;
- }
}
-...]]></programlisting>
-
- <para>By default the Hibernate Validator generates an error message in 10 language, though you can redefine the messages that are displayed to a user when validation fails. In the shows example it was done by adding <code>(message="wrong email format")</code> to the <code>@Email</code> annotation.</para>
-
- <para>This is how it looks. </para>
- <figure>
- <title>Validation using Hibernate validator
- </title>
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/ajaxValidator2.png"/>
- </imageobject>
- </mediaobject>
- </figure>
-
-
- </section>
-
-</section>
+...]]></programlisting>
+ <para>By default the Hibernate Validator generates an error message in 10
+ language, though you can redefine the messages that are displayed to a
+ user when validation fails. In the shows example it was done by adding
+ <code>(message="wrong email
+ format")</code> to the <code>@Email</code> annotation.</para>
+ <para>This is how it looks. </para>
+ <figure>
+ <title>Validation using Hibernate validator </title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/ajaxValidator2.png"/>
+ </imageobject>
+ </mediaobject>
+ </figure>
+
+ </section>
+
+</section>
Modified: trunk/docs/userguide/en/src/main/docbook/included/beanValidator.xml
===================================================================
--- trunk/docs/userguide/en/src/main/docbook/included/beanValidator.xml 2008-08-29 15:37:53 UTC (rev 10240)
+++ trunk/docs/userguide/en/src/main/docbook/included/beanValidator.xml 2008-08-29 15:41:11 UTC (rev 10241)
@@ -1,139 +1,134 @@
<?xml version="1.0" encoding="UTF-8"?>
<section>
- <sectioninfo>
- <keywordset>
- <keyword>rich:beanValidator</keyword>
- </keywordset>
- </sectioninfo>
+ <sectioninfo>
+ <keywordset>
+ <keyword>rich:beanValidator</keyword>
+ </keywordset>
+ </sectioninfo>
- <table>
- <title>Component identification parameters</title>
+ <table>
+ <title>Component identification parameters</title>
- <tgroup cols="2">
- <thead>
- <row>
- <entry>Name</entry>
+ <tgroup cols="2">
+ <thead>
+ <row>
+ <entry>Name</entry>
- <entry>Value</entry>
- </row>
- </thead>
+ <entry>Value</entry>
+ </row>
+ </thead>
- <tbody>
- <row>
- <entry>component-type</entry>
+ <tbody>
+ <row>
+ <entry>component-type</entry>
- <entry>org.richfaces.beanValidator</entry>
- </row>
+ <entry>org.richfaces.beanValidator</entry>
+ </row>
- <row>
- <entry>component-class</entry>
+ <row>
+ <entry>component-class</entry>
- <entry>org.richfaces.component.html.HtmlbeanValidator</entry>
- </row>
+ <entry>org.richfaces.component.html.HtmlbeanValidator</entry>
+ </row>
- <row>
- <entry>component-family</entry>
+ <row>
+ <entry>component-family</entry>
- <entry>org.richfaces.beanValidator</entry>
- </row>
+ <entry>org.richfaces.beanValidator</entry>
+ </row>
- <row>
- <entry>renderer-type</entry>
+ <row>
+ <entry>renderer-type</entry>
- <entry>org.richfaces.beanValidatorRenderer</entry>
- </row>
+ <entry>org.richfaces.beanValidatorRenderer</entry>
+ </row>
- <row>
- <entry>tag-class</entry>
+ <row>
+ <entry>tag-class</entry>
- <entry>org.richfaces.taglib.beanValidatorTag</entry>
- </row>
- </tbody>
- </tgroup>
- </table>
+ <entry>org.richfaces.taglib.beanValidatorTag</entry>
+ </row>
+ </tbody>
+ </tgroup>
+ </table>
- <section>
- <title>Creating the Component with a Page Tag</title>
+ <section>
+ <title>Creating the Component with a Page Tag</title>
- <para>To create the simplest variant of the component on a page use the following syntax:</para>
+ <para>To create the simplest variant of the component on a page use the
+ following syntax:</para>
- <para>
- <emphasis role="bold">Example:</emphasis>
- </para>
- <programlisting role="XML"><![CDATA[...
+ <para>
+ <emphasis role="bold">Example:</emphasis>
+ </para>
+ <programlisting role="XML"><![CDATA[...
<h:inputText value="#{validationBean.email}" id="email">
-<rich:beanValidator summary="Invalid email"/>
+ <rich:beanValidator summary="Invalid email"/>
</h:inputText>
...]]></programlisting>
- </section>
+ </section>
- <section>
- <title>Creating the Component Dynamically Using Java</title>
+ <section>
+ <title>Creating the Component Dynamically Using Java</title>
- <para>
- <emphasis role="bold">Example:</emphasis>
- </para>
- <programlisting role="JAVA"><![CDATA[import org.richfaces.component.html.HtmlCalendar;
+ <para>
+ <emphasis role="bold">Example:</emphasis>
+ </para>
+ <programlisting role="JAVA"><![CDATA[import org.richfaces.component.html.HtmlCalendar;
...
HtmlbeanValidator mybeanValidator= new HtmlbeanValidator();
...
]]></programlisting>
-
-
- <!-- Start Details of Usage-->
- <section>
- <title>Details of Usage</title>
-
- <para>
- Starting from 3.2.2 GA version Rich Faces provides support for model-based constraints defined using Hibernate Validator.
- Thus it's possible to use Hibernate Validators the same as for Seam based applications.
- </para>
-
- <para>The <emphasis role="bold"><property><rich:beanValidator></property></emphasis>
- component is defined in the same way as any JSF validator. Look at the example below.
- </para>
-
- <programlisting role="XML"><![CDATA[...
- <rich:panel>
- <f:facet name="header">
- <h:outputText value="#{validationBean.progressString}" id="progress"/>
- </f:facet>
- <h:panelGrid columns="3">
- <h:outputText value="Name:" />
- <h:inputText value="#{validationBean.name}" id="name">
- <rich:beanValidator summary="Invalid name"/>
- </h:inputText>
- <rich:message for="name" />
- <h:outputText value="Email:" />
- <h:inputText value="#{validationBean.email}" id="email">
- <rich:beanValidator summary="Invalid email"/>
- </h:inputText>
- <rich:message for="email" />
- <h:outputText value="Age:" />
- <h:inputText value="#{validationBean.age}" id="age">
- <rich:beanValidator summary="Wrong age"/>
- </h:inputText>
- <rich:message for="age" />
- <f:facet name="footer">
- <a4j:commandButton value="Submit" action="#{validationBean.success}" reRender="progress"/>
- </f:facet>
- </h:panelGrid>
- </rich:panel>
- ...]]></programlisting>
-
- <para>Please play close attention on the bean code that contains the constraints
- defined with Hibernate annotation which perform validation of the input data.</para>
-
- <programlisting role="JAVA"><![CDATA[
+
+
+ <!-- Start Details of Usage-->
+ <section>
+ <title>Details of Usage</title>
+
+ <para> Starting from 3.2.2 GA version Rich Faces provides support for
+ model-based constraints defined using Hibernate Validator.
+ Thus it's possible to use Hibernate Validators the same as
+ for Seam based applications. </para>
+
+ <para>The <emphasis role="bold">
+ <property><rich:beanValidator></property>
+ </emphasis> component is defined in the same way as any JSF
+ validator. Look at the example below. </para>
+
+ <programlisting role="XML"><![CDATA[...
+<rich:panel>
+ <f:facet name="header">
+ <h:outputText value="#{validationBean.progressString}" id="progress"/>
+ </f:facet>
+ <h:panelGrid columns="3">
+ <h:outputText value="Name:" />
+ <h:inputText value="#{validationBean.name}" id="name">
+ <rich:beanValidator summary="Invalid name"/>
+ </h:inputText>
+ <rich:message for="name" />
+ <h:outputText value="Email:" />
+ <h:inputText value="#{validationBean.email}" id="email">
+ <rich:beanValidator summary="Invalid email"/>
+ </h:inputText>
+ <rich:message for="email" />
+ <f:facet name="footer">
+ <a4j:commandButton value="Submit" action="#{validationBean.success}" reRender="progress"/>
+ </f:facet>
+ </h:panelGrid>
+</rich:panel>
+...]]></programlisting>
+
+ <para>Please play close attention on the bean code that contains the
+ constraints defined with Hibernate annotation which perform
+ validation of the input data.</para>
+
+ <programlisting role="JAVA"><![CDATA[
package org.richfaces.demo.validation;
import org.hibernate.validator.Email;
import org.hibernate.validator.Length;
-import org.hibernate.validator.Max;
-import org.hibernate.validator.Min;
import org.hibernate.validator.NotEmpty;
-import org.hibernate.validator.NotNull;
public class ValidationBean {
@@ -143,10 +138,6 @@
@Email
@NotEmpty
private String email;
- @NotNull
- @Min(18)
- @Max(100)
- private int age;
public ValidationBean() {
}
@@ -166,33 +157,33 @@
public void setEmail(String email) {
this.email = email;
}
+}]]></programlisting>
- public int getAge() {
- return age;
- }
+ <para>The following figure shows what happens if validation fails</para>
- public void setAge(int age) {
- this.age = age;
- }
-}]]></programlisting>
-
-<para>The following figure shows what happens if validation fails</para>
-
- <figure>
- <title><emphasis role="bold"><property><rich:beanValidator></property></emphasis> usage</title>
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/beanValidator1.png"/>
- </imageobject>
- </mediaobject>
- </figure>
- <para>As you can see from the example that in order to validate the <emphasis role="bold"><property><rich:beanValidator></property></emphasis>
- should be nested into a input JSF or RichFaces component.
- </para>
-
- <para>The component has the only attribute - <emphasis><property>"summary"</property></emphasis>which displays validation messages about validation errors.</para>
- </section>
- </section>
+ <figure>
+ <title><emphasis role="bold">
+ <property><rich:beanValidator></property>
+ </emphasis> usage</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata
+ fileref="images/beanValidator1.png"
+ />
+ </imageobject>
+ </mediaobject>
+ </figure>
+ <para>As you can see from the example that in order to validate the
+ <emphasis role="bold">
+ <property><rich:beanValidator></property>
+ </emphasis> should be nested into a input JSF or RichFaces
+ component. </para>
-</section>
+ <para>The component has the only attribute - <emphasis>
+ <property>"summary"</property>
+ </emphasis>which displays validation messages about
+ validation errors.</para>
+ </section>
+ </section>
+</section>
Modified: trunk/docs/userguide/en/src/main/docbook/included/graphValidator.xml
===================================================================
--- trunk/docs/userguide/en/src/main/docbook/included/graphValidator.xml 2008-08-29 15:37:53 UTC (rev 10240)
+++ trunk/docs/userguide/en/src/main/docbook/included/graphValidator.xml 2008-08-29 15:41:11 UTC (rev 10241)
@@ -1,137 +1,146 @@
<?xml version="1.0" encoding="UTF-8"?>
<section>
- <sectioninfo>
- <keywordset>
- <keyword>rich:graphValidator</keyword>
- </keywordset>
- </sectioninfo>
+ <sectioninfo>
+ <keywordset>
+ <keyword>rich:graphValidator</keyword>
+ </keywordset>
+ </sectioninfo>
- <table>
- <title>Component identification parameters</title>
+ <table>
+ <title>Component identification parameters</title>
- <tgroup cols="2">
- <thead>
- <row>
- <entry>Name</entry>
+ <tgroup cols="2">
+ <thead>
+ <row>
+ <entry>Name</entry>
- <entry>Value</entry>
- </row>
- </thead>
+ <entry>Value</entry>
+ </row>
+ </thead>
- <tbody>
- <row>
- <entry>component-type</entry>
+ <tbody>
+ <row>
+ <entry>component-type</entry>
- <entry>org.richfaces.graphValidator</entry>
- </row>
+ <entry>org.richfaces.graphValidator</entry>
+ </row>
- <row>
- <entry>component-class</entry>
+ <row>
+ <entry>component-class</entry>
- <entry>org.richfaces.component.html.HtmlgraphValidator</entry>
- </row>
+ <entry>org.richfaces.component.html.HtmlgraphValidator</entry>
+ </row>
- <row>
- <entry>component-family</entry>
+ <row>
+ <entry>component-family</entry>
- <entry>org.richfaces.graphValidator</entry>
- </row>
+ <entry>org.richfaces.graphValidator</entry>
+ </row>
- <row>
- <entry>renderer-type</entry>
+ <row>
+ <entry>renderer-type</entry>
- <entry>org.richfaces.graphValidatorRenderer</entry>
- </row>
+ <entry>org.richfaces.graphValidatorRenderer</entry>
+ </row>
- <row>
- <entry>tag-class</entry>
+ <row>
+ <entry>tag-class</entry>
- <entry>org.richfaces.taglib.graphValidatorTag</entry>
- </row>
- </tbody>
- </tgroup>
- </table>
+ <entry>org.richfaces.taglib.graphValidatorTag</entry>
+ </row>
+ </tbody>
+ </tgroup>
+ </table>
- <section>
- <title>Creating the Component with a Page Tag</title>
+ <section>
+ <title>Creating the Component with a Page Tag</title>
- <para>To create the simplest variant on a page use the following syntax:</para>
+ <para>To create the simplest variant on a page use the following syntax:</para>
- <para>
- <emphasis role="bold">Example:</emphasis>
- </para>
- <programlisting role="XML"><![CDATA[...
- <h:outputText value="Name:" />
- <h:inputText value="#{userBean.name}" id="name" required="true">
- <f:validateLength minimum="3" maximum="12"/>
- <rich:graphValidator event="onblur"/>
- </h:inputText>
+ <para>
+ <emphasis role="bold">Example:</emphasis>
+ </para>
+ <programlisting role="XML"><![CDATA[...
+<h:outputText value="Name:" />
+ <h:inputText value="#{userBean.name}" id="name" required="true">
+ <f:validateLength minimum="3" maximum="12"/>
+ <rich:graphValidator event="onblur"/>
+ </h:inputText>
...]]></programlisting>
- </section>
+ </section>
- <section>
- <title>Creating the Component Dynamically Using Java</title>
+ <section>
+ <title>Creating the Component Dynamically Using Java</title>
- <para>
- <emphasis role="bold">Example:</emphasis>
- </para>
- <programlisting role="JAVA"><![CDATA[import org.richfaces.component.html.HtmlCalendar;
+ <para>
+ <emphasis role="bold">Example:</emphasis>
+ </para>
+ <programlisting role="JAVA"><![CDATA[import org.richfaces.component.html.HtmlCalendar;
...
HtmlgraphValidator mygraphValidator= new HtmlgraphValidator();
...
]]></programlisting>
-
-
- </section>
-
- <para> The<emphasis role="bold">
- <property><rich:graphValidator></property></emphasis>component behaves basically the same way as the <emphasis role="bold">
- <property><rich:beanValidator></property></emphasis>
- The deference between these two components is that in order to validate some input data with a <emphasis role="bold">
- <property><rich:beanValidator></property></emphasis> component, it should be a nested element of an input component, whereas <emphasis role="bold">
- <property><rich:graphValidator></property></emphasis> wraps multiple input components and validates the data received from them.
- </para>
- <para>The following example demonstrate a pattern of how the <emphasis role="bold">
- <property><rich:graphValidator></property></emphasis> can be used.</para>
- <programlisting role="XML"><![CDATA[...
- <rich:graphValidator>
- <h:panelGrid columns="3">
- <h:outputText value="Name:" />
- <h:inputText value="#{validationBean.name}" id="name">
- <f:validateLength minimum="2" />
- </h:inputText>
- <rich:message for="name" />
- <h:outputText value="Email:" />
- <h:inputText value="#{validationBean.email}" id="email" />
- <rich:message for="email" />
- </h:panelGrid>
- </rich:graphValidator>
- ...
+ </section>
+
+ <para> The<emphasis role="bold">
+ <property><rich:graphValidator></property>
+ </emphasis>component behaves basically the same way as the <emphasis role="bold">
+ <property><rich:beanValidator></property>
+ </emphasis> The deference between these two components is that in order to
+ validate some input data with a <emphasis role="bold">
+ <property><rich:beanValidator></property>
+ </emphasis> component, it should be a nested element of an input component,
+ whereas <emphasis role="bold">
+ <property><rich:graphValidator></property>
+ </emphasis> wraps multiple input components and validates the data received from
+ them. </para>
+
+ <para>The following example demonstrate a pattern of how the <emphasis role="bold">
+ <property><rich:graphValidator></property>
+ </emphasis> can be used.</para>
+ <programlisting role="XML"><![CDATA[...
+<rich:graphValidator>
+ <h:panelGrid columns="3">
+ <h:outputText value="Name:" />
+ <h:inputText value="#{validationBean.name}" id="name">
+ <f:validateLength minimum="2" />
+ </h:inputText>
+ <rich:message for="name" />
+ <h:outputText value="Email:" />
+ <h:inputText value="#{validationBean.email}" id="email" />
+ <rich:message for="email" />
+ </h:panelGrid>
+</rich:graphValidator>
+...
]]></programlisting>
-
- <para>The data validation can be also performed using Hibernate Validator, the same way as it is done with <emphasis role="bold">
- <property><rich:beanValidator></property></emphasis>. </para>
-
+ <para>The data validation can be also performed using Hibernate Validator, the same way as
+ it is done with <emphasis role="bold">
+ <property><rich:beanValidator></property>
+ </emphasis>. </para>
- <para>The components's architecture provides an option to bind the component to a managed bean, which is done with the <emphasis >
- <property><value></property></emphasis> attribute. The attribute ensures that the entered data is valid after the model is updated by revalidating the bean properties.</para>
- <para>Please look at the example below.</para>
-
-
- <programlisting role="XML"><![CDATA[...
- <rich:graphValidator value="#{dayStatistics}">
- <h:outputText value="#{pt.title}" /><
- <rich:inputNumberSpinne minValue="0" maxValue="24" value="#{pt.time}" id="time">
+
+
+ <para>The components's architecture provides an option to bind the component to a
+ managed bean, which is done with the <emphasis>
+ <property><value></property>
+ </emphasis> attribute. The attribute ensures that the entered data is valid
+ after the model is updated by revalidating the bean properties.</para>
+ <para>Please look at the example below.</para>
+
+
+ <programlisting role="XML"><![CDATA[...
+<rich:graphValidator value="#{dayStatistics}">
+ <h:outputText value="#{pt.title}" />
+ <rich:inputNumberSpinne minValue="0" maxValue="24" value="#{pt.time}" id="time">
</rich:inputNumberSpinner>
- <rich:message for="time" />
+ <rich:message for="time" />
</rich:graphValidator>
- ...
+...
]]></programlisting>
-
+
</section>
-
16 years, 4 months
JBoss Rich Faces SVN: r10239 - trunk/ui/componentControl/src/main/config/component.
by richfaces-svn-commits@lists.jboss.org
Author: abelevich
Date: 2008-08-29 11:00:50 -0400 (Fri, 29 Aug 2008)
New Revision: 10239
Modified:
trunk/ui/componentControl/src/main/config/component/componentControl.xml
Log:
https://jira.jboss.org/jira/browse/RF-4210
Modified: trunk/ui/componentControl/src/main/config/component/componentControl.xml
===================================================================
--- trunk/ui/componentControl/src/main/config/component/componentControl.xml 2008-08-29 15:00:39 UTC (rev 10238)
+++ trunk/ui/componentControl/src/main/config/component/componentControl.xml 2008-08-29 15:00:50 UTC (rev 10239)
@@ -110,5 +110,10 @@
<property hidden="true">
<name>parentProperties</name>
</property>
+
+ <property hidden="true">
+ <name>onsubmit</name>
+ <classname>java.lang.String</classname>
+ </property>
</component>
</components>
16 years, 4 months
JBoss Rich Faces SVN: r10238 - trunk/ui/effect/src/main/config/component.
by richfaces-svn-commits@lists.jboss.org
Author: abelevich
Date: 2008-08-29 11:00:39 -0400 (Fri, 29 Aug 2008)
New Revision: 10238
Modified:
trunk/ui/effect/src/main/config/component/effect.xml
Log:
https://jira.jboss.org/jira/browse/RF-4210
Modified: trunk/ui/effect/src/main/config/component/effect.xml
===================================================================
--- trunk/ui/effect/src/main/config/component/effect.xml 2008-08-29 14:18:59 UTC (rev 10237)
+++ trunk/ui/effect/src/main/config/component/effect.xml 2008-08-29 15:00:39 UTC (rev 10238)
@@ -92,5 +92,9 @@
</description>
<defaultvalue>""</defaultvalue>
</property>
+ <property hidden="true">
+ <name>onsubmit</name>
+ <classname>java.lang.String</classname>
+ </property>
</component>
</components>
16 years, 4 months
JBoss Rich Faces SVN: r10237 - in trunk/test-applications/seleniumTest/samples/src/test/java/org/samples: booking and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: dsvyatobatsko
Date: 2008-08-29 10:18:59 -0400 (Fri, 29 Aug 2008)
New Revision: 10237
Added:
trunk/test-applications/seleniumTest/samples/src/test/java/org/samples/SampleTestBase.java
trunk/test-applications/seleniumTest/samples/src/test/java/org/samples/booking/LoginPageTest.java
Log:
first test: draft implementation
Added: trunk/test-applications/seleniumTest/samples/src/test/java/org/samples/SampleTestBase.java
===================================================================
--- trunk/test-applications/seleniumTest/samples/src/test/java/org/samples/SampleTestBase.java (rev 0)
+++ trunk/test-applications/seleniumTest/samples/src/test/java/org/samples/SampleTestBase.java 2008-08-29 14:18:59 UTC (rev 10237)
@@ -0,0 +1,96 @@
+package org.samples;
+
+import org.openqa.selenium.server.RemoteControlConfiguration;
+import org.openqa.selenium.server.SeleniumServer;
+import org.testng.annotations.AfterSuite;
+import org.testng.annotations.AfterTest;
+import org.testng.annotations.BeforeSuite;
+import org.testng.annotations.BeforeTest;
+import org.testng.annotations.Parameters;
+
+import com.thoughtworks.selenium.DefaultSelenium;
+
+public class SampleTestBase {
+
+ /** The default selenium instance */
+ public DefaultSelenium selenium;
+
+ private SeleniumServer seleniumServer;
+
+ /** Host */
+ private String host;
+
+ /** Port */
+ private String port;
+
+ /** Protocol */
+ private String protocol;
+
+ /** Application name */
+ private String applicationName;
+
+ protected static final String serverPort = "8080";
+
+ private static final Object MUTEX = new Object();
+
+ public SampleTestBase(String appName) {
+ this("http", "localhost", serverPort, appName);
+ }
+
+ public SampleTestBase(String protocol, String host, String port, String appName) {
+ this.host = host;
+ this.port = port;
+ this.protocol = protocol;
+ this.applicationName = appName;
+ }
+
+ @BeforeSuite
+ public void startSeleniumServer() throws Exception {
+ RemoteControlConfiguration config = new RemoteControlConfiguration();
+ config.setMultiWindow(false);
+ seleniumServer = new SeleniumServer(false, config);
+ seleniumServer.start();
+ }
+
+ /**
+ * This method are invoked before selenium tests started
+ */
+ @BeforeTest
+ @Parameters( { "browser" })
+ public void startSelenium(String browser) {
+ synchronized (MUTEX) {
+ selenium = createSeleniumClient(protocol + "://" + host + ":" + port + "/", browser);
+ selenium.start();
+ }
+ }
+
+ /**
+ * This method are invoked after selenium tests completed
+ */
+ @AfterTest(alwaysRun = true)
+ public void stopSelenium() {
+ synchronized (MUTEX) {
+ selenium.stop();
+ selenium = null;
+ }
+ }
+
+ @AfterSuite
+ public void stopSeleniumServer() throws Exception {
+ seleniumServer.stop();
+ }
+
+ /**
+ * @param url
+ * @param browser
+ * @return
+ */
+ private DefaultSelenium createSeleniumClient(String url, String browser) {
+ return new DefaultSelenium(host, 4444, browser, url);
+ }
+
+ protected void open(String url) {
+ selenium.open(protocol + "://" + host + ":" + port + "/" + applicationName + url);
+ }
+
+}
Property changes on: trunk/test-applications/seleniumTest/samples/src/test/java/org/samples/SampleTestBase.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:keywords
+ Author Id Revision Date
Name: svn:eol-style
+ native
Added: trunk/test-applications/seleniumTest/samples/src/test/java/org/samples/booking/LoginPageTest.java
===================================================================
--- trunk/test-applications/seleniumTest/samples/src/test/java/org/samples/booking/LoginPageTest.java (rev 0)
+++ trunk/test-applications/seleniumTest/samples/src/test/java/org/samples/booking/LoginPageTest.java 2008-08-29 14:18:59 UTC (rev 10237)
@@ -0,0 +1,17 @@
+package org.samples.booking;
+
+import org.samples.SampleTestBase;
+import org.testng.annotations.Test;
+
+public class LoginPageTest extends SampleTestBase {
+
+ public LoginPageTest(String appName) {
+ super("seam-booking");
+ }
+
+ @Test
+ public void test() {
+ // open start page
+ open("");
+ }
+}
Property changes on: trunk/test-applications/seleniumTest/samples/src/test/java/org/samples/booking/LoginPageTest.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:keywords
+ Author Id Revision Date
Name: svn:eol-style
+ native
16 years, 4 months
JBoss Rich Faces SVN: r10236 - in trunk/samples/richfaces-demo/src/main/webapp: richfaces/suggestionBox and 1 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: ilya_shaikovsky
Date: 2008-08-29 09:50:37 -0400 (Fri, 29 Aug 2008)
New Revision: 10236
Added:
trunk/samples/richfaces-demo/src/main/webapp/images/icons/arrow.png
trunk/samples/richfaces-demo/src/main/webapp/richfaces/suggestionBox/examples/objects.xhtml
Modified:
trunk/samples/richfaces-demo/src/main/webapp/richfaces/suggestionBox/examples/custom.xhtml
trunk/samples/richfaces-demo/src/main/webapp/richfaces/suggestionBox/usage.xhtml
Log:
Added: trunk/samples/richfaces-demo/src/main/webapp/images/icons/arrow.png
===================================================================
(Binary files differ)
Property changes on: trunk/samples/richfaces-demo/src/main/webapp/images/icons/arrow.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Modified: trunk/samples/richfaces-demo/src/main/webapp/richfaces/suggestionBox/examples/custom.xhtml
===================================================================
--- trunk/samples/richfaces-demo/src/main/webapp/richfaces/suggestionBox/examples/custom.xhtml 2008-08-29 13:01:44 UTC (rev 10235)
+++ trunk/samples/richfaces-demo/src/main/webapp/richfaces/suggestionBox/examples/custom.xhtml 2008-08-29 13:50:37 UTC (rev 10236)
@@ -44,10 +44,10 @@
<h:form id="suggestionbox_form">
<p>
- Suggestion Box will suggest you states capitals names. Comma and space could be used as suggestions separators."
+ Suggestion Box will suggest you states capitals names. Comma and square brackets could be used as suggestions separators."
</p>
<h:inputText value="#{capitalsBean.capital}" id="text" />
- <rich:suggestionbox id="suggestionBoxId" for="text" tokens=",["
+ <rich:suggestionbox id="suggestionBoxId" for="text" tokens=",[]"
rules="#{suggestionBox.rules}"
suggestionAction="#{capitalsBean.autocomplete}" var="result"
fetchValue="#{result.name}" rows="#{suggestionBox.intRows}"
Added: trunk/samples/richfaces-demo/src/main/webapp/richfaces/suggestionBox/examples/objects.xhtml
===================================================================
--- trunk/samples/richfaces-demo/src/main/webapp/richfaces/suggestionBox/examples/objects.xhtml (rev 0)
+++ trunk/samples/richfaces-demo/src/main/webapp/richfaces/suggestionBox/examples/objects.xhtml 2008-08-29 13:50:37 UTC (rev 10236)
@@ -0,0 +1,38 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml"
+ xmlns:ui="http://java.sun.com/jsf/facelets"
+ xmlns:h="http://java.sun.com/jsf/html"
+ xmlns:f="http://java.sun.com/jsf/core"
+ xmlns:a4j="http://richfaces.org/a4j"
+ xmlns:rich="http://richfaces.org/rich">
+
+ <ui:composition>
+ <script type="text/javascript">
+ function printObjectsSelected(output, sgcomponent){
+ output.innerHTML=sgcomponent.getSelectedItems().pluck('state');
+ }
+ </script>
+
+ <h:form id="form">
+ <h:panelGrid columns="2">
+ <h:outputText value="Input with states names suggestions"/>
+ <h:panelGrid columns="2" border="0" cellpadding="0" cellspacing="0">
+ <h:inputText id="statesinput"/>
+ <h:graphicImage value="/images/icons/arrow.png" onclick="#{rich:component('suggestion')}.callSuggestion(true)"/>
+ </h:panelGrid>
+ <h:outputText value="States capitals for suggested capitals"/>
+ <h:outputText id="objects" style="font-weight:bold"/>
+ </h:panelGrid>
+ <rich:suggestionbox height="200" width="150" usingSuggestObjects="true" onobjectchange="printObjectsSelected(#{rich:element('objects')}, #{rich:component('suggestion')});"
+ suggestionAction="#{capitalsBean.autocomplete}" var="cap" for="statesinput" fetchValue="#{cap.name}" id="suggestion" tokens=",">
+ <h:column>
+ <h:graphicImage value="#{cap.stateFlag}" />
+ </h:column>
+ <h:column>
+ <h:outputText value="#{cap.name}"/>
+ </h:column>
+ </rich:suggestionbox>
+ </h:form>
+ </ui:composition>
+
+</html>
\ No newline at end of file
Modified: trunk/samples/richfaces-demo/src/main/webapp/richfaces/suggestionBox/usage.xhtml
===================================================================
--- trunk/samples/richfaces-demo/src/main/webapp/richfaces/suggestionBox/usage.xhtml 2008-08-29 13:01:44 UTC (rev 10235)
+++ trunk/samples/richfaces-demo/src/main/webapp/richfaces/suggestionBox/usage.xhtml 2008-08-29 13:50:37 UTC (rev 10236)
@@ -30,6 +30,26 @@
</ui:include>
</div>
</fieldset>
+
+ <p>
+ And below there is second example of new JS API and Objects selection feature usage.
+ </p>
+ <p>
+ Just choose some state from suggestion and capital name property will be fetched
+ using client side API (Some of the capitals could be fetched separated with coma).
+ No requests need anymore. You could just store needed
+ properties in the same manner in hidden fields for example.
+ </p>
+ <fieldset class="demo_fieldset">
+ <legend class="demo_legend">Objects usage example</legend>
+ <div class="sample-container">
+ <ui:include src="/richfaces/suggestionBox/examples/objects.xhtml"/>
+ <ui:include src="/templates/include/sourceview.xhtml">
+ <ui:param name="sourcepath" value="/richfaces/suggestionBox/examples/objects.xhtml"/>
+ </ui:include>
+ </div>
+ </fieldset>
+
</ui:define>
</ui:composition>
16 years, 4 months