JBoss Rich Faces SVN: r9974 - trunk/framework/api/src/main/java/org/richfaces/model.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2008-08-07 11:20:19 -0400 (Thu, 07 Aug 2008)
New Revision: 9974
Modified:
trunk/framework/api/src/main/java/org/richfaces/model/TreeRange.java
trunk/framework/api/src/main/java/org/richfaces/model/TreeRowKey.java
Log:
TreeRange refactoring
FIXED: TreeRowKey#isSubKey() returned false for equal objects
Modified: trunk/framework/api/src/main/java/org/richfaces/model/TreeRange.java
===================================================================
--- trunk/framework/api/src/main/java/org/richfaces/model/TreeRange.java 2008-08-07 15:06:12 UTC (rev 9973)
+++ trunk/framework/api/src/main/java/org/richfaces/model/TreeRange.java 2008-08-07 15:20:19 UTC (rev 9974)
@@ -45,4 +45,22 @@
* @return <code>true</code> or <code>false</code>
*/
public boolean processChildren(TreeRowKey rowKey);
+
+
+ /**
+ * Unconstrained variant of {@link TreeRange}.
+ * Is stateless and safe to use in multi-threaded environments.
+ *
+ * @since 3.2.2
+ * @author Nick Belaevski
+ */
+ public final static TreeRange RANGE_UNCONSTRAINED = new TreeRange() {
+ public boolean processChildren(TreeRowKey rowKey) {
+ return true;
+ }
+
+ public boolean processNode(TreeRowKey rowKey) {
+ return true;
+ }
+ };
}
Modified: trunk/framework/api/src/main/java/org/richfaces/model/TreeRowKey.java
===================================================================
--- trunk/framework/api/src/main/java/org/richfaces/model/TreeRowKey.java 2008-08-07 15:06:12 UTC (rev 9973)
+++ trunk/framework/api/src/main/java/org/richfaces/model/TreeRowKey.java 2008-08-07 15:20:19 UTC (rev 9974)
@@ -71,7 +71,15 @@
return false;
}
- return (rowKey.getPath() + AbstractTreeDataModel.SEPARATOR).startsWith(getPath());
+ String otherPath = rowKey.getPath();
+ String path = getPath();
+
+ if (otherPath.startsWith(path)) {
+ return otherPath.length() == path.length() ||
+ otherPath.charAt(path.length()) == AbstractTreeDataModel.SEPARATOR;
+ } else {
+ return false;
+ }
}
/**
16 years, 3 months
JBoss Rich Faces SVN: r9973 - trunk/samples/richfaces-demo/src/main/webapp/richfaces/ajaxAttributes.
by richfaces-svn-commits@lists.jboss.org
Author: smukhina
Date: 2008-08-07 11:06:12 -0400 (Thu, 07 Aug 2008)
New Revision: 9973
Modified:
trunk/samples/richfaces-demo/src/main/webapp/richfaces/ajaxAttributes/usage.xhtml
Log:
https://jira.jboss.org/jira/browse/RF-3594
checking language of demosite text
Modified: trunk/samples/richfaces-demo/src/main/webapp/richfaces/ajaxAttributes/usage.xhtml
===================================================================
--- trunk/samples/richfaces-demo/src/main/webapp/richfaces/ajaxAttributes/usage.xhtml 2008-08-07 13:11:30 UTC (rev 9972)
+++ trunk/samples/richfaces-demo/src/main/webapp/richfaces/ajaxAttributes/usage.xhtml 2008-08-07 15:06:12 UTC (rev 9973)
@@ -7,19 +7,19 @@
xmlns:rich="http://richfaces.org/rich">
<ui:composition template="/templates/component-sample.xhtml">
<ui:define name="sample">
- <style>
- .viewsourcepanel {
- padding:10px;
- overflow:auto;
- border-width:0;
- }
- .viewsourcebody {
- padding:0;
- }
- ol{
- font-size:11px !important;
- }
- </style>
+ <style>
+ .viewsourcepanel {
+ padding:10px;
+ overflow:auto;
+ border-width:0;
+ }
+ .viewsourcebody {
+ padding:0;
+ }
+ ol{
+ font-size:11px !important;
+ }
+ </style>
<p>This section overviews the attributes that are common for Ajax components
such as a4j:support, a4j:commandButton, a4j:jsFunction, a4j:poll, a4j:push and so
@@ -41,10 +41,10 @@
<fieldset class="demo_fieldset">
<legend class="demo_legend">Code Example</legend>
- <rich:panel styleClass="viewsourcepanel" bodyClass="viewsourcebody rich-laguna-panel-no-header">
- <rich:insert src="/richfaces/ajaxAttributes/snippets/reRender2.xhtml" highlight="xhtml"></rich:insert>
+ <rich:panel styleClass="viewsourcepanel" bodyClass="viewsourcebody rich-laguna-panel-no-header">
+ <rich:insert src="/richfaces/ajaxAttributes/snippets/reRender2.xhtml" highlight="xhtml"></rich:insert>
</rich:panel>
- </fieldset>
+ </fieldset>
<p>
reRender uses <a target="_blank" href="http://java.sun.com/javaee/javaserverfaces/1.2_MR1/docs/api/javax/faces/c...">
UIComponent.findComponent()</a> algorithm (with some additional exceptions)
@@ -56,10 +56,10 @@
</p>
<fieldset class="demo_fieldset">
<legend class="demo_legend">Code Example</legend>
- <rich:panel styleClass="viewsourcepanel" bodyClass="viewsourcebody rich-laguna-panel-no-header">
- <rich:insert src="/richfaces/ajaxAttributes/snippets/reRender3.xhtml" highlight="xhtml"></rich:insert>
+ <rich:panel styleClass="viewsourcepanel" bodyClass="viewsourcebody rich-laguna-panel-no-header">
+ <rich:insert src="/richfaces/ajaxAttributes/snippets/reRender3.xhtml" highlight="xhtml"></rich:insert>
</rich:panel>
- </fieldset>
+ </fieldset>
<p>
You can use JSF EL expression as a value of the reRender attribute. It might be a property of
types Set, Collection, Array or simple String. The EL for reRender is resolved right before the
@@ -82,9 +82,9 @@
messages regardless of what Ajax request causes the Validation phase failed.
</p>
<fieldset class="demo_fieldset">
- <legend class="demo_legend">Code Example</legend>
- <rich:panel styleClass="viewsourcepanel" bodyClass="viewsourcebody rich-laguna-panel-no-header">
- <rich:insert src="/richfaces/ajaxAttributes/snippets/reRender1.xhtml" highlight="xhtml"></rich:insert>
+ <legend class="demo_legend">Code Example</legend>
+ <rich:panel styleClass="viewsourcepanel" bodyClass="viewsourcebody rich-laguna-panel-no-header">
+ <rich:insert src="/richfaces/ajaxAttributes/snippets/reRender1.xhtml" highlight="xhtml"></rich:insert>
</rich:panel>
</fieldset>
<p>
@@ -112,11 +112,11 @@
the several characters already before the previous Ajax Response is back.
</p>
<fieldset class="demo_fieldset">
- <legend class="demo_legend">Code Example</legend>
- <rich:panel styleClass="viewsourcepanel" bodyClass="viewsourcebody rich-laguna-panel-no-header">
- <rich:insert src="/richfaces/ajaxAttributes/snippets/eventqueue.xhtml" highlight="xhtml"></rich:insert>
+ <legend class="demo_legend">Code Example</legend>
+ <rich:panel styleClass="viewsourcepanel" bodyClass="viewsourcebody rich-laguna-panel-no-header">
+ <rich:insert src="/richfaces/ajaxAttributes/snippets/eventqueue.xhtml" highlight="xhtml"></rich:insert>
</rich:panel>
- </fieldset>
+ </fieldset>
<p><b>requestDelay</b> attribute defines the time (in ms.) that the request will be wait in
the queue before it is ready to send. When the delay time is over, the request will be
sent to the server or removed if the newest 'similar' request is in a queue already .
@@ -152,11 +152,11 @@
</p>
<p>
<b>process</b> attribute allows you to define the components to be processed
- additionally with the component which marked as ajaxSingle or wrapped to region.
- Imagine you need to process only two field in the different parts of view.
+ additionally with the component which is marked as ajaxSingle or wrapped to region.
+ Imagine you need to process only two fields in the different parts of view.
If you wrap the first to region or make nested support component ajaxSingle -
- second component will not be processed. And if you do not define first component
- in this way - all the view will be processed. In this case next simple constructions
+ the second component will not be processed. And if you do not define the first component
+ in this way - all the view will be processed. In this case the next simple constructions
should be used:
</p>
<fieldset class="demo_fieldset">
@@ -166,9 +166,9 @@
</rich:panel>
</fieldset>
<p>
- In this case when the name field will loose focus - Ajax request will be sent.
+ Here when the name field looses focus, Ajax request will be sent.
And only two fields (<i>name</i> and additionally <i>email</i>) will be processed
- (decoding, conversion/validation, value applying will be executed). The same
+ (decoding, conversion/validation, value applying will be executed). The same is
for the <i>email</i> field blur event.
</p>
<p><b>immediate</b> attribute has the same purpose as any other non-Ajax-JSF component.
@@ -250,10 +250,10 @@
</p>
<fieldset class="demo_fieldset">
<legend class="demo_legend">Code Example</legend>
- <rich:panel styleClass="viewsourcepanel" bodyClass="viewsourcebody rich-laguna-panel-no-header">
- <rich:insert src="/richfaces/ajaxAttributes/snippets/data.xhtml" highlight="xhtml"></rich:insert>
+ <rich:panel styleClass="viewsourcepanel" bodyClass="viewsourcebody rich-laguna-panel-no-header">
+ <rich:insert src="/richfaces/ajaxAttributes/snippets/data.xhtml" highlight="xhtml"></rich:insert>
</rich:panel>
- </fieldset>
+ </fieldset>
<p>
Richfaces allows to serialize not only primitive types into JSON format, but also complex
types including arrays and collections. The beans should be serializable to be refered
16 years, 3 months
JBoss Rich Faces SVN: r9972 - in trunk/test-applications/seleniumTest/src/test/java/org/richfaces: testng and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: dsvyatobatsko
Date: 2008-08-07 09:11:30 -0400 (Thu, 07 Aug 2008)
New Revision: 9972
Modified:
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/SeleniumTestBase.java
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/DataTableTest.java
Log:
moved two useful methods from DataTableTest to base class
Modified: trunk/test-applications/seleniumTest/src/test/java/org/richfaces/SeleniumTestBase.java
===================================================================
--- trunk/test-applications/seleniumTest/src/test/java/org/richfaces/SeleniumTestBase.java 2008-08-07 12:44:41 UTC (rev 9971)
+++ trunk/test-applications/seleniumTest/src/test/java/org/richfaces/SeleniumTestBase.java 2008-08-07 13:11:30 UTC (rev 9972)
@@ -794,6 +794,34 @@
}
/**
+ * Asserts that expected columns count equals actual one.
+ * @param i the expected columns count
+ * @param tableId id of table to be checked
+ */
+ public void assertColumnsCount(int i, String tableId) {
+ StringBuffer script = new StringBuffer("$('");
+ script.append(tableId);
+ script.append("').rows[0].cells.length");
+
+ String count = runScript(script.toString());
+ Assert.assertEquals(count, String.valueOf(i));
+ }
+
+ /**
+ * Asserts that expected rows count equals actual one.
+ * @param i the expected rows count
+ * @param tableId id of table to be checked
+ */
+ public void assertRowsCount(int i, String tableId) {
+ StringBuffer script = new StringBuffer("$('");
+ script.append(tableId);
+ script.append("').rows.length");
+
+ String count = runScript(script.toString());
+ Assert.assertEquals(count, String.valueOf(i));
+ }
+
+ /**
* Checks whether client is FireFox
*
* @return true if client is FireFox
Modified: trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/DataTableTest.java
===================================================================
--- trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/DataTableTest.java 2008-08-07 12:44:41 UTC (rev 9971)
+++ trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/DataTableTest.java 2008-08-07 13:11:30 UTC (rev 9972)
@@ -1,7 +1,5 @@
package org.richfaces.testng;
-import javax.faces.event.ActionEvent;
-
import org.ajax4jsf.template.Template;
import org.richfaces.SeleniumTestBase;
import org.testng.Assert;
@@ -188,22 +186,4 @@
Assert.assertEquals(runScript(script), value);
}
- private void assertColumnsCount(int i, String tableId) {
- StringBuffer script = new StringBuffer("$('");
- script.append(tableId);
- script.append("').rows[0].cells.length");
-
- String count = runScript(script.toString());
- Assert.assertEquals(count, String.valueOf(i));
- }
-
- private void assertRowsCount(int i, String tableId) {
- StringBuffer script = new StringBuffer("$('");
- script.append(tableId);
- script.append("').rows.length");
-
- String count = runScript(script.toString());
- Assert.assertEquals(count, String.valueOf(i));
- }
-
}
16 years, 3 months
JBoss Rich Faces SVN: r9971 - in trunk/test-applications/seleniumTest/src: main/webapp/pages/columns and 1 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: dsvyatobatsko
Date: 2008-08-07 08:44:41 -0400 (Thu, 07 Aug 2008)
New Revision: 9971
Added:
trunk/test-applications/seleniumTest/src/main/webapp/pages/columns/
trunk/test-applications/seleniumTest/src/main/webapp/pages/columns/columnsTest.xhtml
trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/ColumnsTest.java
Log:
initial commit of columns test
Added: trunk/test-applications/seleniumTest/src/main/webapp/pages/columns/columnsTest.xhtml
===================================================================
(Binary files differ)
Property changes on: trunk/test-applications/seleniumTest/src/main/webapp/pages/columns/columnsTest.xhtml
___________________________________________________________________
Name: svn:mime-type
+ application/xhtml+xml
Added: trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/ColumnsTest.java
===================================================================
--- trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/ColumnsTest.java (rev 0)
+++ trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/ColumnsTest.java 2008-08-07 12:44:41 UTC (rev 9971)
@@ -0,0 +1,19 @@
+package org.richfaces.testng;
+
+import org.ajax4jsf.template.Template;
+import org.richfaces.SeleniumTestBase;
+import org.testng.annotations.Test;
+
+public class ColumnsTest extends SeleniumTestBase {
+
+ @Test
+ public void testColumnsComponent(Template template) {
+ renderPage(template);
+ }
+
+ @Override
+ public String getTestUrl() {
+ return "pages/columns/columnsTest.xhtml";
+ }
+
+}
Property changes on: trunk/test-applications/seleniumTest/src/test/java/org/richfaces/testng/ColumnsTest.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:keywords
+ Author Id Revision Date
Name: svn:eol-style
+ native
16 years, 3 months
JBoss Rich Faces SVN: r9970 - in trunk/ui/panelbar/src/main: resources/org/richfaces/renderkit/html/scripts and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: konstantin.mishin
Date: 2008-08-07 08:38:03 -0400 (Thu, 07 Aug 2008)
New Revision: 9970
Modified:
trunk/ui/panelbar/src/main/java/org/richfaces/renderkit/html/PanelBarRendererBase.java
trunk/ui/panelbar/src/main/resources/org/richfaces/renderkit/html/scripts/panelbar.js
Log:
RF-4055
Modified: trunk/ui/panelbar/src/main/java/org/richfaces/renderkit/html/PanelBarRendererBase.java
===================================================================
--- trunk/ui/panelbar/src/main/java/org/richfaces/renderkit/html/PanelBarRendererBase.java 2008-08-07 12:17:44 UTC (rev 9969)
+++ trunk/ui/panelbar/src/main/java/org/richfaces/renderkit/html/PanelBarRendererBase.java 2008-08-07 12:38:03 UTC (rev 9970)
@@ -52,7 +52,7 @@
public static final String PANEL_BAR_RESOURCES = "PANEL_BAR_RESOURCES";
public static final String EXPANDED_ATTR="expanded";
- private final InternetResource[] scripts = {new AjaxScript(),new PrototypeScript(),new ImageCacheScript(), getResource("/org/richfaces/renderkit/html/scripts/browser_info.js"), getResource("scripts/panelbar.js") };
+ private final InternetResource[] scripts = {new AjaxScript(),new PrototypeScript(),new ImageCacheScript(), getResource("/org/richfaces/renderkit/html/scripts/browser_info.js"), getResource("/org/richfaces/renderkit/html/scripts/utils.js"), getResource("scripts/panelbar.js") };
protected InternetResource[] getScripts() {
return scripts;
Modified: trunk/ui/panelbar/src/main/resources/org/richfaces/renderkit/html/scripts/panelbar.js
===================================================================
--- trunk/ui/panelbar/src/main/resources/org/richfaces/renderkit/html/scripts/panelbar.js 2008-08-07 12:17:44 UTC (rev 9969)
+++ trunk/ui/panelbar/src/main/resources/org/richfaces/renderkit/html/scripts/panelbar.js 2008-08-07 12:38:03 UTC (rev 9970)
@@ -119,7 +119,7 @@
_getItems: function( e ) {
var kids = new Array();
- var item = e.firstChild;
+ var item = Richfaces.firstDescendant(e);
var index=0;
var id = this.items[index].id;
do
@@ -232,7 +232,7 @@
showContent: function() {
this.content.style.display="block";
- this.content.firstChild.style.height="";
+ Richfaces.firstDescendant(this.content).style.height="";
this.header.style.display="none";
this.header_act.style.display="";
@@ -240,7 +240,7 @@
hideContent: function() {
this.content.style.display="none";
- this.content.firstChild.style.height="100%";
+ Richfaces.firstDescendant(this.content).style.height="100%";
},
hideHeader: function() {
16 years, 3 months
JBoss Rich Faces SVN: r9969 - trunk/docs/userguide/en/src/main/docbook/modules.
by richfaces-svn-commits@lists.jboss.org
Author: msorokin
Date: 2008-08-07 08:17:44 -0400 (Thu, 07 Aug 2008)
New Revision: 9969
Modified:
trunk/docs/userguide/en/src/main/docbook/modules/RFCarchitectover.xml
Log:
https://jira.jboss.org/jira/browse/RF-3990
Recommited info about st. controls skinning sript
Modified: trunk/docs/userguide/en/src/main/docbook/modules/RFCarchitectover.xml
===================================================================
--- trunk/docs/userguide/en/src/main/docbook/modules/RFCarchitectover.xml 2008-08-07 12:02:53 UTC (rev 9968)
+++ trunk/docs/userguide/en/src/main/docbook/modules/RFCarchitectover.xml 2008-08-07 12:17:44 UTC (rev 9969)
@@ -3773,6 +3773,82 @@
</section>
+ <section>
+ <title>Client-side script for extended skinning support</title>
+
+ <para>As it was mentioned earlier in the guide,
+ extended skinning of standard HTML controls is applied automatically:
+ the browser type is detected and if a browser doesn't fully support
+ extended skinning feature, only basic skinning is applied.
+ </para>
+
+ <para>
+ However, if a develop doesn't want to
+ the rich components and standard HTML
+ controls to be skinned automatically and
+ perform the skinnability implementation himself,
+ he might encounter with a problem, i.e. standard
+ HTML controls in such browsers as Opera and Safari are
+ affected by standard controls skinning featured.
+ ( <link linkend="ScriptsandStylesLoadStrategy">Here</link> you can get more details on how to disable skinnability.)
+ </para>
+
+ <para>
+ In brief, to disable the skinnability mechanism of RichFaces you need to
+ set the "org.richfaces.LoadStyleStrategy" parameter to "NONE" in web.xml.
+
+ </para>
+
+ <programlisting role="XML"><![CDATA[...
+<context-param>
+ <param-name>org.richfaces.LoadStyleStrategy</param-name>
+ <param-value>NONE</param-value>
+</context-param>
+...
+]]></programlisting>
+
+ <para>
+ Additionally, you should include the style sheets that perform skinning
+ of the rich component and standard HTML controls.
+ </para>
+
+ <para>
+ In order to resolve the problem with extended skinning in Opera and Safari a client script (skinning.js) is added to the RichFaces library.
+ The script detects the browser type and enables extended skinning only for those browsers that fully support it.
+
+ </para>
+
+ <para>
+ The script can be activated by inserting this JavaScript code to the page:
+ </para>
+
+ <programlisting role="XML"><![CDATA[
+<script type="text/javascript">
+window.RICH_FACES_EXTENDED_SKINNING_ON = true;
+</script>
+]]></programlisting>
+
+
+ <para>
+ You also need to specify "media" attribute in the
+ <link> tag which includes the "extended_both.xcss" style sheet with "rich-extended-skinning".
+
+ </para>
+ <para>
+ This is how you can include the style sheets to the page,
+ in case automatic skinnability implementation is disabled.
+
+ </para>
+
+ <programlisting role="XML"><![CDATA[
+<link href='/YOUR_PROJECT_NAME/a4j_3_2_2-SNAPSHOTorg/richfaces/renderkit/html/css/basic_both.xcss/DATB/eAF7sqpgb-jyGdIAFrMEaw__.jsf' type='text/css' rel='stylesheet' class='component' />
+<link media='rich-extended-skinning' href='/ YOUR_PROJECT_NAME /a4j_3_2_2-SNAPSHOTorg/richfaces/renderkit/html/css/extended_both.xcss/DATB/eAF7sqpgb-jyGdIAFrMEaw__.jsf' type='text/css' rel='stylesheet' class='component' />
+<link href='/ YOUR_PROJECT_NAME /a4j_3_2_2-SNAPSHOT/org/richfaces/skin.xcss/DATB/eAF7sqpgb-jyGdIAFrMEaw__.jsf' type='text/css' rel='stylesheet' class='component' />
+]]></programlisting>
+
+
+
+ </section>
<section id="XCSSfileformat">
<title>XCSS file format</title>
<para>
16 years, 3 months
JBoss Rich Faces SVN: r9968 - in trunk/docs/cdkguide/en/src/main: resources/images and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: artdaw
Date: 2008-08-07 08:02:53 -0400 (Thu, 07 Aug 2008)
New Revision: 9968
Added:
trunk/docs/cdkguide/en/src/main/resources/images/lifecycle.png
Modified:
trunk/docs/cdkguide/en/src/main/docbook/includes/rendererbase.xml
trunk/docs/cdkguide/en/src/main/docbook/includes/template.xml
Log:
https://jira.jboss.org/jira/browse/RF-3692 -Creating a Renderer chapter was fixed.
Modified: trunk/docs/cdkguide/en/src/main/docbook/includes/rendererbase.xml
===================================================================
--- trunk/docs/cdkguide/en/src/main/docbook/includes/rendererbase.xml 2008-08-07 10:13:56 UTC (rev 9967)
+++ trunk/docs/cdkguide/en/src/main/docbook/includes/rendererbase.xml 2008-08-07 12:02:53 UTC (rev 9968)
@@ -14,15 +14,11 @@
After the component tree is restored on the <property>Restore View Phase </property>,
each component in the tree extracts its new value from the request parameters
by using its <code>decode()</code> method. Then the value is stored locally on the component.
+ So in the <code>InputDateRendererBase</code> class you need to override
+ the <code>decode()</code> method:
</para>
- <para>
- The <code>InputDateRendererBase</code> class extends a <code>HeaderResourcesRendererBase</code>
- class. In the <code>HeaderResourcesRendererBase</code> class all the <code>encode()</code> methods for
- the right resources encoding
- are already realized, so in the <code>InputDateRendererBase</code> class you need to override
- the <code>decode()</code> method only:
- </para>
-<programlisting role="JAVA"><![CDATA[ public void decode(FacesContext context, UIComponent component){
+<programlisting role="JAVA"><![CDATA[ ...
+public void decode(FacesContext context, UIComponent component){
ExternalContext external = context.getExternalContext();
Map requestParams = external.getRequestParameterMap();
UIInputDate inputDate = (UIInputDate)component;
@@ -32,7 +28,7 @@
inputDate.setSubmittedValue(submittedValue);
}
}
-]]></programlisting>
+...]]></programlisting>
<para>
As you see in the example above the <code>decode()</code> method reads values from request parameters,
grabs the <code>clientId</code> from the component to identify the request parameter to be looked up.
@@ -69,10 +65,10 @@
and queued on <property>FacesContext</property>.
</para>
<para>
- The <code>getConverter()</code> method of the <code>InputDateRendererBase</code> class controls
- the conversion of entered values, as shown in the following example:
+ The <code>getConverter()</code> method of the <code>InputDateRendererBase</code> class returns the a converter, as shown in the following example:
</para>
-<programlisting role="JAVA"><![CDATA[private Converter getConverter(FacesContext context, UIInputDate inputDate){
+<programlisting role="JAVA"><![CDATA[...
+private Converter getConverter(FacesContext context, UIInputDate inputDate){
Converter converter = inputDate.getConverter();
if (converter == null){
// default the converter
@@ -86,10 +82,10 @@
}
return converter;
}
-]]></programlisting>
+...]]></programlisting>
<para>
- At first you should check whether the application developer has attached a <property>Converter</property> to the
- <emphasis role="bold"><property><inputDate></property></emphasis> component
+ During the converter creation you should check whether the application developer has attached a <property>Converter</property> to the
+ <emphasis role="bold"><property><inputDate></property></emphasis> component already
(for example, <emphasis role="bold"><property><f:convertDateTime></property></emphasis>) .
If not you should follow the next steps:
</para>
@@ -108,8 +104,8 @@
<listitem>
<para>
set the time zone, date type, date style, and date pattern on the new converter with the help of
- <code>setTimeZone</code>, <code>setType</code>, <code>setDateStyle</code>, and
- <code>setPattern</code> methods respectively
+ <code>setTimeZone()</code>, <code>setType()</code>, <code>setDateStyle()</code>, and
+ <code>setPattern()</code> methods respectively
</para>
</listitem>
<listitem>
@@ -134,22 +130,24 @@
<para>
Here is the snippet:
</para>
-<programlisting role="JAVA"><![CDATA[public Object getConvertedValue(FacesContext context, UIComponent component, Object submittedValue) throws ConverterException{
+<programlisting role="JAVA"><![CDATA[...
+public Object getConvertedValue(FacesContext context, UIComponent component, Object submittedValue) throws ConverterException{
UIInputDate inputDate = (UIInputDate)component;
Converter converter = getConverter(context, inputDate);
String valueString = (String)submittedValue;
return converter.getAsObject(context, component, valueString);
-}]]></programlisting>
+}
+...]]></programlisting>
<para>
Finally on the the <property>Renderer Response</property> phase the value of the component is rendered back to the view.
The converter is responsible for transforming the object data back in to a string representation, so you need to
- implement <code>getValueAsString</code>.
- JSF calls the <code>getAsString</code> method of your <property>Converter</property> which converts an Object into a String.
+ implement <code>getValueAsString()</code> method:
</para>
<para>
Here is the example:
</para>
- <programlisting role="JAVA"><![CDATA[protected String getValueAsString(FacesContext context, UIComponent component) throws IOException {
+ <programlisting role="JAVA"><![CDATA[...
+protected String getValueAsString(FacesContext context, UIComponent component) throws IOException {
UIInputDate inputDate = (UIInputDate) component;
String valueString = (String) inputDate.getSubmittedValue();
if (valueString == null) {
@@ -160,7 +158,8 @@
}
}
return valueString;
-}]]></programlisting>
+}
+...]]></programlisting>
</section>
<para>
You could find the whole example of the <code>InputDateRendererBase</code> class <ulink url="examples/InputDateRendererBase.java">here</ulink>.
Modified: trunk/docs/cdkguide/en/src/main/docbook/includes/template.xml
===================================================================
--- trunk/docs/cdkguide/en/src/main/docbook/includes/template.xml 2008-08-07 10:13:56 UTC (rev 9967)
+++ trunk/docs/cdkguide/en/src/main/docbook/includes/template.xml 2008-08-07 12:02:53 UTC (rev 9968)
@@ -55,6 +55,22 @@
<emphasis><property>"id"</property></emphasis> attributes and with
the<emphasis><property>"caption"</property></emphasis> facet
</para>
+ <programlisting role="XML"><![CDATA[...
+<c:object var="caption" type="javax.faces.component.UIComponent"/>
+<jsp:scriptlet>
+ caption = component.getFacet("caption");
+ if(caption !=null && caption.isRendered()) {
+</jsp:scriptlet>
+<div id="#{clientId}_caption" class="my-inputDate-caption #{component.attributes['captionClass']}">
+ <f:insertComponent value="#{caption}"/>
+</div>
+<jsp:scriptlet>
+ }
+</jsp:scriptlet>
+<div id="#{clientId}" title="#{value}" x:passThruWithExclusions="value,name,type,id">
+ ...
+</div>
+...]]></programlisting>
</listitem>
<listitem>
<para>
@@ -64,23 +80,49 @@
<emphasis><property>"name"</property></emphasis>,
<emphasis><property>"type"</property></emphasis>,
<emphasis><property>"class"</property></emphasis>,
-<emphasis><property>"style"</property></emphasis> attributes and with
-the <emphasis><property>"icon"</property></emphasis> facet used to define an icon of the component.
+<emphasis><property>"style"</property></emphasis> attributes.
+It is possible to use the <emphasis><property>"icon"</property></emphasis> facet in order to redefine a default icon of the component.
</para>
+ <programlisting role="XML"><![CDATA[...
+<input id="#{clientId}"
+ name="#{clientId}"
+ type="text"
+ value="#{this:getValueAsString(context, component)}"
+ class="my-inputDate-input #{component.attributes['inputClass']}"
+ style="#{component.attributes['inputStyle']}"/>
+...]]></programlisting>
</listitem>
<listitem>
<para>
<emphasis role="bold"><property><img></property></emphasis> element with
<emphasis><property>"src"</property></emphasis>,
<emphasis><property>"class"</property></emphasis>,
-<emphasis><property>"style"</property></emphasis> attributes.
+<emphasis><property>"style"</property></emphasis> attributes which defines a default icon of the component.
+ In order to add an image to the Template you should register it with the help of
+ <emphasis role="bold"><property><f:resource></property></emphasis> template tag
+ and bind to a variable specified by the <emphasis><property>"var"</property></emphasis> attribute:
</para>
+ <programlisting role="XML"><![CDATA[...
+<f:resource name="/org/mycompany/renderkit/html/images/inputDate.png" var="icon" />
+ ...
+<img src="#{icon}" class="my-inputDate-icon #{component.attributes['iconClass']}" style="#{component.attributes['iconStyle']}"/>
+...]]></programlisting>
</listitem>
</itemizedlist>
<para>
The <emphasis role="bold"><property><inputDate></property></emphasis> component uses styles and scripts that should
be defined in the template with the help of <emphasis role="bold"><property><h:styles></property></emphasis> and
- <emphasis role="bold"><property><h:scripts></property></emphasis> tags. How to register all resources is explained in the
+ <emphasis role="bold"><property><h:scripts></property></emphasis> tags:
+</para>
+ <programlisting role="XML"><![CDATA[...
+<h:scripts>
+ new org.ajax4jsf.javascript.PrototypeScript(),
+ /org/mycompany/renderkit/html/scripts/inputDate.js
+</h:scripts>
+<h:styles>/org/mycompany/renderkit/html/css/inputDate.xcss</h:styles>
+...]]></programlisting>
+<para>
+ How to register all resources is explained in the
<property>"Component resources registration"</property> chapter.
</para>
<important>
@@ -109,12 +151,13 @@
<note>
<title>Note:</title>
<para>
- In the <property>Template Skeleton</property> Renderer Baseclass is <code>org.ajax4jsf.renderkit.AjaxComponentRendererBase</code>, but
- you need to define Renderer Baseclass special for <emphasis role="bold"><property><inputDate></property></emphasis> component.
- In the next section <link linkend="rendererbase">"Creating a Renderer Base class"</link> we will define Renderer Baseclass <code>org.mycompany.renderkit.InputDateRendererBase</code>.
+ As is easy to see, in the <property>Template Skeleton</property> the Renderer Baseclass is <code>org.ajax4jsf.renderkit.AjaxComponentRendererBase</code>.
+ You need to define Renderer Base class special for the <emphasis role="bold"><property><inputDate></property></emphasis> component.
+ In the next section <link linkend="rendererbase">"Creating a Renderer Base class"</link>
+ we will create Renderer Base class <code>org.mycompany.renderkit.InputDateRendererBase</code>.
</para>
</note>
<para>
All the Template tags you could find in the <property>"Template tags overview"</property> chapter.
</para>
- </section>
+ </section>
\ No newline at end of file
Added: trunk/docs/cdkguide/en/src/main/resources/images/lifecycle.png
===================================================================
(Binary files differ)
Property changes on: trunk/docs/cdkguide/en/src/main/resources/images/lifecycle.png
___________________________________________________________________
Name: svn:executable
+ *
Name: svn:mime-type
+ application/octet-stream
16 years, 3 months
JBoss Rich Faces SVN: r9967 - in trunk/samples/richfaces-demo/src/main: webapp/richfaces/fileUpload and 1 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: ilya_shaikovsky
Date: 2008-08-07 06:13:56 -0400 (Thu, 07 Aug 2008)
New Revision: 9967
Modified:
trunk/samples/richfaces-demo/src/main/java/org/richfaces/demo/fileUpload/FileUploadBean.java
trunk/samples/richfaces-demo/src/main/webapp/richfaces/fileUpload/examples/fileUpload.xhtml
trunk/samples/richfaces-demo/src/main/webapp/richfaces/fileUpload/usage.xhtml
Log:
https://jira.jboss.org/jira/browse/RF-3910
Modified: trunk/samples/richfaces-demo/src/main/java/org/richfaces/demo/fileUpload/FileUploadBean.java
===================================================================
--- trunk/samples/richfaces-demo/src/main/java/org/richfaces/demo/fileUpload/FileUploadBean.java 2008-08-07 10:13:17 UTC (rev 9966)
+++ trunk/samples/richfaces-demo/src/main/java/org/richfaces/demo/fileUpload/FileUploadBean.java 2008-08-07 10:13:56 UTC (rev 9967)
@@ -19,6 +19,7 @@
private ArrayList<File> files = new ArrayList<File>();
private int uploadsAvailable = 5;
private boolean autoUpload = false;
+ private boolean useFlash = false;
public int getSize() {
if (getFiles().size()>0){
return getFiles().size();
@@ -78,4 +79,12 @@
this.autoUpload = autoUpload;
}
+ public boolean isUseFlash() {
+ return useFlash;
+ }
+
+ public void setUseFlash(boolean useFlash) {
+ this.useFlash = useFlash;
+ }
+
}
Modified: trunk/samples/richfaces-demo/src/main/webapp/richfaces/fileUpload/examples/fileUpload.xhtml
===================================================================
--- trunk/samples/richfaces-demo/src/main/webapp/richfaces/fileUpload/examples/fileUpload.xhtml 2008-08-07 10:13:17 UTC (rev 9966)
+++ trunk/samples/richfaces-demo/src/main/webapp/richfaces/fileUpload/examples/fileUpload.xhtml 2008-08-07 10:13:56 UTC (rev 9967)
@@ -22,7 +22,7 @@
maxFilesQuantity="#{fileUploadBean.uploadsAvailable}"
reRender="table" id="upload"
immediateUpload="#{fileUploadBean.autoUpload}"
- acceptedTypes="jpg, gif, png, bmp">
+ acceptedTypes="jpg, gif, png, bmp" allowFlash="#{fileUploadBean.useFlash}">
<a4j:support event="onuploadcomplete" reRender="info" />
</rich:fileUpload>
<h:panelGroup id="info">
Modified: trunk/samples/richfaces-demo/src/main/webapp/richfaces/fileUpload/usage.xhtml
===================================================================
--- trunk/samples/richfaces-demo/src/main/webapp/richfaces/fileUpload/usage.xhtml 2008-08-07 10:13:17 UTC (rev 9966)
+++ trunk/samples/richfaces-demo/src/main/webapp/richfaces/fileUpload/usage.xhtml 2008-08-07 10:13:56 UTC (rev 9967)
@@ -38,12 +38,27 @@
just after file added to list. But you could freely manage the list (add
or remove some files from list while upload performed)
</p>
- <h:outputText value="Turn Automatic upload on:"/>
+ <p>
+ Also starting from 3.2.2 version File Upload could be configured to use flash
+ object in order to provide additional features (covered in developer guide)
+ to component.
+ </p>
<h:form>
- <h:selectBooleanCheckbox value="#{fileUploadBean.autoUpload}">
- <a4j:support event="onclick" reRender="upload"/>
- </h:selectBooleanCheckbox>
- </h:form>
+ <h:panelGrid columns="2">
+ <h:panelGroup>
+ <h:outputText value="Turn Automatic upload on:"/>
+ <h:selectBooleanCheckbox value="#{fileUploadBean.autoUpload}">
+ <a4j:support event="onclick" reRender="upload" ajaxSingle="true"/>
+ </h:selectBooleanCheckbox>
+ </h:panelGroup>
+ <h:panelGroup>
+ <h:outputText value="Turn using flash on:"/>
+ <h:selectBooleanCheckbox value="#{fileUploadBean.useFlash}">
+ <a4j:support event="onclick" reRender="upload" ajaxSingle="true"/>
+ </h:selectBooleanCheckbox>
+ </h:panelGroup>
+ </h:panelGrid>
+ </h:form>
<p>
In this example file types restricted to jpg, gif, png and bmp files using <b>acceptedTypes </b>attribute.
</p>
@@ -62,9 +77,6 @@
(1000000 for this example).
</li>
</ul>
- <p>
-
- </p>
</fieldset>
</ui:define>
16 years, 3 months
JBoss Rich Faces SVN: r9965 - in trunk/docs: cdkguide/en/src/main/resources/images and 2 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: artdaw
Date: 2008-08-07 05:19:48 -0400 (Thu, 07 Aug 2008)
New Revision: 9965
Added:
trunk/docs/cdkguide/en/src/main/resources/images/richfaces_label2.png
trunk/docs/faq/en/src/main/resources/images/richfaces_label2.png
trunk/docs/migrationguide/en/src/main/resources/images/richfaces_label2.png
Modified:
trunk/docs/cdkguide/en/src/main/docbook/master.xml
Log:
https://jira.jboss.org/jira/browse/RF-4065 - The banner was added to RichFaces Migration Guide, FAQ, CDK Guide
Modified: trunk/docs/cdkguide/en/src/main/docbook/master.xml
===================================================================
--- trunk/docs/cdkguide/en/src/main/docbook/master.xml 2008-08-07 09:18:06 UTC (rev 9964)
+++ trunk/docs/cdkguide/en/src/main/docbook/master.xml 2008-08-07 09:19:48 UTC (rev 9965)
@@ -88,10 +88,17 @@
Component functionality typically centers around two actions:
<property>decoding</property> and <property>encoding</property> data.
Decoding is the process of converting incoming request parameters to the values of the component.
- Encoding is converting the current values of the component into the corresponding markup. In the
+ Encoding is the process of converting the current values of the component into the corresponding markup. In the
following figure you can see decoding and encoding occur in the JSF lifecycle:
</para>
- <!-- PIC -->
+ <figure>
+ <title>Decoding and encoding in the JSF lifecycle</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/lifecycle.png"/>
+ </imageobject>
+ </mediaobject>
+ </figure>
<para>
Thus, JSF components consist of two parts: the <property>component class</property> and the <property>renderer</property>.
The <property>component class</property> is responsible for the state and behavior of a UI component and will be discussed later in the <property>"Configuring component"</property> section.
@@ -108,7 +115,7 @@
<itemizedlist>
<listitem>
<para>
- <code>InputDateRenderer</code> class where you should override <code>encode()</code> method
+ <code>InputDateRenderer</code> class where you should override <code>encode()</code> methods for encoding the markup and resources
</para>
</listitem>
<listitem>
Added: trunk/docs/cdkguide/en/src/main/resources/images/richfaces_label2.png
===================================================================
(Binary files differ)
Property changes on: trunk/docs/cdkguide/en/src/main/resources/images/richfaces_label2.png
___________________________________________________________________
Name: svn:executable
+ *
Name: svn:mime-type
+ application/octet-stream
Added: trunk/docs/faq/en/src/main/resources/images/richfaces_label2.png
===================================================================
(Binary files differ)
Property changes on: trunk/docs/faq/en/src/main/resources/images/richfaces_label2.png
___________________________________________________________________
Name: svn:executable
+ *
Name: svn:mime-type
+ application/octet-stream
Added: trunk/docs/migrationguide/en/src/main/resources/images/richfaces_label2.png
===================================================================
(Binary files differ)
Property changes on: trunk/docs/migrationguide/en/src/main/resources/images/richfaces_label2.png
___________________________________________________________________
Name: svn:executable
+ *
Name: svn:mime-type
+ application/octet-stream
16 years, 3 months