JBoss Rich Faces SVN: r7028 - trunk/docs/userguide/en/src/main/docbook/included.
by richfaces-svn-commits@lists.jboss.org
Author: cluts
Date: 2008-03-20 14:25:06 -0400 (Thu, 20 Mar 2008)
New Revision: 7028
Modified:
trunk/docs/userguide/en/src/main/docbook/included/column.xml
trunk/docs/userguide/en/src/main/docbook/included/columns.xml
trunk/docs/userguide/en/src/main/docbook/included/dataTable.xml
trunk/docs/userguide/en/src/main/docbook/included/scrollableDataTable.xml
Log:
RF-1740 - sorting and filtering:added information about new attributes, added links to other chapters.
Modified: trunk/docs/userguide/en/src/main/docbook/included/column.xml
===================================================================
--- trunk/docs/userguide/en/src/main/docbook/included/column.xml 2008-03-20 18:23:15 UTC (rev 7027)
+++ trunk/docs/userguide/en/src/main/docbook/included/column.xml 2008-03-20 18:25:06 UTC (rev 7028)
@@ -183,8 +183,8 @@
component that is described in <link linkend="columnGroup">the following chapter</link>.</para>
</section>
- <section>
- <title id="sortAndFilter">Sorting and Filtering</title>
+ <section id="sortAndFilter">
+ <title>Sorting and Filtering</title>
<section>
<title>Sorting</title>
<para>In order to sort the columns you should use <emphasis><property>"sortBy"</property></emphasis> attribute which defines a bean property which is used for sorting of a column.</para>
@@ -435,12 +435,14 @@
<imagedata fileref="images/columnsort3.png"/>
</imageobject>
</mediaobject>
- </figure>
+ </figure>
+ <para><emphasis><property>"sortExpression"</property></emphasis> attribute defines a bean property which is used for sorting of a column. Usage of this attribute is not recommendable.</para>
<para>Sorting can't be used together with pagination.</para>
</section>
<section>
<title>Filtering</title>
<para>In order to filter the column value, in accordance with the entered value, it is necessary to use a <emphasis><property>"filterBy"</property></emphasis> attribute.</para>
+ <para>If <emphasis><property>"filterValue"</property></emphasis> attribute isn't empty from the beginning – table should be filtered on first rendering.</para>
<para>Below you can see example code and the result of its use:</para>
<para>
<emphasis role="bold">Example:</emphasis>
@@ -457,7 +459,7 @@
</f:facet>
<h:graphicImage value="#{cap.stateFlag}"/>
</rich:column>
- <rich:column filterBy="#{cap.state}" filterDefaultLabel="click to filter">
+ <rich:column filterBy="#{cap.state}" filterDefaultLabel="click to filter" filterValue="#{filterName.filterBean}">
<h:outputText value="#{cap.state}"></h:outputText>
</rich:column>
<rich:column filterBy="#{cap.name}" filterDefaultLabel="click to filter">
@@ -503,13 +505,14 @@
</rich:dataTable>
</h:form>
...]]></programlisting>
- <para><emphasis><property>"filterFunction"</property></emphasis> attribute has three values:</para>
+<!-- <para><emphasis><property>"filterFunction"</property></emphasis> attribute has three values:</para>
<itemizedlist>
<listitem><emphasis><property>"startWith"</property></emphasis>(by default)</listitem>
<listitem><emphasis><property>"contains"</property></emphasis></listitem>
<listitem><emphasis><property>"equals"</property></emphasis></listitem>
</itemizedlist>
- <para>Example of usage you could see in the previous example.</para>
+ <para>Example of usage you could see in the previous example.</para> -->
+ <para><emphasis><property>"filterEvent"</property></emphasis> attribute is used for customization. </para>
<para><emphasis><property>"filterMethod"</property></emphasis> should be called for every object of the table. It should get current object and return boolean value. </para>
</section>
Modified: trunk/docs/userguide/en/src/main/docbook/included/columns.xml
===================================================================
--- trunk/docs/userguide/en/src/main/docbook/included/columns.xml 2008-03-20 18:23:15 UTC (rev 7027)
+++ trunk/docs/userguide/en/src/main/docbook/included/columns.xml 2008-03-20 18:25:06 UTC (rev 7028)
@@ -233,7 +233,7 @@
</imageobject>
</mediaobject>
</figure-->
-
+ <para>Information about sorting and filtering you can find <link linkend="sortAndFilter">here</link>.</para>
</section>
Modified: trunk/docs/userguide/en/src/main/docbook/included/dataTable.xml
===================================================================
--- trunk/docs/userguide/en/src/main/docbook/included/dataTable.xml 2008-03-20 18:23:15 UTC (rev 7027)
+++ trunk/docs/userguide/en/src/main/docbook/included/dataTable.xml 2008-03-20 18:25:06 UTC (rev 7028)
@@ -157,7 +157,7 @@
</imageobject>
</mediaobject>
</figure>
-
+ <para>Information about sorting and filtering you can find <link linkend="sortAndFilter">here</link>.</para>
</section>
<section>
<title>Look-and-Feel Customization</title>
Modified: trunk/docs/userguide/en/src/main/docbook/included/scrollableDataTable.xml
===================================================================
--- trunk/docs/userguide/en/src/main/docbook/included/scrollableDataTable.xml 2008-03-20 18:23:15 UTC (rev 7027)
+++ trunk/docs/userguide/en/src/main/docbook/included/scrollableDataTable.xml 2008-03-20 18:25:06 UTC (rev 7028)
@@ -207,6 +207,7 @@
<listitem>onRowMouseDown</listitem>
</itemizedlist>
</para>
+ <para>Information about sorting and filtering you can find <link linkend="sortAndFilter">here</link>.</para>
</section>
16 years, 10 months
JBoss Rich Faces SVN: r7027 - trunk/framework/impl/src/main/javascript/prototype.
by richfaces-svn-commits@lists.jboss.org
Author: sergeyhalipov
Date: 2008-03-20 14:23:15 -0400 (Thu, 20 Mar 2008)
New Revision: 7027
Modified:
trunk/framework/impl/src/main/javascript/prototype/prototype-1.6.0.2.js
Log:
http://jira.jboss.com/jira/browse/RF-2538
http://jira.jboss.com/jira/browse/RF-1914
Modified: trunk/framework/impl/src/main/javascript/prototype/prototype-1.6.0.2.js
===================================================================
--- trunk/framework/impl/src/main/javascript/prototype/prototype-1.6.0.2.js 2008-03-20 18:07:18 UTC (rev 7026)
+++ trunk/framework/impl/src/main/javascript/prototype/prototype-1.6.0.2.js 2008-03-20 18:23:15 UTC (rev 7027)
@@ -73,6 +73,10 @@
Class.Methods = {
addMethods: function(source) {
+ if (!source) {
+ return;
+ }
+
var ancestor = this.superclass && this.superclass.prototype;
var properties = Object.keys(source);
16 years, 10 months
JBoss Rich Faces SVN: r7026 - trunk/ui/inplaceSelect/src/main/templates.
by richfaces-svn-commits@lists.jboss.org
Author: abelevich
Date: 2008-03-20 14:07:18 -0400 (Thu, 20 Mar 2008)
New Revision: 7026
Modified:
trunk/ui/inplaceSelect/src/main/templates/inplaceselect.jspx
Log:
http://jira.jboss.com/jira/browse/RF-2643
Modified: trunk/ui/inplaceSelect/src/main/templates/inplaceselect.jspx
===================================================================
--- trunk/ui/inplaceSelect/src/main/templates/inplaceselect.jspx 2008-03-20 18:05:10 UTC (rev 7025)
+++ trunk/ui/inplaceSelect/src/main/templates/inplaceselect.jspx 2008-03-20 18:07:18 UTC (rev 7026)
@@ -134,7 +134,7 @@
]]>
</jsp:scriptlet>
</div>
- <div id="listParent#{clientId}" class="rich-inplace-select-width-list" style="position : absolute; height : 100px; left : 0px; top: 13px">
+ <div id="listParent#{clientId}" class="rich-inplace-select-width-list" style="display: none; position : absolute; height : 100px; left : 0px; top: 13px">
<div class="rich-inplace-select-list-shadow">
<table id="shadow#{clientId}" cellpadding="0" cellspacing="0" border="0" width="257" height="109">
<tr>
@@ -162,8 +162,50 @@
</div>
</div>
</div>
+ <script type="text/javascript">
+ Richfaces.InplaceSelect.CLASSES = {
+ COMBO_LIST : {
+ LIST : {CLASSES :{ACTIVE : "rich-inplace-select-list-scroll rich-inplace-select-list-decoration rich-inplace-select-list-position #{listClass}"
+ }
+ },
+ ITEM : {NORMAL : "rich-inplace-select-item rich-inplace-select-font #{itemClass}",
+ SELECTED : 'rich-inplace-select-item rich-inplace-select-font rich-inplace-select-selected-item #{itemSelectedClass}'
+ }
+ },
+ COMPONENT : {CHANGED : {NORMAL : 'rich-inplace-select rich-inplace-select-view rich-inplace-select-changed #{component.attributes["changedClass"]}', HOVERED : 'rich-inplace-select-changed-hover #{component.attributes["changedHoverClass"]}'},
+ VIEW : {NORMAL : 'rich-inplace-select rich-inplace-select-view #{component.attributes["viewClass"]}', HOVERED : 'rich-inplace-select-view-hover #{component.attributes["viewHoverClass"]}'},
+ EDITABLE : 'rich-inplace-select rich-inplace-select-edit #{component.attributes["editClass"]}'
+ }
+ };
+
+ var richInplaceSelAttributes = {defaultLabel : '#{component.attributes["defaultLabel"]}',
+ showControls : #{component.attributes["showControls"]},
+ editEvent : '#{component.attributes["editEvent"]}',
+ verticalPosition : '#{component.attributes["controlsVerticalPosition"]}',
+ horizontalPosition : '#{component.attributes["controlsHorizontalPosition"]}',
+ inputWidth : '#{component.attributes["selectWidth"]}',
+ minInputWidth : '#{component.attributes["minSelectWidth"]}',
+ maxInputWidth : '#{component.attributes["maxSelectWidth"]}',
+ openOnEdit:#{component.attributes["openOnEdit"]}
+ };
+
+ var richInplaceSelEvents = {oneditactivation : #{this:getAsEventHandler(context, component, "oneditactivation")},
+ onviewactivation : #{this:getAsEventHandler(context, component, "onviewactivation")},
+ oneditactivated : #{this:getAsEventHandler(context, component, "oneditactivated")},
+ onviewactivated : #{this:getAsEventHandler(context, component, "onviewactivated")}};
+
+ var richInplaceList = new Richfaces.InplaceSelectList('list#{clientId}', 'listParent#{clientId}', true,
+ Richfaces.InplaceSelect.CLASSES.COMBO_LIST, '#{component.attributes["listWidth"]}', '#{component.attributes["listHeight"]}', #{this:getItemsTextAsJSArray(context, component)}, null,
+ '#{clientId}inplaceTmpValue', 'shadow#{clientId}', 0, 0);
+ var richInplaceSelect = new Richfaces.InplaceSelect(richInplaceList, '#{clientId}', '#{clientId}inplaceTmpValue',
+ '#{clientId}inplaceValue', '#{clientId}tabber',
+ richInplaceSelAttributes, richInplaceSelEvents, Richfaces.InplaceSelect.CLASSES,
+ ['#{clientId}bar', '#{clientId}ok', '#{clientId}cancel', '#{clientId}buttons', '#{clientId}btns_shadow'], '#{clientId}inselArrow');
+ </script>
</div>
#{value}
+
+
<jsp:scriptlet>
if (layout.equals("block")) {
</jsp:scriptlet>
@@ -176,46 +218,4 @@
}
</jsp:scriptlet>
-
-<script type="text/javascript">
- Richfaces.InplaceSelect.CLASSES = {
- COMBO_LIST : {
- LIST : {CLASSES :{ACTIVE : "rich-inplace-select-list-scroll rich-inplace-select-list-decoration rich-inplace-select-list-position #{listClass}"
- }
- },
- ITEM : {NORMAL : "rich-inplace-select-item rich-inplace-select-font #{itemClass}",
- SELECTED : 'rich-inplace-select-item rich-inplace-select-font rich-inplace-select-selected-item #{itemSelectedClass}'
- }
- },
- COMPONENT : {CHANGED : {NORMAL : 'rich-inplace-select rich-inplace-select-view rich-inplace-select-changed #{component.attributes["changedClass"]}', HOVERED : 'rich-inplace-select-changed-hover #{component.attributes["changedHoverClass"]}'},
- VIEW : {NORMAL : 'rich-inplace-select rich-inplace-select-view #{component.attributes["viewClass"]}', HOVERED : 'rich-inplace-select-view-hover #{component.attributes["viewHoverClass"]}'},
- EDITABLE : 'rich-inplace-select rich-inplace-select-edit #{component.attributes["editClass"]}'
- }
- };
-
- var richInplaceSelAttributes = {defaultLabel : '#{component.attributes["defaultLabel"]}',
- showControls : #{component.attributes["showControls"]},
- editEvent : '#{component.attributes["editEvent"]}',
- verticalPosition : '#{component.attributes["controlsVerticalPosition"]}',
- horizontalPosition : '#{component.attributes["controlsHorizontalPosition"]}',
- inputWidth : '#{component.attributes["selectWidth"]}',
- minInputWidth : '#{component.attributes["minSelectWidth"]}',
- maxInputWidth : '#{component.attributes["maxSelectWidth"]}',
- openOnEdit:#{component.attributes["openOnEdit"]}
- };
-
- var richInplaceSelEvents = {oneditactivation : #{this:getAsEventHandler(context, component, "oneditactivation")},
- onviewactivation : #{this:getAsEventHandler(context, component, "onviewactivation")},
- oneditactivated : #{this:getAsEventHandler(context, component, "oneditactivated")},
- onviewactivated : #{this:getAsEventHandler(context, component, "onviewactivated")}};
-
- var richInplaceList = new Richfaces.InplaceSelectList('list#{clientId}', 'listParent#{clientId}', true,
- Richfaces.InplaceSelect.CLASSES.COMBO_LIST, '#{component.attributes["listWidth"]}', '#{component.attributes["listHeight"]}', #{this:getItemsTextAsJSArray(context, component)}, null,
- '#{clientId}inplaceTmpValue', 'shadow#{clientId}', 0, 0);
- var richInplaceSelect = new Richfaces.InplaceSelect(richInplaceList, '#{clientId}', '#{clientId}inplaceTmpValue',
- '#{clientId}inplaceValue', '#{clientId}tabber',
- richInplaceSelAttributes, richInplaceSelEvents, Richfaces.InplaceSelect.CLASSES,
- ['#{clientId}bar', '#{clientId}ok', '#{clientId}cancel', '#{clientId}buttons', '#{clientId}btns_shadow'], '#{clientId}inselArrow');
-</script>
-
</f:root>
16 years, 10 months
JBoss Rich Faces SVN: r7025 - trunk/ui/inplaceInput/src/main/templates.
by richfaces-svn-commits@lists.jboss.org
Author: abelevich
Date: 2008-03-20 14:05:10 -0400 (Thu, 20 Mar 2008)
New Revision: 7025
Modified:
trunk/ui/inplaceInput/src/main/templates/inplaceinput.jspx
Log:
http://jira.jboss.com/jira/browse/RF-2643
Modified: trunk/ui/inplaceInput/src/main/templates/inplaceinput.jspx
===================================================================
--- trunk/ui/inplaceInput/src/main/templates/inplaceinput.jspx 2008-03-20 17:28:45 UTC (rev 7024)
+++ trunk/ui/inplaceInput/src/main/templates/inplaceinput.jspx 2008-03-20 18:05:10 UTC (rev 7025)
@@ -157,8 +157,19 @@
}
]]>
</jsp:scriptlet>
+ <script type="text/javascript">
+
+ #{this:encodeScriptAttributes(context, component)};
+ #{this:encodeScriptEvents(context, component)};
+ #{this:encodeInplaceInputCss(context, component)};
+
+ var inplaceInput = new Richfaces.InplaceInput('#{clientId}', '#{clientId}tempValue', '#{clientId}value', '#{clientId}tabber',
+ attributes, events, classes, ['#{clientId}bar',
+ '#{clientId}ok', '#{clientId}cancel', '#{clientId}buttons','#{clientId}btns_shadow']);
+ </script>
</div>
- #{value}
+ #{value}
+
<jsp:scriptlet>
@@ -172,15 +183,4 @@
<jsp:scriptlet>
}
</jsp:scriptlet>
-
- <script type="text/javascript">
-
- #{this:encodeScriptAttributes(context, component)};
- #{this:encodeScriptEvents(context, component)};
- #{this:encodeInplaceInputCss(context, component)};
-
- var inplaceInput = new Richfaces.InplaceInput('#{clientId}', '#{clientId}tempValue', '#{clientId}value', '#{clientId}tabber',
- attributes, events, classes, ['#{clientId}bar',
- '#{clientId}ok', '#{clientId}cancel', '#{clientId}buttons','#{clientId}btns_shadow']);
- </script>
</f:root>
\ No newline at end of file
16 years, 10 months
JBoss Rich Faces SVN: r7024 - trunk/samples/richfaces-demo/src/main/webapp/richfaces/treeNodesAdaptor.
by richfaces-svn-commits@lists.jboss.org
Author: dsvyatobatsko
Date: 2008-03-20 13:28:45 -0400 (Thu, 20 Mar 2008)
New Revision: 7024
Modified:
trunk/samples/richfaces-demo/src/main/webapp/richfaces/treeNodesAdaptor/usage.xhtml
Log:
[RF-2626] Demo site: corrections of Recursive Tree Adaptor and Tree Adaptor demo layouts
Modified: trunk/samples/richfaces-demo/src/main/webapp/richfaces/treeNodesAdaptor/usage.xhtml
===================================================================
--- trunk/samples/richfaces-demo/src/main/webapp/richfaces/treeNodesAdaptor/usage.xhtml 2008-03-20 17:28:01 UTC (rev 7023)
+++ trunk/samples/richfaces-demo/src/main/webapp/richfaces/treeNodesAdaptor/usage.xhtml 2008-03-20 17:28:45 UTC (rev 7024)
@@ -20,6 +20,9 @@
the second "nodes" is used on another recursion levels (the second level and deeper).
</p>
+ <fieldset class="demo_fieldset">
+ <legend class="demo_legend">Example</legend>
+
<h:panelGroup rendered="#{not empty fileSystemBean.sourceRoots}">
<div class="sample-container" >
<ui:include src="/richfaces/treeNodesAdaptor/examples/recursiveAdaptor.xhtml"/>
@@ -52,16 +55,19 @@
The information for this demo is generated and incorporated in the richfaces-demo.war
file with Maven process. Demo artifacts are located under /WEB-INF/src folder.<br/>
As soon as you read this text, you have no such folder in your run-time enviroment
- right now.<br />
+ right now.<br/>
If you use Jetty to run, use 'mvn jetty:run-war' command.
</f:verbatim>
-
+ </fieldset><br/><br/>
<p>Model adaptor components can be nested without any limitations. The following code-snippet
shows an example of using Nodes Adapter along with rich:tree</p>
- <div class="sample-container">
- <rich:insert src="/richfaces/treeNodesAdaptor/snippets/sample.xhtml" highlight="xhtml" />
- </div>
-
+ <fieldset class="demo_fieldset">
+ <legend class="demo_legend">Code</legend>
+
+ <div class="sample-container">
+ <rich:insert src="/richfaces/treeNodesAdaptor/snippets/sample.xhtml" highlight="xhtml" />
+ </div>
+ </fieldset>
<p>Data model nodes are wired to treeNode components by nesting treeNode components with a "type"
attribute not defined inside model adaptor components. The first rendered one is used, or the default
one if all treeNode components are non-rendered.
16 years, 10 months
JBoss Rich Faces SVN: r7023 - in trunk/samples/richfaces-demo/src/main/webapp/richfaces/tree: examples and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: dsvyatobatsko
Date: 2008-03-20 13:28:01 -0400 (Thu, 20 Mar 2008)
New Revision: 7023
Modified:
trunk/samples/richfaces-demo/src/main/webapp/richfaces/tree/examples/ajaxTree.xhtml
trunk/samples/richfaces-demo/src/main/webapp/richfaces/tree/examples/clientTree.xhtml
trunk/samples/richfaces-demo/src/main/webapp/richfaces/tree/examples/serverTree.xhtml
trunk/samples/richfaces-demo/src/main/webapp/richfaces/tree/usage.xhtml
Log:
[RF-2624] Demo site: corrections of Tree demo layout
Modified: trunk/samples/richfaces-demo/src/main/webapp/richfaces/tree/examples/ajaxTree.xhtml
===================================================================
--- trunk/samples/richfaces-demo/src/main/webapp/richfaces/tree/examples/ajaxTree.xhtml 2008-03-20 17:26:20 UTC (rev 7022)
+++ trunk/samples/richfaces-demo/src/main/webapp/richfaces/tree/examples/ajaxTree.xhtml 2008-03-20 17:28:01 UTC (rev 7023)
@@ -5,7 +5,7 @@
xmlns:a4j="http://richfaces.org/a4j"
xmlns:rich="http://richfaces.org/rich">
- <p>This tree uses "ajax" switch type, note that for collapse/expand operations it will be Ajax request to the server. You may see short delay in this case.</p>
+ <p>This tree uses "ajax" switch type, note that for collapse/expand operations it will be Ajax request to the server. You may see short delay in this case.</p><br/>
<h:form>
<rich:tree style="width:300px" value="#{library.data}" var="item" nodeFace="#{item.type}">
<rich:treeNode type="artist" iconLeaf="/images/tree/singer.gif" icon="/images/tree/singer.gif">
Modified: trunk/samples/richfaces-demo/src/main/webapp/richfaces/tree/examples/clientTree.xhtml
===================================================================
--- trunk/samples/richfaces-demo/src/main/webapp/richfaces/tree/examples/clientTree.xhtml 2008-03-20 17:26:20 UTC (rev 7022)
+++ trunk/samples/richfaces-demo/src/main/webapp/richfaces/tree/examples/clientTree.xhtml 2008-03-20 17:28:01 UTC (rev 7023)
@@ -5,7 +5,7 @@
xmlns:a4j="http://richfaces.org/a4j"
xmlns:rich="http://richfaces.org/rich">
- <p>This is exactly the same tree, but now it uses "client" switch type. Note, that all nodes actually rendered up-front and expand/collapse now do not requre server call</p>
+ <p>This is exactly the same tree, but now it uses "client" switch type. Note, that all nodes actually rendered up-front and expand/collapse now do not requre server call</p><br/>
<h:form>
<rich:tree switchType="client" style="width:300px" value="#{library.data}" var="item" nodeFace="#{item.type}">
<rich:treeNode type="artist" iconLeaf="/images/tree/singer.gif" icon="/images/tree/singer.gif">
Modified: trunk/samples/richfaces-demo/src/main/webapp/richfaces/tree/examples/serverTree.xhtml
===================================================================
--- trunk/samples/richfaces-demo/src/main/webapp/richfaces/tree/examples/serverTree.xhtml 2008-03-20 17:26:20 UTC (rev 7022)
+++ trunk/samples/richfaces-demo/src/main/webapp/richfaces/tree/examples/serverTree.xhtml 2008-03-20 17:28:01 UTC (rev 7023)
@@ -5,7 +5,7 @@
xmlns:a4j="http://richfaces.org/a4j"
xmlns:rich="http://richfaces.org/rich">
- <p>This is again same tree, but now it uses "server" switch type. Full page content will be reloaded at every click.</p>
+ <p>This is again same tree, but now it uses "server" switch type. Full page content will be reloaded at every click.</p><br/>
<h:form>
<rich:tree switchType="server" style="width:300px" value="#{library.data}" var="item" nodeFace="#{item.type}">
<rich:treeNode type="artist" iconLeaf="/images/tree/singer.gif" icon="/images/tree/singer.gif">
Modified: trunk/samples/richfaces-demo/src/main/webapp/richfaces/tree/usage.xhtml
===================================================================
--- trunk/samples/richfaces-demo/src/main/webapp/richfaces/tree/usage.xhtml 2008-03-20 17:26:20 UTC (rev 7022)
+++ trunk/samples/richfaces-demo/src/main/webapp/richfaces/tree/usage.xhtml 2008-03-20 17:28:01 UTC (rev 7023)
@@ -17,25 +17,35 @@
<li>Built-in drag/drop capabilities</li>
<li>Flexible look</li>
</ul>
- <div class="sample-container" >
- <ui:include src="/richfaces/tree/examples/ajaxTree.xhtml"/>
- <ui:include src="/templates/include/sourceview.xhtml">
- <ui:param name="sourcepath" value="/richfaces/tree/examples/ajaxTree.xhtml"/>
- </ui:include>
- </div>
- <div class="sample-container" >
- <ui:include src="/richfaces/tree/examples/clientTree.xhtml"/>
- <ui:include src="/templates/include/sourceview.xhtml">
- <ui:param name="sourcepath" value="/richfaces/tree/examples/clientTree.xhtml"/>
- </ui:include>
- </div>
- <div class="sample-container" >
- <ui:include src="/richfaces/tree/examples/serverTree.xhtml"/>
- <ui:include src="/templates/include/sourceview.xhtml">
- <ui:param name="sourcepath" value="/richfaces/tree/examples/serverTree.xhtml"/>
- </ui:include>
- </div>
- <p>
+ <fieldset class="demo_fieldset">
+ <legend class="demo_legend">Ajax switch type</legend>
+ <div class="sample-container">
+ <ui:include src="/richfaces/tree/examples/ajaxTree.xhtml"/>
+ <ui:include src="/templates/include/sourceview.xhtml">
+ <ui:param name="sourcepath" value="/richfaces/tree/examples/ajaxTree.xhtml"/>
+ </ui:include>
+ </div>
+ </fieldset>
+ <fieldset class="demo_fieldset">
+ <legend class="demo_legend">Client switch type</legend>
+
+ <div class="sample-container" >
+ <ui:include src="/richfaces/tree/examples/clientTree.xhtml"/>
+ <ui:include src="/templates/include/sourceview.xhtml">
+ <ui:param name="sourcepath" value="/richfaces/tree/examples/clientTree.xhtml"/>
+ </ui:include>
+ </div>
+ </fieldset>
+ <fieldset class="demo_fieldset">
+ <legend class="demo_legend">Server switch type</legend>
+ <div class="sample-container" >
+ <ui:include src="/richfaces/tree/examples/serverTree.xhtml"/>
+ <ui:include src="/templates/include/sourceview.xhtml">
+ <ui:param name="sourcepath" value="/richfaces/tree/examples/serverTree.xhtml"/>
+ </ui:include>
+ </div>
+ </fieldset>
+ <p class="note">
Note how the tree switched on "client" does not "remember" its state when whole page is reloaded. At the same time "ajax" tree remembers its state without any additional code.
</p>
</ui:define>
16 years, 10 months
JBoss Rich Faces SVN: r7022 - in trunk: ui/suggestionbox/src/main/config/component and 2 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: pyaschenko
Date: 2008-03-20 13:26:20 -0400 (Thu, 20 Mar 2008)
New Revision: 7022
Modified:
trunk/samples/suggestionbox-sample/src/main/webapp/pages/index.jsp
trunk/ui/suggestionbox/src/main/config/component/suggestionbox.xml
trunk/ui/suggestionbox/src/main/java/org/richfaces/renderkit/html/SuggestionBoxRenderer.java
trunk/ui/suggestionbox/src/main/resources/org/richfaces/renderkit/html/scripts/suggestionbox.js
Log:
RF-2576
Modified: trunk/samples/suggestionbox-sample/src/main/webapp/pages/index.jsp
===================================================================
--- trunk/samples/suggestionbox-sample/src/main/webapp/pages/index.jsp 2008-03-20 17:06:42 UTC (rev 7021)
+++ trunk/samples/suggestionbox-sample/src/main/webapp/pages/index.jsp 2008-03-20 17:26:20 UTC (rev 7022)
@@ -42,7 +42,7 @@
<h:panelGroup>
<h:inputText value="#{suggestionBox.property}" id="text"/>
- <rich:suggestionbox id="suggestionBoxId" for="text" tokens=",["
+ <rich:suggestionbox id="suggestionBoxId" for="text"
rules="#{suggestionBox.rules}"
suggestionAction="#{suggestionBox.autocomplete}" var="result"
fetchValue="#{result.text}"
@@ -79,7 +79,8 @@
width="#{suggestionBox.width}"
height="#{suggestionBox.height}"
shadowDepth="#{suggestionBox.shadowDepth}"
- cellpadding="#{suggestionBox.cellpadding}">
+ cellpadding="#{suggestionBox.cellpadding}"
+ useSuggestObjects="true">
<a4j:ajaxListener type="org.richfaces.AjaxListener"/>
<h:column>
Modified: trunk/ui/suggestionbox/src/main/config/component/suggestionbox.xml
===================================================================
--- trunk/ui/suggestionbox/src/main/config/component/suggestionbox.xml 2008-03-20 17:06:42 UTC (rev 7021)
+++ trunk/ui/suggestionbox/src/main/config/component/suggestionbox.xml 2008-03-20 17:26:20 UTC (rev 7022)
@@ -87,6 +87,14 @@
</description>
<defaultvalue>true</defaultvalue>
</property>
+ <property>
+ <name>useSuggestObjects</name>
+ <classname>boolean</classname>
+ <description>
+ if true suggested object list will be created and witt be updated every time when user changes input value
+ </description>
+ <defaultvalue>false</defaultvalue>
+ </property>
<property hidden="true">
<name>submitted</name>
<classname>boolean</classname>
Modified: trunk/ui/suggestionbox/src/main/java/org/richfaces/renderkit/html/SuggestionBoxRenderer.java
===================================================================
--- trunk/ui/suggestionbox/src/main/java/org/richfaces/renderkit/html/SuggestionBoxRenderer.java 2008-03-20 17:06:42 UTC (rev 7021)
+++ trunk/ui/suggestionbox/src/main/java/org/richfaces/renderkit/html/SuggestionBoxRenderer.java 2008-03-20 17:26:20 UTC (rev 7022)
@@ -68,7 +68,7 @@
*/
private static final String[] OPTIONS = {"popupClass", "popupStyle",
"width", "height", "entryClass", "selectedClass", "param",
- "frequency", "minChars", "tokens", "rows", "selectValueClass" };
+ "frequency", "minChars", "tokens", "rows", "selectValueClass", "useSuggestObjects" };
/**
* Shadow depth.
@@ -407,7 +407,6 @@
|| attributes.get("fetchValue") != null) {
options.put("select", attributes.get("selectValueClass"));
}
-
submitSuggest.addParameter(options);
script.append(submitSuggest.toScript()).append(";\n");
return "Richfaces.onAvailable('" + targetId + "', function() {" + script.toString() + "});";
Modified: trunk/ui/suggestionbox/src/main/resources/org/richfaces/renderkit/html/scripts/suggestionbox.js
===================================================================
--- trunk/ui/suggestionbox/src/main/resources/org/richfaces/renderkit/html/scripts/suggestionbox.js 2008-03-20 17:06:42 UTC (rev 7021)
+++ trunk/ui/suggestionbox/src/main/resources/org/richfaces/renderkit/html/scripts/suggestionbox.js 2008-03-20 17:26:20 UTC (rev 7022)
@@ -685,7 +685,7 @@
while (this.startPosition>0 && tokens.indexOf(oldValue.charAt(this.startPosition-1))==-1) this.startPosition--;
}
- this.updateItems(oldValue);
+ if (this.options.useSuggestObjects) this.updateItems(oldValue);
}
if (this.getToken().length >= this.options.minChars) {
@@ -787,30 +787,32 @@
whitespace = str.match(/\s+$/);
if (whitespace) endStr = whitespace[0] + endStr;
this.element.value = startStr + value + endStr;
+
+ if (this.options.useSuggestObjects)
+ {
+ var index = 0;
+ if (this.options.tokens.length!=0)
+ {
+ // search index for update item's object
+ var tokens = this.options.tokens.join('');
+ var p = 0;
+ while (p<this.startPosition)
+ {
+ if (tokens.indexOf(this.element.value[p])!=-1) index++;
+ p++;
+ }
+ }
- var index = 0;
- if (this.options.tokens.length!=0)
- {
- // search index for update item's object
- var tokens = this.options.tokens.join('');
- var p = 0;
- while (p<this.startPosition)
+ var itm = {text:value, object:this.fetchValues[this.index]}
+ var flag = (this.selectedItems[index].text != value || this.selectedItems[index].object==null ? true : false);
+ this.selectedItemsCache[value] = itm;
+ this.selectedItems[index] = itm;
+ if (flag)
{
- if (tokens.indexOf(this.element.value[p])!=-1) index++;
- p++;
+ //call user listner
+ this.callOnObjectChangeListener(event);
}
- }
-
- // if object null we don't need to request data for it in future
- var itm = {text:value, object:this.fetchValues[this.index]}
- var flag = (this.selectedItems[index].text != value || this.selectedItems[index].object==null ? true : false);
- this.selectedItemsCache[value] = itm;
- this.selectedItems[index] = itm;
- if (flag)
- {
- //call user listner
- this.callOnObjectChangeListener(event);
- }
+ }
},
getToken: function() {
@@ -852,7 +854,7 @@
getUpdatedChoices: function(event) {
this.options.parameters[this.options.param] = this.getToken();
- this.options.parameters[this.options.param + "request"] = this.getItemListForUpdate();
+ if (this.options.useSuggestObjects) this.options.parameters[this.options.param + "request"] = this.getItemListForUpdate();
if (this.onsubmitFunction && ! this.onsubmitFunction()) {
return;
}
@@ -869,7 +871,7 @@
RichFaces.Position.smartClone(this.element, this.update, this.options);
}
this.updateChoices();
- if (data) {
+ if (this.options.useSuggestObjects && data) {
this.fetchValues = data.suggestionObjects;
this.updateSelectedItems(data.requestedObjects);
if (this.isSelectedItemsUpdated)
16 years, 10 months
JBoss Rich Faces SVN: r7021 - trunk/samples/richfaces-demo/src/main/webapp/richfaces/contextMenu.
by richfaces-svn-commits@lists.jboss.org
Author: dsvyatobatsko
Date: 2008-03-20 13:06:42 -0400 (Thu, 20 Mar 2008)
New Revision: 7021
Modified:
trunk/samples/richfaces-demo/src/main/webapp/richfaces/contextMenu/usage.xhtml
Log:
[RF-2620] Demo site: corrections of Context menu demo layout
Modified: trunk/samples/richfaces-demo/src/main/webapp/richfaces/contextMenu/usage.xhtml
===================================================================
--- trunk/samples/richfaces-demo/src/main/webapp/richfaces/contextMenu/usage.xhtml 2008-03-20 17:00:41 UTC (rev 7020)
+++ trunk/samples/richfaces-demo/src/main/webapp/richfaces/contextMenu/usage.xhtml 2008-03-20 17:06:42 UTC (rev 7021)
@@ -14,15 +14,18 @@
<p>Context Menu can contain a set of Menu Items, Menu Groups and Menu Separators.
Usage of these components are similar to usage in RichFaces Drop Down Menu.
</p>
- <p><b>Example:</b>To call the menu - perform the right click on the picture</p>
- <div class="sample-container">
-
- <ui:include src="/richfaces/contextMenu/example/menu.xhtml"/>
- <ui:include src="/templates/include/sourceview.xhtml">
- <ui:param name="sourcepath" value="/richfaces/contextMenu/example/menu.xhtml"/>
- </ui:include>
-
- </div>
+ <fieldset class="demo_fieldset">
+ <legend class="demo_legend">Example</legend>
+
+ <div class="sample-container">
+ To call the menu - perform the right click on the picture<br/><br/>
+ <ui:include src="/richfaces/contextMenu/example/menu.xhtml"/>
+ <ui:include src="/templates/include/sourceview.xhtml">
+ <ui:param name="sourcepath" value="/richfaces/contextMenu/example/menu.xhtml"/>
+ </ui:include>
+
+ </div>
+ </fieldset>
<p>
In this example menu is just defined as nested to <b>panelGroup</b> with "picture" Id.
You should be careful with such definitions, because on the client menu component
@@ -68,14 +71,17 @@
<b>ComponentControl</b> component could be used to call the instance of the menu for
the particular component. <b>f:param</b> components could be used to add parameters to menu.
</p>
+ <fieldset class="demo_fieldset">
+ <legend class="demo_legend">Example</legend>
+ <div class="sample-container">
+ To call the menu - click any car row.<br/><br/>
+ <ui:include src="/richfaces/componentControl/examples/cmenuusage.xhtml" />
+ <ui:include src="/templates/include/sourceview.xhtml">
+ <ui:param name="sourcepath" value="/richfaces/componentControl/examples/cmenuusage.xhtml"/>
+ </ui:include>
+ </div>
+ </fieldset>
<p>
- <b>Example:</b> To call the menu - click any car row.
- </p>
- <ui:include src="/richfaces/componentControl/examples/cmenuusage.xhtml" />
- <ui:include src="/templates/include/sourceview.xhtml">
- <ui:param name="sourcepath" value="/richfaces/componentControl/examples/cmenuusage.xhtml"/>
- </ui:include>
- <p>
Pay your attention to the source code. Inside the table you may see component control that calls the menu.
Menu recreated after every call on the client and new <b>{car}</b> and <b>{model}</b> values are inserted into the menu.
</p>
16 years, 10 months
JBoss Rich Faces SVN: r7020 - in trunk/framework/impl/src/main/java/org: ajax4jsf/webapp and 1 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: maksimkaszynski
Date: 2008-03-20 13:00:41 -0400 (Thu, 20 Mar 2008)
New Revision: 7020
Added:
trunk/framework/impl/src/main/java/org/ajax4jsf/webapp/ParserFacade.java
Modified:
trunk/framework/impl/src/main/java/org/ajax4jsf/renderkit/RendererUtils.java
trunk/framework/impl/src/main/java/org/ajax4jsf/webapp/BaseXMLFilter.java
trunk/framework/impl/src/main/java/org/richfaces/renderkit/TemplateEncoderRendererBase.java
Log:
used parser from config
Modified: trunk/framework/impl/src/main/java/org/ajax4jsf/renderkit/RendererUtils.java
===================================================================
--- trunk/framework/impl/src/main/java/org/ajax4jsf/renderkit/RendererUtils.java 2008-03-20 16:44:40 UTC (rev 7019)
+++ trunk/framework/impl/src/main/java/org/ajax4jsf/renderkit/RendererUtils.java 2008-03-20 17:00:41 UTC (rev 7020)
@@ -262,6 +262,7 @@
public static final String valign_ATTRIBUTE = "valign";
public static final String a_ELEMENT = "a";
public static final String HTML_ELEMENT = "html";
+ public static final String HEAD_ELEMENT = "head";
public static final String BODY_ELEMENT = "body";
public static final String TR_ELEMENT = "tr";
public static final String CAPTION_ELEMENT = "caption";
Modified: trunk/framework/impl/src/main/java/org/ajax4jsf/webapp/BaseXMLFilter.java
===================================================================
--- trunk/framework/impl/src/main/java/org/ajax4jsf/webapp/BaseXMLFilter.java 2008-03-20 16:44:40 UTC (rev 7019)
+++ trunk/framework/impl/src/main/java/org/ajax4jsf/webapp/BaseXMLFilter.java 2008-03-20 17:00:41 UTC (rev 7020)
@@ -32,7 +32,6 @@
import javax.faces.context.FacesContext;
import javax.servlet.FilterChain;
import javax.servlet.FilterConfig;
-import javax.servlet.ServletContext;
import javax.servlet.ServletException;
import javax.servlet.ServletOutputStream;
import javax.servlet.ServletRequest;
@@ -79,6 +78,8 @@
public static final String TEXT_HTML = "text/html";
public static final String APPLICATION_XHTML_XML = "application/xhtml+xml";
+
+ private static BaseXMLFilter INSTANCE;
public BaseFilter filter;
@@ -86,11 +87,10 @@
this.filter = filter;
}
+ static BaseXMLFilter getInstance(FacesContext context) {
+ return INSTANCE;//(BaseXMLFilter) context.getExternalContext().getApplicationMap().get(APPLICATION_SCOPE_KEY);
+ }
- /*public static final BaseXMLFilter getInstance(FacesContext context) {
- return (BaseXMLFilter) context.getExternalContext().getApplicationMap().get(APPLICATION_SCOPE_KEY);
- }*/
-
public void init(FilterConfig config) throws ServletException {
if (log.isDebugEnabled()) {
@@ -113,7 +113,7 @@
getNamespace()));
- config.getServletContext().setAttribute(APPLICATION_SCOPE_KEY, this);
+ INSTANCE = this;
}
@@ -189,10 +189,10 @@
response.addCookie(cookie);
}
// Copy response headers
- Map headers = servletResponseWrapper.getHeaders();
- for (Iterator iter = headers.entrySet().iterator(); iter
+ Map<String, Object> headers = servletResponseWrapper.getHeaders();
+ for (Iterator<Map.Entry<String, Object>> iter = headers.entrySet().iterator(); iter
.hasNext();) {
- Map.Entry header = (Map.Entry) iter.next();
+ Map.Entry<String, Object> header = iter.next();
response.setHeader((String) header.getKey(),
(String) header.getValue());
}
Added: trunk/framework/impl/src/main/java/org/ajax4jsf/webapp/ParserFacade.java
===================================================================
--- trunk/framework/impl/src/main/java/org/ajax4jsf/webapp/ParserFacade.java (rev 0)
+++ trunk/framework/impl/src/main/java/org/ajax4jsf/webapp/ParserFacade.java 2008-03-20 17:00:41 UTC (rev 7020)
@@ -0,0 +1,40 @@
+/**
+ *
+ */
+package org.ajax4jsf.webapp;
+
+import java.io.IOException;
+import java.io.Reader;
+import java.io.Writer;
+
+import javax.faces.component.UIViewRoot;
+import javax.faces.context.FacesContext;
+
+/**
+ * @author Maksim Kaszynski
+ *
+ */
+public class ParserFacade {
+
+ private BaseXMLFilter filter;
+
+ private FacesContext context;
+
+ public static ParserFacade newInstance(FacesContext context) {
+ return new ParserFacade(context);
+ }
+
+ private ParserFacade(FacesContext context) {
+ super();
+ this.context = context;
+ this.filter = BaseXMLFilter.getInstance(context);
+ }
+
+ public void parseHtml(Reader input, Writer output) throws IOException {
+ UIViewRoot viewRoot = context.getViewRoot();
+ HtmlParser parser = filter.getParser(filter.getMimetype(), true, viewRoot.getViewId());
+ parser.parseHtml(input, output);
+ filter.reuseParser(parser);
+ }
+
+}
Modified: trunk/framework/impl/src/main/java/org/richfaces/renderkit/TemplateEncoderRendererBase.java
===================================================================
--- trunk/framework/impl/src/main/java/org/richfaces/renderkit/TemplateEncoderRendererBase.java 2008-03-20 16:44:40 UTC (rev 7019)
+++ trunk/framework/impl/src/main/java/org/richfaces/renderkit/TemplateEncoderRendererBase.java 2008-03-20 17:00:41 UTC (rev 7020)
@@ -16,6 +16,9 @@
import javax.faces.component.UIComponent;
import javax.faces.context.FacesContext;
import javax.faces.context.ResponseWriter;
+import javax.xml.parsers.DocumentBuilder;
+import javax.xml.parsers.DocumentBuilderFactory;
+import javax.xml.parsers.ParserConfigurationException;
import javax.xml.transform.OutputKeys;
import javax.xml.transform.Result;
import javax.xml.transform.Transformer;
@@ -28,6 +31,7 @@
import org.ajax4jsf.javascript.ScriptUtils;
import org.ajax4jsf.renderkit.HeaderResourcesRendererBase;
import org.ajax4jsf.resource.util.URLToStreamHelper;
+import org.ajax4jsf.webapp.ParserFacade;
import org.ajax4jsf.webapp.tidy.TidyParser;
import org.ajax4jsf.webapp.tidy.TidyXMLFilter;
import org.richfaces.component.TemplateComponent;
@@ -36,6 +40,8 @@
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;
import org.xml.sax.ContentHandler;
+import org.xml.sax.InputSource;
+import org.xml.sax.SAXException;
/**
* @author Nick Belaevski - mailto:nbelaevski@exadel.com
@@ -60,25 +66,18 @@
}
public void writeScriptBody(Writer writer, String string) throws IOException {
- Properties tidyProperties = new Properties();
- InputStream propertiesStream = null;
- try {
- propertiesStream = URLToStreamHelper.urlToStreamSafe(
- TidyXMLFilter.class.getResource("tidy.properties"));
- tidyProperties.load(propertiesStream);
- } finally {
- if (propertiesStream != null) {
- propertiesStream.close();
- }
- }
+ ParserFacade parserFacade = ParserFacade.newInstance(FacesContext.getCurrentInstance());
+ StringReader stringReader = new StringReader(string);
+ StringWriter stringWriter = new StringWriter();
+ parserFacade.parseHtml(stringReader, stringWriter);
- TidyParser tidyParser = new TidyParser(tidyProperties);
- Document parsedHtml = tidyParser.parseHtmlByTidy(new StringReader(string), null);
+
+ Document document = parse(stringWriter.toString());
Element documentElement = null;
- if (parsedHtml != null) {
- documentElement = parsedHtml.getDocumentElement();
+ if (document != null) {
+ documentElement = document.getDocumentElement();
}
if (documentElement != null) {
@@ -121,6 +120,19 @@
}
}
+ private Document parse(String xml) throws IOException {
+ try {
+ DocumentBuilderFactory builderFactory = DocumentBuilderFactory.newInstance();
+ DocumentBuilder documentBuilder = builderFactory.newDocumentBuilder();
+ Document document = documentBuilder.parse(new InputSource(new StringReader(xml)));
+ return document;
+ } catch (ParserConfigurationException e) {
+ throw new IOException(e.getMessage());
+ } catch (SAXException e) {
+ throw new IOException(e.getMessage());
+ }
+ }
+
protected void writeScriptBody(FacesContext context, UIComponent component, boolean children)
throws IOException {
ResponseWriter writer = context.getResponseWriter();
16 years, 10 months
JBoss Rich Faces SVN: r7019 - trunk/framework/impl/src/main/resources/META-INF/services.
by richfaces-svn-commits@lists.jboss.org
Author: vbaranov
Date: 2008-03-20 12:44:40 -0400 (Thu, 20 Mar 2008)
New Revision: 7019
Removed:
trunk/framework/impl/src/main/resources/META-INF/services/org.richfaces.skin.SkinFactory
Log:
http://jira.jboss.com/jira/browse/RF-995
Deleted: trunk/framework/impl/src/main/resources/META-INF/services/org.richfaces.skin.SkinFactory
===================================================================
--- trunk/framework/impl/src/main/resources/META-INF/services/org.richfaces.skin.SkinFactory 2008-03-20 16:44:35 UTC (rev 7018)
+++ trunk/framework/impl/src/main/resources/META-INF/services/org.richfaces.skin.SkinFactory 2008-03-20 16:44:40 UTC (rev 7019)
@@ -1 +0,0 @@
-org.richfaces.skin.SkinFactoryImpl
16 years, 10 months