JBoss Rich Faces SVN: r20587 - in modules/tests/metamer/trunk/application/src/main: webapp/components/richTree and 1 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: lfryc(a)redhat.com
Date: 2010-12-15 12:11:08 -0500 (Wed, 15 Dec 2010)
New Revision: 20587
Added:
modules/tests/metamer/trunk/application/src/main/webapp/resources/images/loading.gif
Modified:
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichTreeBean.java
modules/tests/metamer/trunk/application/src/main/webapp/components/richTree/simple.xhtml
modules/tests/metamer/trunk/application/src/main/webapp/components/richTree/treeAdaptors.xhtml
Log:
rich:tree - added loading facet testing (RF-9827, RF-9838)
Modified: modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichTreeBean.java
===================================================================
--- modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichTreeBean.java 2010-12-15 17:10:12 UTC (rev 20586)
+++ modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichTreeBean.java 2010-12-15 17:11:08 UTC (rev 20587)
@@ -32,6 +32,7 @@
import javax.faces.bean.ManagedBean;
import javax.faces.bean.ManagedProperty;
import javax.faces.bean.ViewScoped;
+import javax.faces.event.ComponentSystemEvent;
import javax.swing.tree.TreeNode;
import org.richfaces.component.UITree;
@@ -63,6 +64,9 @@
private Map<String, Country> countriesCache = new HashMap<String, Country>();
private Map<String, Company> companiesCache = new HashMap<String, Company>();
+ private boolean testLoadingFacet = false;
+ private boolean delayedRender = false;
+
/**
* Initializes the managed bean.
*/
@@ -75,7 +79,7 @@
attributes.get("rendered").setValue(true);
attributes.get("toggleType").setValue("ajax");
attributes.get("selectionType").setValue("ajax");
-
+
// FIXME attributes not in taglib
attributes.setAttribute("iconLeaf", null);
attributes.setAttribute("iconExpanded", null);
@@ -143,6 +147,7 @@
}
public List<TreeNode> getRoot() {
+
return root;
}
@@ -153,4 +158,30 @@
public void setSelection(Collection<Object> selection) {
this.selection = selection;
}
+
+ public boolean isTestLoadingFacet() {
+ return testLoadingFacet;
+ }
+
+ public void setTestLoadingFacet(boolean testLoadingFacet) {
+ this.testLoadingFacet = testLoadingFacet;
+ }
+
+ public boolean isDelayedRender() {
+ return delayedRender;
+ }
+
+ public void setDelayedRender(boolean delayedRender) {
+ this.delayedRender = delayedRender;
+ }
+
+ public void preRenderView(ComponentSystemEvent event) {
+ if (delayedRender) {
+ try {
+ Thread.sleep(1000);
+ } catch (Exception e) {
+ throw new IllegalStateException();
+ }
+ }
+ }
}
Modified: modules/tests/metamer/trunk/application/src/main/webapp/components/richTree/simple.xhtml
===================================================================
--- modules/tests/metamer/trunk/application/src/main/webapp/components/richTree/simple.xhtml 2010-12-15 17:10:12 UTC (rev 20586)
+++ modules/tests/metamer/trunk/application/src/main/webapp/components/richTree/simple.xhtml 2010-12-15 17:11:08 UTC (rev 20587)
@@ -27,12 +27,14 @@
-->
<ui:composition template="/templates/template.xhtml">
+ <ui:param name="componentId" value="richTree" />
<ui:define name="head">
<f:metadata>
<f:viewParam name="templates" value="#{templateBean.templates}">
<f:converter converterId="templatesListConverter" />
</f:viewParam>
+ <f:event type="preRenderView" listener="#{richTreeBean.preRenderView}" />
</f:metadata>
</ui:define>
@@ -85,6 +87,7 @@
nodeClass="#{richTreeBean.attributes['nodeClass'].value}"
selectionChangeListener="#{richTreeListenerBean.processSelectionChange}"
toggleListener="#{richTreeListenerBean.processToggle}"
+ render="@this treeInfo"
>
<rich:treeNode type="country"
@@ -97,6 +100,9 @@
labelClass="#{richTreeNodeBean.attributes[0]['labelClass'].value}"
styleClass="#{richTreeNodeBean.attributes[0]['styleClass'].value}"
>
+ <f:facet name="loading">
+ <h:graphicImage value="/resources/images/loading.gif" rendered="#{richTreeBean.testLoadingFacet}" />
+ </f:facet>
#{node.name}
</rich:treeNode>
@@ -111,6 +117,10 @@
labelClass="#{richTreeNodeBean.attributes[1]['labelClass'].value}"
styleClass="#{richTreeNodeBean.attributes[1]['styleClass'].value}"
>
+ <f:facet name="loading">
+ <h:graphicImage value="/resources/images/loading.gif" rendered="#{richTreeBean.testLoadingFacet}" />
+ </f:facet>
+
#{node.name}
</rich:treeNode>
@@ -181,8 +191,20 @@
</ui:define>
<ui:define name="outOfTemplateAfter">
- <a4j:outputPanel ajaxRendered="true">
- <h:panelGrid id="selectionOutput" columns="2">
+
+
+ <a4j:outputPanel id="treeInfo">
+ <h:panelGrid columns="2">
+ <h:outputLabel value="Test Loading Facet:" />
+ <h:selectBooleanCheckbox value="#{richTreeBean.testLoadingFacet}">
+ <a4j:ajax render="#{nestedComponentId}" />
+ </h:selectBooleanCheckbox>
+
+ <h:outputLabel value="Delayed Render (1sec):" />
+ <h:selectBooleanCheckbox value="#{richTreeBean.delayedRender}">
+ <a4j:ajax />
+ </h:selectBooleanCheckbox>
+
<h:outputLabel value="Selection:" />
<h:outputText value="#{richTreeBean.selection}" />
Modified: modules/tests/metamer/trunk/application/src/main/webapp/components/richTree/treeAdaptors.xhtml
===================================================================
--- modules/tests/metamer/trunk/application/src/main/webapp/components/richTree/treeAdaptors.xhtml 2010-12-15 17:10:12 UTC (rev 20586)
+++ modules/tests/metamer/trunk/application/src/main/webapp/components/richTree/treeAdaptors.xhtml 2010-12-15 17:11:08 UTC (rev 20587)
@@ -33,6 +33,7 @@
<f:viewParam name="templates" value="#{templateBean.templates}">
<f:converter converterId="templatesListConverter" />
</f:viewParam>
+ <f:event type="preRenderView" listener="#{richTreeBean.preRenderView}" />
</f:metadata>
</ui:define>
@@ -97,7 +98,9 @@
iconClass="#{richTreeNodeBean.attributes[0]['iconClass'].value}"
labelClass="#{richTreeNodeBean.attributes[0]['labelClass'].value}"
styleClass="#{richTreeNodeBean.attributes[0]['styleClass'].value}">
-
+ <f:facet name="loading">
+ <h:graphicImage value="/resources/images/loading.gif" rendered="#{richTreeBean.testLoadingFacet}" />
+ </f:facet>
<a4j:outputPanel id="panel">
#{node.label}
</a4j:outputPanel>
@@ -134,6 +137,9 @@
labelClass="#{richTreeNodeBean.attributes[1]['labelClass'].value}"
styleClass="#{richTreeNodeBean.attributes[1]['styleClass'].value}"
>
+ <f:facet name="loading">
+ <h:graphicImage value="/resources/images/loading.gif" rendered="#{richTreeBean.testLoadingFacet}" />
+ </f:facet>
#{node.label}
</rich:treeNode>
</rich:treeModelRecursiveAdaptor>
@@ -146,6 +152,15 @@
<a4j:outputPanel ajaxRendered="true">
<h:panelGrid id="selectionOutput" columns="2">
+ <h:outputLabel value="Test Loading Facet:" />
+ <h:selectBooleanCheckbox value="#{richTreeBean.testLoadingFacet}">
+ <a4j:ajax render="#{nestedComponentId}" />
+ </h:selectBooleanCheckbox>
+
+ <h:outputLabel value="Delayed Render (1sec):" />
+ <h:selectBooleanCheckbox value="#{richTreeBean.delayedRender}">
+ <a4j:ajax />
+ </h:selectBooleanCheckbox>
<h:outputLabel value="Recursive Leaf Children Nullable:" />
<h:selectBooleanCheckbox value="#{richTreeModelRecursiveAdaptorBean.leafChildrenNullable}">
Added: modules/tests/metamer/trunk/application/src/main/webapp/resources/images/loading.gif
===================================================================
--- modules/tests/metamer/trunk/application/src/main/webapp/resources/images/loading.gif (rev 0)
+++ modules/tests/metamer/trunk/application/src/main/webapp/resources/images/loading.gif 2010-12-15 17:11:08 UTC (rev 20587)
@@ -0,0 +1,48 @@
+GIF89a
+
+�N1l�@3�0����D���PP����f8 � ��e�
+
+$�|n
+��%n B
+
+(&�i
+$~$'�M
+&&I )&Ot
+
+ �wpxV���(-(�G�[xƂ�Qv_x
+�����C�
+Q
+
+
+LL�"&
+��)&$( H'�"&
+
+
+
+[[�$
+g]�
+�B
+�C
+
+\�\B�
+
+ �!$$
+��&(
+HC�
+
+�
+v'
+
+��I
+
+
+vB%
+�� X
+
+&�"��
+I�
+
\ No newline at end of file
14 years
JBoss Rich Faces SVN: r20586 - in modules/tests/metamer/trunk/application/src/main: webapp/components/richTree and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: lfryc(a)redhat.com
Date: 2010-12-15 12:10:12 -0500 (Wed, 15 Dec 2010)
New Revision: 20586
Modified:
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/model/tree/CompactDisc.java
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/model/tree/Company.java
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/model/tree/Country.java
modules/tests/metamer/trunk/application/src/main/webapp/components/richTree/simple.xhtml
Log:
rich:tree - extended by default tree node sample (RF-9716, RF-9827)
Modified: modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/model/tree/CompactDisc.java
===================================================================
--- modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/model/tree/CompactDisc.java 2010-12-15 17:09:25 UTC (rev 20585)
+++ modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/model/tree/CompactDisc.java 2010-12-15 17:10:12 UTC (rev 20586)
@@ -97,4 +97,9 @@
public void setYear(int year) {
this.year = year;
}
+
+ @Override
+ public String toString() {
+ return "CompactDisc [artist=" + artist + ", title=" + title + "]";
+ }
}
Modified: modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/model/tree/Company.java
===================================================================
--- modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/model/tree/Company.java 2010-12-15 17:09:25 UTC (rev 20585)
+++ modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/model/tree/Company.java 2010-12-15 17:10:12 UTC (rev 20586)
@@ -74,4 +74,8 @@
return compactDiscs;
}
+ @Override
+ public String toString() {
+ return "Company [name=" + name + "]";
+ }
}
Modified: modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/model/tree/Country.java
===================================================================
--- modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/model/tree/Country.java 2010-12-15 17:09:25 UTC (rev 20585)
+++ modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/model/tree/Country.java 2010-12-15 17:10:12 UTC (rev 20586)
@@ -60,4 +60,8 @@
return companies;
}
+ @Override
+ public String toString() {
+ return "Country [name=" + name + "]";
+ }
}
Modified: modules/tests/metamer/trunk/application/src/main/webapp/components/richTree/simple.xhtml
===================================================================
--- modules/tests/metamer/trunk/application/src/main/webapp/components/richTree/simple.xhtml 2010-12-15 17:09:25 UTC (rev 20585)
+++ modules/tests/metamer/trunk/application/src/main/webapp/components/richTree/simple.xhtml 2010-12-15 17:10:12 UTC (rev 20586)
@@ -42,89 +42,142 @@
<ui:define name="component">
- <rich:tree id="richTree"
- nodeType="#{node.type}"
- var="node"
- value="#{richTreeBean.root}"
+ <h3><b>rich:tree</b></h3>
+
+ <p>
+ <rich:tree id="richTree"
+ nodeType="#{node.type}"
+ var="node"
+ value="#{richTreeBean.root}"
+
+ dir="#{richTreeBean.attributes['dir'].value}"
+ lang="#{richTreeBean.attributes['lang'].value}"
+ onbeforedomupdate="#{richTreeBean.attributes['onbeforedomupdate'].value}"
+ onbeforenodetoggle="#{richTreeBean.attributes['onbeforenodetoggle'].value}"
+ onbeforeselectionchange="#{richTreeBean.attributes['onbeforeselectionchange'].value}"
+ onbegin="#{richTreeBean.attributes['onbegin'].value}"
+ onclick="#{richTreeBean.attributes['onclick'].value}"
+ oncomplete="#{richTreeBean.attributes['oncomplete'].value}"
+ ondblclick="#{richTreeBean.attributes['ondblclick'].value}"
+ onkeydown="#{richTreeBean.attributes['onkeydown'].value}"
+ onkeypress="#{richTreeBean.attributes['onkeypress'].value}"
+ onkeyup="#{richTreeBean.attributes['onkeyup'].value}"
+ onmousedown="#{richTreeBean.attributes['onmousedown'].value}"
+ onmousemove="#{richTreeBean.attributes['onmousemove'].value}"
+ onmouseup="#{richTreeBean.attributes['onmouseup'].value}"
+ onmouseout="#{richTreeBean.attributes['onmouseout'].value}"
+ onmouseover="#{richTreeBean.attributes['onmouseover'].value}"
+ onnodetoggle="#{richTreeBean.attributes['onnodetoggle'].value}"
+ onselectionchange="#{richTreeBean.attributes['onselectionchange'].value}"
+ rendered="#{richTreeBean.attributes['rendered'].value}"
+ selection="#{richTreeBean.selection}"
+ selectionType="#{richTreeBean.attributes['selectionType'].value}"
+ style="#{richTreeBean.attributes['style'].value}"
+ styleClass="#{richTreeBean.attributes['styleClass'].value}"
+ title="#{richTreeBean.attributes['title'].value}"
+ toggleType="#{richTreeBean.attributes['toggleType'].value}"
+ iconLeaf="#{richTreeBean.attributes['iconLeaf'].value}"
+ iconExpanded="#{richTreeBean.attributes['iconExpanded'].value}"
+ iconCollapsed="#{richTreeBean.attributes['iconCollapsed'].value}"
+ handleClass="#{richTreeBean.attributes['handleClass'].value}"
+ iconClass="#{richTreeBean.attributes['iconClass'].value}"
+ labelClass="#{richTreeBean.attributes['labelClass'].value}"
+ nodeClass="#{richTreeBean.attributes['nodeClass'].value}"
+ selectionChangeListener="#{richTreeListenerBean.processSelectionChange}"
+ toggleListener="#{richTreeListenerBean.processToggle}"
+ >
+
+ <rich:treeNode type="country"
+ rendered="#{richTreeNodeBean.attributes[0]['rendered'].value}"
+ iconLeaf="#{richTreeNodeBean.attributes[0]['iconLeaf'].value}"
+ iconExpanded="#{richTreeNodeBean.attributes[0]['iconExpanded'].value}"
+ iconCollapsed="#{richTreeNodeBean.attributes[0]['iconCollapsed'].value}"
+ handleClass="#{richTreeNodeBean.attributes[0]['handleClass'].value}"
+ iconClass="#{richTreeNodeBean.attributes[0]['iconClass'].value}"
+ labelClass="#{richTreeNodeBean.attributes[0]['labelClass'].value}"
+ styleClass="#{richTreeNodeBean.attributes[0]['styleClass'].value}"
+ >
+ #{node.name}
+ </rich:treeNode>
+
+ <rich:treeNode type="company"
+ icon="/images/tree/disc.gif"
+ rendered="#{richTreeNodeBean.attributes[1]['rendered'].value}"
+ iconLeaf="#{richTreeNodeBean.attributes[1]['iconLeaf'].value}"
+ iconExpanded="#{richTreeNodeBean.attributes[1]['iconExpanded'].value}"
+ iconCollapsed="#{richTreeNodeBean.attributes[1]['iconCollapsed'].value}"
+ handleClass="#{richTreeNodeBean.attributes[1]['handleClass'].value}"
+ iconClass="#{richTreeNodeBean.attributes[1]['iconClass'].value}"
+ labelClass="#{richTreeNodeBean.attributes[1]['labelClass'].value}"
+ styleClass="#{richTreeNodeBean.attributes[1]['styleClass'].value}"
+ >
+ #{node.name}
+ </rich:treeNode>
+
+ <rich:treeNode type="cd"
+ icon="/images/tree/song.gif"
+ rendered="#{richTreeNodeBean.attributes[2]['rendered'].value}"
+ iconLeaf="#{richTreeNodeBean.attributes[2]['iconLeaf'].value}"
+ iconExpanded="#{richTreeNodeBean.attributes[2]['iconExpanded'].value}"
+ iconCollapsed="#{richTreeNodeBean.attributes[2]['iconCollapsed'].value}"
+ handleClass="#{richTreeNodeBean.attributes[2]['handleClass'].value}"
+ iconClass="#{richTreeNodeBean.attributes[2]['iconClass'].value}"
+ labelClass="#{richTreeNodeBean.attributes[2]['labelClass'].value}"
+ styleClass="#{richTreeNodeBean.attributes[2]['styleClass'].value}"
+ >
+ #{node.artist} - #{node.title}
+ </rich:treeNode>
+ </rich:tree>
+ </p>
+
+ <h3><b>rich:tree</b> - with default tree nodes</h3>
+ <div>(uses toString on TreeNode as content)</div>
+
+ <p>
- dir="#{richTreeBean.attributes['dir'].value}"
- lang="#{richTreeBean.attributes['lang'].value}"
- onbeforedomupdate="#{richTreeBean.attributes['onbeforedomupdate'].value}"
- onbeforenodetoggle="#{richTreeBean.attributes['onbeforenodetoggle'].value}"
- onbeforeselectionchange="#{richTreeBean.attributes['onbeforeselectionchange'].value}"
- onbegin="#{richTreeBean.attributes['onbegin'].value}"
- onclick="#{richTreeBean.attributes['onclick'].value}"
- oncomplete="#{richTreeBean.attributes['oncomplete'].value}"
- ondblclick="#{richTreeBean.attributes['ondblclick'].value}"
- onkeydown="#{richTreeBean.attributes['onkeydown'].value}"
- onkeypress="#{richTreeBean.attributes['onkeypress'].value}"
- onkeyup="#{richTreeBean.attributes['onkeyup'].value}"
- onmousedown="#{richTreeBean.attributes['onmousedown'].value}"
- onmousemove="#{richTreeBean.attributes['onmousemove'].value}"
- onmouseup="#{richTreeBean.attributes['onmouseup'].value}"
- onmouseout="#{richTreeBean.attributes['onmouseout'].value}"
- onmouseover="#{richTreeBean.attributes['onmouseover'].value}"
- onnodetoggle="#{richTreeBean.attributes['onnodetoggle'].value}"
- onselectionchange="#{richTreeBean.attributes['onselectionchange'].value}"
- rendered="#{richTreeBean.attributes['rendered'].value}"
- selection="#{richTreeBean.selection}"
- selectionType="#{richTreeBean.attributes['selectionType'].value}"
- style="#{richTreeBean.attributes['style'].value}"
- styleClass="#{richTreeBean.attributes['styleClass'].value}"
- title="#{richTreeBean.attributes['title'].value}"
- toggleType="#{richTreeBean.attributes['toggleType'].value}"
- iconLeaf="#{richTreeBean.attributes['iconLeaf'].value}"
- iconExpanded="#{richTreeBean.attributes['iconExpanded'].value}"
- iconCollapsed="#{richTreeBean.attributes['iconCollapsed'].value}"
- handleClass="#{richTreeBean.attributes['handleClass'].value}"
- iconClass="#{richTreeBean.attributes['iconClass'].value}"
- labelClass="#{richTreeBean.attributes['labelClass'].value}"
- nodeClass="#{richTreeBean.attributes['nodeClass'].value}"
- selectionChangeListener="#{richTreeListenerBean.processSelectionChange}"
- toggleListener="#{richTreeListenerBean.processToggle}"
- >
- <rich:treeNode type="country"
- rendered="#{richTreeNodeBean.attributes[0]['rendered'].value}"
- iconLeaf="#{richTreeNodeBean.attributes[0]['iconLeaf'].value}"
- iconExpanded="#{richTreeNodeBean.attributes[0]['iconExpanded'].value}"
- iconCollapsed="#{richTreeNodeBean.attributes[0]['iconCollapsed'].value}"
- handleClass="#{richTreeNodeBean.attributes[0]['handleClass'].value}"
- iconClass="#{richTreeNodeBean.attributes[0]['iconClass'].value}"
- labelClass="#{richTreeNodeBean.attributes[0]['labelClass'].value}"
- styleClass="#{richTreeNodeBean.attributes[0]['styleClass'].value}"
- >
- #{node.name}
- </rich:treeNode>
-
- <rich:treeNode type="company"
- icon="/images/tree/disc.gif"
- rendered="#{richTreeNodeBean.attributes[1]['rendered'].value}"
- iconLeaf="#{richTreeNodeBean.attributes[1]['iconLeaf'].value}"
- iconExpanded="#{richTreeNodeBean.attributes[1]['iconExpanded'].value}"
- iconCollapsed="#{richTreeNodeBean.attributes[1]['iconCollapsed'].value}"
- handleClass="#{richTreeNodeBean.attributes[1]['handleClass'].value}"
- iconClass="#{richTreeNodeBean.attributes[1]['iconClass'].value}"
- labelClass="#{richTreeNodeBean.attributes[1]['labelClass'].value}"
- styleClass="#{richTreeNodeBean.attributes[1]['styleClass'].value}"
- >
- #{node.name}
- </rich:treeNode>
-
- <rich:treeNode type="cd"
- icon="/images/tree/song.gif"
- rendered="#{richTreeNodeBean.attributes[2]['rendered'].value}"
- iconLeaf="#{richTreeNodeBean.attributes[2]['iconLeaf'].value}"
- iconExpanded="#{richTreeNodeBean.attributes[2]['iconExpanded'].value}"
- iconCollapsed="#{richTreeNodeBean.attributes[2]['iconCollapsed'].value}"
- handleClass="#{richTreeNodeBean.attributes[2]['handleClass'].value}"
- iconClass="#{richTreeNodeBean.attributes[2]['iconClass'].value}"
- labelClass="#{richTreeNodeBean.attributes[2]['labelClass'].value}"
- styleClass="#{richTreeNodeBean.attributes[2]['styleClass'].value}"
- >
- #{node.artist} - #{node.title}
- </rich:treeNode>
- </rich:tree>
+ <rich:tree id="richTreeDefaultNodes"
+ var="node"
+ value="#{richTreeBean.root}"
+
+ dir="#{richTreeBean.attributes['dir'].value}"
+ lang="#{richTreeBean.attributes['lang'].value}"
+ onbeforedomupdate="#{richTreeBean.attributes['onbeforedomupdate'].value}"
+ onbeforenodetoggle="#{richTreeBean.attributes['onbeforenodetoggle'].value}"
+ onbeforeselectionchange="#{richTreeBean.attributes['onbeforeselectionchange'].value}"
+ onbegin="#{richTreeBean.attributes['onbegin'].value}"
+ onclick="#{richTreeBean.attributes['onclick'].value}"
+ oncomplete="#{richTreeBean.attributes['oncomplete'].value}"
+ ondblclick="#{richTreeBean.attributes['ondblclick'].value}"
+ onkeydown="#{richTreeBean.attributes['onkeydown'].value}"
+ onkeypress="#{richTreeBean.attributes['onkeypress'].value}"
+ onkeyup="#{richTreeBean.attributes['onkeyup'].value}"
+ onmousedown="#{richTreeBean.attributes['onmousedown'].value}"
+ onmousemove="#{richTreeBean.attributes['onmousemove'].value}"
+ onmouseup="#{richTreeBean.attributes['onmouseup'].value}"
+ onmouseout="#{richTreeBean.attributes['onmouseout'].value}"
+ onmouseover="#{richTreeBean.attributes['onmouseover'].value}"
+ onnodetoggle="#{richTreeBean.attributes['onnodetoggle'].value}"
+ onselectionchange="#{richTreeBean.attributes['onselectionchange'].value}"
+ rendered="#{richTreeBean.attributes['rendered'].value}"
+ selection="#{richTreeBean.selection}"
+ selectionType="#{richTreeBean.attributes['selectionType'].value}"
+ style="#{richTreeBean.attributes['style'].value}"
+ styleClass="#{richTreeBean.attributes['styleClass'].value}"
+ title="#{richTreeBean.attributes['title'].value}"
+ toggleType="#{richTreeBean.attributes['toggleType'].value}"
+ iconLeaf="#{richTreeBean.attributes['iconLeaf'].value}"
+ iconExpanded="#{richTreeBean.attributes['iconExpanded'].value}"
+ iconCollapsed="#{richTreeBean.attributes['iconCollapsed'].value}"
+ handleClass="#{richTreeBean.attributes['handleClass'].value}"
+ iconClass="#{richTreeBean.attributes['iconClass'].value}"
+ labelClass="#{richTreeBean.attributes['labelClass'].value}"
+ nodeClass="#{richTreeBean.attributes['nodeClass'].value}"
+ selectionChangeListener="#{richTreeListenerBean.processSelectionChange}"
+ toggleListener="#{richTreeListenerBean.processToggle}"
+ >
+ </rich:tree>
+ </p>
</ui:define>
<ui:define name="outOfTemplateAfter">
14 years
JBoss Rich Faces SVN: r20585 - in modules/tests/metamer/trunk/application/src/main: webapp/components/richTree and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: lfryc(a)redhat.com
Date: 2010-12-15 12:09:25 -0500 (Wed, 15 Dec 2010)
New Revision: 20585
Added:
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichTreeListenerBean.java
Modified:
modules/tests/metamer/trunk/application/src/main/webapp/components/richTree/simple.xhtml
modules/tests/metamer/trunk/application/src/main/webapp/components/richTree/treeAdaptors.xhtml
Log:
rich:tree - added server-side listeners (RF-9717) sample (RF-9827)
Added: modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichTreeListenerBean.java
===================================================================
--- modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichTreeListenerBean.java (rev 0)
+++ modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichTreeListenerBean.java 2010-12-15 17:09:25 UTC (rev 20585)
@@ -0,0 +1,58 @@
+/*******************************************************************************
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010, Red Hat, Inc. and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ *******************************************************************************/
+package org.richfaces.tests.metamer.bean;
+
+import javax.faces.bean.ManagedBean;
+import javax.faces.bean.RequestScoped;
+
+import org.richfaces.event.TreeSelectionChangeEvent;
+import org.richfaces.event.TreeToggleEvent;
+
+/**
+ * @author <a href="mailto:lfryc@redhat.com">Lukas Fryc</a>
+ * @version $Revision$
+ */
+@ManagedBean(name = "richTreeListenerBean")
+@RequestScoped
+public class RichTreeListenerBean {
+
+ private TreeSelectionChangeEvent treeSelectionChangeEvent;
+ private TreeToggleEvent treeToggleEvent;
+
+ public void processSelectionChange(TreeSelectionChangeEvent event) {
+ this.treeSelectionChangeEvent = event;
+ RichBean.logToPage("* selection change listener invoked");
+ }
+
+ public void processToggle(TreeToggleEvent event) {
+ this.treeToggleEvent = event;
+ RichBean.logToPage("* tree toggle listener invoked");
+ }
+
+ public TreeSelectionChangeEvent getTreeSelectionChangeEvent() {
+ return treeSelectionChangeEvent;
+ }
+
+ public TreeToggleEvent getTreeToggleEvent() {
+ return treeToggleEvent;
+ }
+}
Modified: modules/tests/metamer/trunk/application/src/main/webapp/components/richTree/simple.xhtml
===================================================================
--- modules/tests/metamer/trunk/application/src/main/webapp/components/richTree/simple.xhtml 2010-12-15 17:08:39 UTC (rev 20584)
+++ modules/tests/metamer/trunk/application/src/main/webapp/components/richTree/simple.xhtml 2010-12-15 17:09:25 UTC (rev 20585)
@@ -2,7 +2,7 @@
<!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:h="http://java.sun.com/jsf/html" xmlns:f="http://java.sun.com/jsf/core"
xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:metamer="http://java.sun.com/jsf/composite/metamer"
- xmlns:rich="http://richfaces.org/rich">
+ xmlns:rich="http://richfaces.org/rich" xmlns:a4j="http://richfaces.org/a4j">
<!--
JBoss, Home of Professional Open Source
@@ -80,6 +80,8 @@
iconClass="#{richTreeBean.attributes['iconClass'].value}"
labelClass="#{richTreeBean.attributes['labelClass'].value}"
nodeClass="#{richTreeBean.attributes['nodeClass'].value}"
+ selectionChangeListener="#{richTreeListenerBean.processSelectionChange}"
+ toggleListener="#{richTreeListenerBean.processToggle}"
>
<rich:treeNode type="country"
@@ -126,6 +128,37 @@
</ui:define>
<ui:define name="outOfTemplateAfter">
+ <a4j:outputPanel ajaxRendered="true">
+ <h:panelGrid id="selectionOutput" columns="2">
+ <h:outputLabel value="Selection:" />
+ <h:outputText value="#{richTreeBean.selection}" />
+
+ <h:outputLabel value="Selection Change Event:" rendered="#{not empty richTreeListenerBean.treeSelectionChangeEvent}" />
+ <h:panelGrid columns="2" rendered="#{not empty richTreeListenerBean.treeSelectionChangeEvent}">
+ <h:outputLabel value="Client ID:" />
+ <h:outputText value="#{richTreeListenerBean.treeSelectionChangeEvent.component.id}" />
+
+ <h:outputLabel value="New Selection:" />
+ <h:outputText value="#{richTreeListenerBean.treeSelectionChangeEvent.newSelection}" />
+
+ <h:outputLabel value="Old Selection:" />
+ <h:outputText value="#{richTreeListenerBean.treeSelectionChangeEvent.oldSelection}" />
+ </h:panelGrid>
+
+ <h:outputLabel value="Tree Toggle Event:" rendered="#{not empty richTreeListenerBean.treeToggleEvent}" />
+ <h:panelGrid columns="2" rendered="#{not empty richTreeListenerBean.treeToggleEvent}">
+ <h:outputLabel value="Client ID:" />
+ <h:outputText value="#{richTreeListenerBean.treeToggleEvent.component.id}" />
+
+ <h:outputLabel value="Collapsed:" />
+ <h:outputText value="#{richTreeListenerBean.treeToggleEvent.collapsed}" />
+
+ <h:outputLabel value="Expanded:" />
+ <h:outputText value="#{richTreeListenerBean.treeToggleEvent.expanded}" />
+ </h:panelGrid>
+ </h:panelGrid>
+ </a4j:outputPanel>
+
<fieldset>
<legend>rich:tree</legend>
<metamer:attributes value="#{richTreeBean.attributes}" id="attributes" />
Modified: modules/tests/metamer/trunk/application/src/main/webapp/components/richTree/treeAdaptors.xhtml
===================================================================
--- modules/tests/metamer/trunk/application/src/main/webapp/components/richTree/treeAdaptors.xhtml 2010-12-15 17:08:39 UTC (rev 20584)
+++ modules/tests/metamer/trunk/application/src/main/webapp/components/richTree/treeAdaptors.xhtml 2010-12-15 17:09:25 UTC (rev 20585)
@@ -78,12 +78,10 @@
iconClass="#{richTreeBean.attributes['iconClass'].value}"
labelClass="#{richTreeBean.attributes['labelClass'].value}"
nodeClass="#{richTreeBean.attributes['nodeClass'].value}"
- >
-
- <a4j:ajax event="selectionchange" render="selectionOutput" />
- <a4j:ajax event="nodetoggle" render="selectionOutput" />
+ selectionChangeListener="#{richTreeListenerBean.processSelectionChange}"
+ toggleListener="#{richTreeListenerBean.processToggle}">
+ >
-
<rich:treeModelRecursiveAdaptor
roots="#{richTreeModelRecursiveAdaptorBean.rootNodes}"
nodes="#{richTreeModelRecursiveAdaptorBean.useMapModel ? node.recursiveMap : node.recursiveList}"
@@ -146,29 +144,52 @@
<ui:define name="outOfTemplateAfter">
- <h:panelGrid id="selectionOutput" columns="2">
- <h:outputLabel value="Selection:" />
- <h:outputText value="#{richTreeBean.selection}" />
-
- <h:outputLabel value="Lazy Initialized:" />
- <h:outputText value="#{richTreeModelRecursiveAdaptorBean.lazyInitializedNodes}" />
-
- <h:outputLabel value="Recursive Leaf Children Nullable:" />
- <h:selectBooleanCheckbox value="#{richTreeModelRecursiveAdaptorBean.leafChildrenNullable}">
- <a4j:ajax render="commonGrid" />
- </h:selectBooleanCheckbox>
-
- <h:outputLabel value="Recursive Model Representation:" />
- <h:selectOneRadio value="#{richTreeModelRecursiveAdaptorBean.useMapModel}">
- <f:selectItem itemLabel="List<RecursiveNode>" itemValue="false" />
- <f:selectItem itemLabel="Map<Integer, RecursiveNode>" itemValue="true" />
-
- <a4j:ajax render="commonGrid" />
- </h:selectOneRadio>
- </h:panelGrid>
-
- <a4j:outputPanel>
-
+ <a4j:outputPanel ajaxRendered="true">
+ <h:panelGrid id="selectionOutput" columns="2">
+
+ <h:outputLabel value="Recursive Leaf Children Nullable:" />
+ <h:selectBooleanCheckbox value="#{richTreeModelRecursiveAdaptorBean.leafChildrenNullable}">
+ <a4j:ajax render="commonGrid" />
+ </h:selectBooleanCheckbox>
+
+ <h:outputLabel value="Recursive Model Representation:" />
+ <h:selectOneRadio value="#{richTreeModelRecursiveAdaptorBean.useMapModel}">
+ <f:selectItem itemLabel="List<RecursiveNode>" itemValue="false" />
+ <f:selectItem itemLabel="Map<Integer, RecursiveNode>" itemValue="true" />
+
+ <a4j:ajax render="commonGrid" />
+ </h:selectOneRadio>
+
+ <h:outputLabel value="Selection:" />
+ <h:outputText value="#{richTreeBean.selection}" />
+
+ <h:outputLabel value="Lazy Initialized:" />
+ <h:outputText value="#{richTreeModelRecursiveAdaptorBean.lazyInitializedNodes}" />
+
+ <h:outputLabel value="Selection Change Event:" rendered="#{not empty richTreeListenerBean.treeSelectionChangeEvent}" />
+ <h:panelGrid columns="2" rendered="#{not empty richTreeListenerBean.treeSelectionChangeEvent}">
+ <h:outputLabel value="Client ID:" />
+ <h:outputText value="#{richTreeListenerBean.treeSelectionChangeEvent.component.id}" />
+
+ <h:outputLabel value="New Selection:" />
+ <h:outputText value="#{richTreeListenerBean.treeSelectionChangeEvent.newSelection}" />
+
+ <h:outputLabel value="Old Selection:" />
+ <h:outputText value="#{richTreeListenerBean.treeSelectionChangeEvent.oldSelection}" />
+ </h:panelGrid>
+
+ <h:outputLabel value="Tree Toggle Event:" rendered="#{not empty richTreeListenerBean.treeToggleEvent}" />
+ <h:panelGrid columns="2" rendered="#{not empty richTreeListenerBean.treeToggleEvent}">
+ <h:outputLabel value="Client ID:" />
+ <h:outputText value="#{richTreeListenerBean.treeToggleEvent.component.id}" />
+
+ <h:outputLabel value="Collapsed:" />
+ <h:outputText value="#{richTreeListenerBean.treeToggleEvent.collapsed}" />
+
+ <h:outputLabel value="Expanded:" />
+ <h:outputText value="#{richTreeListenerBean.treeToggleEvent.expanded}" />
+ </h:panelGrid>
+ </h:panelGrid>
</a4j:outputPanel>
<fieldset>
14 years
JBoss Rich Faces SVN: r20584 - in modules/tests/metamer/trunk/application/src/main: webapp/components/richTree and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: lfryc(a)redhat.com
Date: 2010-12-15 12:08:39 -0500 (Wed, 15 Dec 2010)
New Revision: 20584
Modified:
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichTreeBean.java
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichTreeNodeBean.java
modules/tests/metamer/trunk/application/src/main/webapp/components/richTree/simple.xhtml
modules/tests/metamer/trunk/application/src/main/webapp/components/richTree/treeAdaptors.xhtml
Log:
rich:tree - tree node look customization from RF-9686 integrated to Metamer (RF-9827)
Modified: modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichTreeBean.java
===================================================================
--- modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichTreeBean.java 2010-12-15 17:07:20 UTC (rev 20583)
+++ modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichTreeBean.java 2010-12-15 17:08:39 UTC (rev 20584)
@@ -75,6 +75,15 @@
attributes.get("rendered").setValue(true);
attributes.get("toggleType").setValue("ajax");
attributes.get("selectionType").setValue("ajax");
+
+ // FIXME attributes not in taglib
+ attributes.setAttribute("iconLeaf", null);
+ attributes.setAttribute("iconExpanded", null);
+ attributes.setAttribute("iconCollapsed", null);
+ attributes.setAttribute("handleClass", null);
+ attributes.setAttribute("iconClass", null);
+ attributes.setAttribute("labelClass", null);
+ attributes.setAttribute("nodeClass", null);
// hidden attributes
attributes.remove("selectionChangeListener");
Modified: modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichTreeNodeBean.java
===================================================================
--- modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichTreeNodeBean.java 2010-12-15 17:07:20 UTC (rev 20583)
+++ modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichTreeNodeBean.java 2010-12-15 17:08:39 UTC (rev 20584)
@@ -42,7 +42,7 @@
private static final long serialVersionUID = 4008175400649809L;
private static Logger logger;
- private Attributes attributes;
+ private Attributes[] attributes = new Attributes[3];
/**
* Initializes the managed bean.
@@ -52,16 +52,28 @@
logger = LoggerFactory.getLogger(getClass());
logger.debug("initializing bean " + getClass().getName());
- attributes = Attributes.getUIComponentAttributes(UITreeModelAdaptor.class, getClass(), false);
+ for (int i = 0; i < attributes.length; i++) {
+ attributes[i] = Attributes.getUIComponentAttributes(UITreeModelAdaptor.class, getClass(), false);
- attributes.get("rendered").setValue(true);
+
+ attributes[i].get("rendered").setValue(true);
+
+ // FIXME attributes not in taglib
+ attributes[i].setAttribute("iconLeaf", null);
+ attributes[i].setAttribute("iconExpanded", null);
+ attributes[i].setAttribute("iconCollapsed", null);
+ attributes[i].setAttribute("handleClass", null);
+ attributes[i].setAttribute("iconClass", null);
+ attributes[i].setAttribute("labelClass", null);
+ attributes[i].setAttribute("styleClass", null);
+ }
}
- public Attributes getAttributes() {
+ public Attributes[] getAttributes() {
return attributes;
}
- public void setAttributes(Attributes attributes) {
+ public void setAttributes(Attributes[] attributes) {
this.attributes = attributes;
}
}
Modified: modules/tests/metamer/trunk/application/src/main/webapp/components/richTree/simple.xhtml
===================================================================
--- modules/tests/metamer/trunk/application/src/main/webapp/components/richTree/simple.xhtml 2010-12-15 17:07:20 UTC (rev 20583)
+++ modules/tests/metamer/trunk/application/src/main/webapp/components/richTree/simple.xhtml 2010-12-15 17:08:39 UTC (rev 20584)
@@ -73,24 +73,75 @@
styleClass="#{richTreeBean.attributes['styleClass'].value}"
title="#{richTreeBean.attributes['title'].value}"
toggleType="#{richTreeBean.attributes['toggleType'].value}"
+ iconLeaf="#{richTreeBean.attributes['iconLeaf'].value}"
+ iconExpanded="#{richTreeBean.attributes['iconExpanded'].value}"
+ iconCollapsed="#{richTreeBean.attributes['iconCollapsed'].value}"
+ handleClass="#{richTreeBean.attributes['handleClass'].value}"
+ iconClass="#{richTreeBean.attributes['iconClass'].value}"
+ labelClass="#{richTreeBean.attributes['labelClass'].value}"
+ nodeClass="#{richTreeBean.attributes['nodeClass'].value}"
>
- <rich:treeNode type="country">
+ <rich:treeNode type="country"
+ rendered="#{richTreeNodeBean.attributes[0]['rendered'].value}"
+ iconLeaf="#{richTreeNodeBean.attributes[0]['iconLeaf'].value}"
+ iconExpanded="#{richTreeNodeBean.attributes[0]['iconExpanded'].value}"
+ iconCollapsed="#{richTreeNodeBean.attributes[0]['iconCollapsed'].value}"
+ handleClass="#{richTreeNodeBean.attributes[0]['handleClass'].value}"
+ iconClass="#{richTreeNodeBean.attributes[0]['iconClass'].value}"
+ labelClass="#{richTreeNodeBean.attributes[0]['labelClass'].value}"
+ styleClass="#{richTreeNodeBean.attributes[0]['styleClass'].value}"
+ >
#{node.name}
</rich:treeNode>
- <rich:treeNode type="company" icon="/images/tree/disc.gif">
+ <rich:treeNode type="company"
+ icon="/images/tree/disc.gif"
+ rendered="#{richTreeNodeBean.attributes[1]['rendered'].value}"
+ iconLeaf="#{richTreeNodeBean.attributes[1]['iconLeaf'].value}"
+ iconExpanded="#{richTreeNodeBean.attributes[1]['iconExpanded'].value}"
+ iconCollapsed="#{richTreeNodeBean.attributes[1]['iconCollapsed'].value}"
+ handleClass="#{richTreeNodeBean.attributes[1]['handleClass'].value}"
+ iconClass="#{richTreeNodeBean.attributes[1]['iconClass'].value}"
+ labelClass="#{richTreeNodeBean.attributes[1]['labelClass'].value}"
+ styleClass="#{richTreeNodeBean.attributes[1]['styleClass'].value}"
+ >
#{node.name}
</rich:treeNode>
- <rich:treeNode type="cd" icon="/images/tree/song.gif">
+ <rich:treeNode type="cd"
+ icon="/images/tree/song.gif"
+ rendered="#{richTreeNodeBean.attributes[2]['rendered'].value}"
+ iconLeaf="#{richTreeNodeBean.attributes[2]['iconLeaf'].value}"
+ iconExpanded="#{richTreeNodeBean.attributes[2]['iconExpanded'].value}"
+ iconCollapsed="#{richTreeNodeBean.attributes[2]['iconCollapsed'].value}"
+ handleClass="#{richTreeNodeBean.attributes[2]['handleClass'].value}"
+ iconClass="#{richTreeNodeBean.attributes[2]['iconClass'].value}"
+ labelClass="#{richTreeNodeBean.attributes[2]['labelClass'].value}"
+ styleClass="#{richTreeNodeBean.attributes[2]['styleClass'].value}"
+ >
#{node.artist} - #{node.title}
</rich:treeNode>
</rich:tree>
</ui:define>
<ui:define name="outOfTemplateAfter">
- <metamer:attributes value="#{richTreeBean.attributes}" id="attributes" />
+ <fieldset>
+ <legend>rich:tree</legend>
+ <metamer:attributes value="#{richTreeBean.attributes}" id="attributes" />
+ </fieldset>
+ <fieldset>
+ <legend>rich:treeNode type="company"</legend>
+ <metamer:attributes value="#{richTreeNodeBean.attributes[0]}" id="treeNode1Attributes" />
+ </fieldset>
+ <fieldset>
+ <legend>rich:treeNode type="company"</legend>
+ <metamer:attributes value="#{richTreeNodeBean.attributes[1]}" id="treeNode2Attributes" />
+ </fieldset>
+ <fieldset>
+ <legend>rich:treeNode type="cd"</legend>
+ <metamer:attributes value="#{richTreeNodeBean.attributes[2]}" id="treeNode3Attributes" />
+ </fieldset>
</ui:define>
</ui:composition>
Modified: modules/tests/metamer/trunk/application/src/main/webapp/components/richTree/treeAdaptors.xhtml
===================================================================
--- modules/tests/metamer/trunk/application/src/main/webapp/components/richTree/treeAdaptors.xhtml 2010-12-15 17:07:20 UTC (rev 20583)
+++ modules/tests/metamer/trunk/application/src/main/webapp/components/richTree/treeAdaptors.xhtml 2010-12-15 17:08:39 UTC (rev 20584)
@@ -71,6 +71,13 @@
styleClass="#{richTreeBean.attributes['styleClass'].value}"
title="#{richTreeBean.attributes['title'].value}"
toggleType="#{richTreeBean.attributes['toggleType'].value}"
+ iconLeaf="#{richTreeBean.attributes['iconLeaf'].value}"
+ iconExpanded="#{richTreeBean.attributes['iconExpanded'].value}"
+ iconCollapsed="#{richTreeBean.attributes['iconCollapsed'].value}"
+ handleClass="#{richTreeBean.attributes['handleClass'].value}"
+ iconClass="#{richTreeBean.attributes['iconClass'].value}"
+ labelClass="#{richTreeBean.attributes['labelClass'].value}"
+ nodeClass="#{richTreeBean.attributes['nodeClass'].value}"
>
<a4j:ajax event="selectionchange" render="selectionOutput" />
@@ -83,19 +90,32 @@
recursionOrder="#{richTreeModelRecursiveAdaptorBean.attributes['recursionOrder'].value}"
>
- <rich:treeNode rendered="#{node.class.simpleName != 'RecursiveNode' || node.number != 1 || richTreeNodeBean.attributes['rendered'].value}">
+ <rich:treeNode
+ rendered="#{richTreeNodeBean.attributes[0]['rendered'].value || node.number != 1}"
+ iconLeaf="#{richTreeNodeBean.attributes[0]['iconLeaf'].value}"
+ iconExpanded="#{richTreeNodeBean.attributes[0]['iconExpanded'].value}"
+ iconCollapsed="#{richTreeNodeBean.attributes[0]['iconCollapsed'].value}"
+ handleClass="#{richTreeNodeBean.attributes[0]['handleClass'].value}"
+ iconClass="#{richTreeNodeBean.attributes[0]['iconClass'].value}"
+ labelClass="#{richTreeNodeBean.attributes[0]['labelClass'].value}"
+ styleClass="#{richTreeNodeBean.attributes[0]['styleClass'].value}">
+
<a4j:outputPanel id="panel">
#{node.label}
</a4j:outputPanel>
</rich:treeNode>
- <rich:treeModelAdaptor nodes="#{node.model.list}" rendered="#{richTreeModelAdaptorBean.attributes['rendered'].value}">
+ <rich:treeModelAdaptor
+ nodes="#{node.model.list}"
+ rendered="#{richTreeModelAdaptorBean.attributes['rendered'].value}">
<rich:treeNode>
#{node.label}
</rich:treeNode>
</rich:treeModelAdaptor>
- <rich:treeModelAdaptor nodes="#{node.model.map}" rendered="#{richTreeModelAdaptorBean.attributes['rendered'].value}">
+ <rich:treeModelAdaptor
+ nodes="#{node.model.map}"
+ rendered="#{richTreeModelAdaptorBean.attributes['rendered'].value}">
<rich:treeNode>
#{node.label}
</rich:treeNode>
@@ -106,7 +126,16 @@
nodes="#{richTreeModelRecursiveAdaptorBean.useMapModel ? node.recursiveMap : node.recursiveList}"
rendered="#{richTreeModelRecursiveAdaptorBean.attributes['rendered'].value}">
- <rich:treeNode rendered="#{richTreeNodeBean.attributes['rendered'].value || node.number != 1}">
+ <rich:treeNode
+ rendered="#{richTreeNodeBean.attributes[1]['rendered'].value || node.number != 1}"
+ iconLeaf="#{richTreeNodeBean.attributes[1]['iconLeaf'].value}"
+ iconExpanded="#{richTreeNodeBean.attributes[1]['iconExpanded'].value}"
+ iconCollapsed="#{richTreeNodeBean.attributes[1]['iconCollapsed'].value}"
+ handleClass="#{richTreeNodeBean.attributes[1]['handleClass'].value}"
+ iconClass="#{richTreeNodeBean.attributes[1]['iconClass'].value}"
+ labelClass="#{richTreeNodeBean.attributes[1]['labelClass'].value}"
+ styleClass="#{richTreeNodeBean.attributes[1]['styleClass'].value}"
+ >
#{node.label}
</rich:treeNode>
</rich:treeModelRecursiveAdaptor>
@@ -144,13 +173,14 @@
<fieldset>
<legend>rich:tree</legend>
+ <metamer:attributes value="#{richTreeBean.attributes}" id="treeAttributes" />
<fieldset>
- <legend>rich:treeModelRecursiveAdaptor [1]</legend>
+ <legend>rich:treeModelRecursiveAdaptor [0]</legend>
<fieldset>
- <legend>rich:treeNode</legend>
- <metamer:attributes value="#{richTreeNodeBean.attributes}" id="nodeAttributes" />
+ <legend>rich:treeNode [0]</legend>
+ <metamer:attributes value="#{richTreeNodeBean.attributes[0]}" id="node0Attributes" />
</fieldset>
<fieldset>
@@ -159,12 +189,15 @@
</fieldset>
<fieldset>
- <legend>rich:treeModelRecursiveAdaptor [2]</legend>
+ <legend>rich:treeModelRecursiveAdaptor [1]</legend>
<metamer:attributes value="#{richTreeModelRecursiveAdaptorBean.attributes}" id="recursiveAttributes" />
+
+ <fieldset>
+ <legend>rich:treeNode [1]</legend>
+ <metamer:attributes value="#{richTreeNodeBean.attributes[1]}" id="node1Attributes" />
+ </fieldset>
</fieldset>
</fieldset>
-
- <metamer:attributes value="#{richTreeBean.attributes}" id="treeAttributes" />
</fieldset>
</ui:define>
14 years
JBoss Rich Faces SVN: r20583 - modules/tests/metamer/trunk/application/src/main/webapp/components/richTree.
by richfaces-svn-commits@lists.jboss.org
Author: lfryc(a)redhat.com
Date: 2010-12-15 12:07:20 -0500 (Wed, 15 Dec 2010)
New Revision: 20583
Modified:
modules/tests/metamer/trunk/application/src/main/webapp/components/richTree/simple.xhtml
modules/tests/metamer/trunk/application/src/main/webapp/components/richTree/treeAdaptors.xhtml
Log:
rich:tree - added missing attributes (incl. client-side event handlers: RF-9714) (RF-9827)
Modified: modules/tests/metamer/trunk/application/src/main/webapp/components/richTree/simple.xhtml
===================================================================
--- modules/tests/metamer/trunk/application/src/main/webapp/components/richTree/simple.xhtml 2010-12-15 15:04:13 UTC (rev 20582)
+++ modules/tests/metamer/trunk/application/src/main/webapp/components/richTree/simple.xhtml 2010-12-15 17:07:20 UTC (rev 20583)
@@ -41,14 +41,39 @@
</ui:define>
<ui:define name="component">
- <rich:tree id="tree"
+
+ <rich:tree id="richTree"
nodeType="#{node.type}"
var="node"
value="#{richTreeBean.root}"
- toggleType="#{richTreeBean.attributes['toggleType'].value}"
- selectionType="#{richTreeBean.attributes['selectionType'].value}"
- rendered="#{richTreeBean.attributes['rendered'].value}">
+ dir="#{richTreeBean.attributes['dir'].value}"
+ lang="#{richTreeBean.attributes['lang'].value}"
+ onbeforedomupdate="#{richTreeBean.attributes['onbeforedomupdate'].value}"
+ onbeforenodetoggle="#{richTreeBean.attributes['onbeforenodetoggle'].value}"
+ onbeforeselectionchange="#{richTreeBean.attributes['onbeforeselectionchange'].value}"
+ onbegin="#{richTreeBean.attributes['onbegin'].value}"
+ onclick="#{richTreeBean.attributes['onclick'].value}"
+ oncomplete="#{richTreeBean.attributes['oncomplete'].value}"
+ ondblclick="#{richTreeBean.attributes['ondblclick'].value}"
+ onkeydown="#{richTreeBean.attributes['onkeydown'].value}"
+ onkeypress="#{richTreeBean.attributes['onkeypress'].value}"
+ onkeyup="#{richTreeBean.attributes['onkeyup'].value}"
+ onmousedown="#{richTreeBean.attributes['onmousedown'].value}"
+ onmousemove="#{richTreeBean.attributes['onmousemove'].value}"
+ onmouseup="#{richTreeBean.attributes['onmouseup'].value}"
+ onmouseout="#{richTreeBean.attributes['onmouseout'].value}"
+ onmouseover="#{richTreeBean.attributes['onmouseover'].value}"
+ onnodetoggle="#{richTreeBean.attributes['onnodetoggle'].value}"
+ onselectionchange="#{richTreeBean.attributes['onselectionchange'].value}"
+ rendered="#{richTreeBean.attributes['rendered'].value}"
+ selection="#{richTreeBean.selection}"
+ selectionType="#{richTreeBean.attributes['selectionType'].value}"
+ style="#{richTreeBean.attributes['style'].value}"
+ styleClass="#{richTreeBean.attributes['styleClass'].value}"
+ title="#{richTreeBean.attributes['title'].value}"
+ toggleType="#{richTreeBean.attributes['toggleType'].value}"
+ >
<rich:treeNode type="country">
#{node.name}
Modified: modules/tests/metamer/trunk/application/src/main/webapp/components/richTree/treeAdaptors.xhtml
===================================================================
--- modules/tests/metamer/trunk/application/src/main/webapp/components/richTree/treeAdaptors.xhtml 2010-12-15 15:04:13 UTC (rev 20582)
+++ modules/tests/metamer/trunk/application/src/main/webapp/components/richTree/treeAdaptors.xhtml 2010-12-15 17:07:20 UTC (rev 20583)
@@ -42,7 +42,9 @@
<ui:define name="component">
- <rich:tree id="richTree" var="node"
+ <rich:tree id="richTree"
+ var="node"
+
dir="#{richTreeBean.attributes['dir'].value}"
lang="#{richTreeBean.attributes['lang'].value}"
onbeforedomupdate="#{richTreeBean.attributes['onbeforedomupdate'].value}"
14 years
JBoss Rich Faces SVN: r20582 - in modules/tests/metamer/trunk: application/src/main/webapp/components/a4jJSFunction and 1 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: ppitonak(a)redhat.com
Date: 2010-12-15 10:04:13 -0500 (Wed, 15 Dec 2010)
New Revision: 20582
Modified:
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/A4JJSFunctionBean.java
modules/tests/metamer/trunk/application/src/main/webapp/components/a4jJSFunction/simple.xhtml
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/AbstractMetamerTest.java
Log:
* tests for jsFunction fixed
Modified: modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/A4JJSFunctionBean.java
===================================================================
--- modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/A4JJSFunctionBean.java 2010-12-15 14:49:18 UTC (rev 20581)
+++ modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/A4JJSFunctionBean.java 2010-12-15 15:04:13 UTC (rev 20582)
@@ -60,15 +60,11 @@
logger.debug("initializing bean " + getClass().getName());
year = Integer.parseInt(new SimpleDateFormat("yyyy").format(new Date()));
- // initialize attributes
- attributes = Attributes.getUIComponentAttributes(UIFunction.class, getClass());
+ attributes = Attributes.getUIComponentAttributes(UIFunction.class, getClass(), false);
- attributes.setAttribute("execute", "@form");
+ attributes.setAttribute("name", "metamerFunction");
attributes.setAttribute("render", "time1, time2, year");
attributes.setAttribute("rendered", true);
-
- // TODO has to be tested in other way
- attributes.remove("name");
}
public Attributes getAttributes() {
@@ -78,7 +74,7 @@
public void setAttributes(Attributes attributes) {
this.attributes = attributes;
}
-
+
public int getYear() {
return year;
}
Modified: modules/tests/metamer/trunk/application/src/main/webapp/components/a4jJSFunction/simple.xhtml
===================================================================
--- modules/tests/metamer/trunk/application/src/main/webapp/components/a4jJSFunction/simple.xhtml 2010-12-15 14:49:18 UTC (rev 20581)
+++ modules/tests/metamer/trunk/application/src/main/webapp/components/a4jJSFunction/simple.xhtml 2010-12-15 15:04:13 UTC (rev 20582)
@@ -59,10 +59,11 @@
action="#{a4jJSFunctionBean.attributes.action}"
actionListener="#{a4jJSFunctionBean.attributes.actionListener}"
bypassUpdates="#{a4jJSFunctionBean.attributes['bypassUpdates'].value}"
+ data="#{a4jJSFunctionBean.attributes['data'].value}"
execute="#{a4jJSFunctionBean.attributes['execute'].value}"
immediate="#{a4jJSFunctionBean.attributes['immediate'].value}"
limitRender="#{a4jJSFunctionBean.attributes['limitRender'].value}"
- name="metamerFunction"
+ name="#{a4jJSFunctionBean.attributes['name'].value}"
onbeforedomupdate="#{a4jJSFunctionBean.attributes['onbeforedomupdate'].value}"
onbegin="#{a4jJSFunctionBean.attributes['onbegin'].value}"
oncomplete="#{a4jJSFunctionBean.attributes['oncomplete'].value}"
@@ -74,7 +75,7 @@
</a4j:jsFunction>
<br/>
- <a id="callFunctionLink" href="#" onclick="javascript:metamerFunction()">Call JavaScript function</a>
+ <a id="callFunctionLink" href="#" onclick="javascript:#{a4jJSFunctionBean.attributes['name'].value}()">Call JavaScript function (#{a4jJSFunctionBean.attributes['name'].value})</a>
</ui:define>
<ui:define name="outOfTemplateAfter">
Modified: modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/AbstractMetamerTest.java
===================================================================
--- modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/AbstractMetamerTest.java 2010-12-15 14:49:18 UTC (rev 20581)
+++ modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/AbstractMetamerTest.java 2010-12-15 15:04:13 UTC (rev 20582)
@@ -32,11 +32,15 @@
import java.net.URL;
import java.util.Locale;
+import java.util.Random;
+import java.util.Set;
import javax.faces.event.PhaseId;
import org.apache.commons.lang.LocaleUtils;
import org.jboss.test.selenium.AbstractTestCase;
+import org.jboss.test.selenium.cookie.Cookie;
+import org.jboss.test.selenium.cookie.DeleteCookieOptions;
import org.jboss.test.selenium.dom.Event;
import org.jboss.test.selenium.encapsulated.JavaScript;
import org.jboss.test.selenium.locator.Attribute;
@@ -85,7 +89,7 @@
@BeforeMethod(alwaysRun = true)
public void loadPage(Object[] templates) {
if (selenium == null) {
- new SkipException("selenium isn't initialized");
+ throw new SkipException("selenium isn't initialized");
}
selenium.open(buildUrl(getTestUrl() + "?templates=" + template.toString()));
selenium.waitForPageToLoad(TIMEOUT);
@@ -97,6 +101,16 @@
@AfterMethod(alwaysRun = true)
public void invalidateSession() {
selenium.deleteAllVisibleCookies();
+
+ // TODO slow and unreliable solution
+ selenium.open(contextPath);
+ selenium.waitForPageToLoad(TIMEOUT);
+ JQueryLocator button = jq("input[id$=invalidateSessionButton]");
+
+ if (selenium.isElementPresent(button)) {
+ selenium.click(button);
+ selenium.waitForPageToLoad(TIMEOUT);
+ }
}
/**
@@ -113,14 +127,14 @@
e.printStackTrace();
}
}
-
+
/**
* Do a full page refresh (regular HTTP request) by triggering a command with no action bound.
*/
public void fullPageRefresh() {
guardHttp(selenium).click(id("controlsForm:fullPageRefreshImage"));
}
-
+
/**
* Rerender all content of the page (AJAX request) by trigerring a command with no action but render bound.
*/
@@ -178,7 +192,7 @@
waitGui.failWith("Attribute on" + attributeName + " does not work correctly").until(
new EventFiredCondition(event));
}
-
+
/**
* Returns the locale of the tested page
* @return the locale of the tested page
14 years
JBoss Rich Faces SVN: r20581 - in trunk: ui/common/ui/src/main/java/org/richfaces/renderkit/util and 1 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2010-12-15 09:49:18 -0500 (Wed, 15 Dec 2010)
New Revision: 20581
Modified:
trunk/core/api/src/main/java/org/ajax4jsf/component/AjaxClientBehavior.java
trunk/ui/common/ui/src/main/java/org/richfaces/renderkit/util/AjaxRendererUtils.java
trunk/ui/core/ui/src/main/java/org/ajax4jsf/component/behavior/AjaxBehavior.java
Log:
https://issues.jboss.org/browse/RF-9822
Modified: trunk/core/api/src/main/java/org/ajax4jsf/component/AjaxClientBehavior.java
===================================================================
--- trunk/core/api/src/main/java/org/ajax4jsf/component/AjaxClientBehavior.java 2010-12-15 13:59:15 UTC (rev 20580)
+++ trunk/core/api/src/main/java/org/ajax4jsf/component/AjaxClientBehavior.java 2010-12-15 14:49:18 UTC (rev 20581)
@@ -35,10 +35,6 @@
public String getStatus();
- public String getOnevent();
-
- public void setOnevent(String onevent);
-
public String getOnerror();
public void setOnerror(String onerror);
Modified: trunk/ui/common/ui/src/main/java/org/richfaces/renderkit/util/AjaxRendererUtils.java
===================================================================
--- trunk/ui/common/ui/src/main/java/org/richfaces/renderkit/util/AjaxRendererUtils.java 2010-12-15 13:59:15 UTC (rev 20580)
+++ trunk/ui/common/ui/src/main/java/org/richfaces/renderkit/util/AjaxRendererUtils.java 2010-12-15 14:49:18 UTC (rev 20581)
@@ -97,12 +97,6 @@
public String getAttributeValue(AjaxClientBehavior behavior) {
return behavior.getQueueId();
}
- },
- event {
- @Override
- public String getAttributeValue(AjaxClientBehavior behavior) {
- return behavior.getOnevent();
- }
};
public abstract String getAttributeValue(AjaxClientBehavior behavior);
Modified: trunk/ui/core/ui/src/main/java/org/ajax4jsf/component/behavior/AjaxBehavior.java
===================================================================
--- trunk/ui/core/ui/src/main/java/org/ajax4jsf/component/behavior/AjaxBehavior.java 2010-12-15 13:59:15 UTC (rev 20580)
+++ trunk/ui/core/ui/src/main/java/org/ajax4jsf/component/behavior/AjaxBehavior.java 2010-12-15 14:49:18 UTC (rev 20581)
@@ -74,7 +74,7 @@
private static final Set<String> NONE_SINGLETON_SET = Collections.singleton(NONE);
enum PropertyKeys {
- data, execute, onbeforedomupdate, onbegin, oncomplete, onerror, onevent, queueId, render,
+ data, execute, onbeforedomupdate, onbegin, oncomplete, onerror, queueId, render,
status, disabled, limitRender, immediate, bypassUpdates
}
@@ -105,8 +105,6 @@
setOncomplete((String) value);
} else if (compare(PropertyKeys.onerror, name)) {
setOnerror((String) value);
- } else if (compare(PropertyKeys.onevent, name)) {
- setOnevent((String) value);
} else if (compare(PropertyKeys.queueId, name)) {
setQueueId((String) value);
} else if (compare(PropertyKeys.status, name)) {
@@ -233,15 +231,6 @@
}
@Attribute
- public String getOnevent() {
- return (String) getStateHelper().eval(PropertyKeys.onevent);
- }
-
- public void setOnevent(String onevent) {
- getStateHelper().put(PropertyKeys.onevent, onevent);
- }
-
- @Attribute
public String getQueueId() {
return (String) getStateHelper().eval(PropertyKeys.queueId);
}
@@ -420,4 +409,5 @@
return state;
}
+
}
14 years
JBoss Rich Faces SVN: r20580 - trunk/ui/output/ui/src/main/resources/META-INF.
by richfaces-svn-commits@lists.jboss.org
Author: Alex.Kolonitsky
Date: 2010-12-15 08:59:15 -0500 (Wed, 15 Dec 2010)
New Revision: 20580
Modified:
trunk/ui/output/ui/src/main/resources/META-INF/pn.faces-config.xml
trunk/ui/output/ui/src/main/resources/META-INF/pn.taglib.xml
Log:
RF-9945: Taglib: toggleControl has no attributes
Modified: trunk/ui/output/ui/src/main/resources/META-INF/pn.faces-config.xml
===================================================================
--- trunk/ui/output/ui/src/main/resources/META-INF/pn.faces-config.xml 2010-12-15 13:32:31 UTC (rev 20579)
+++ trunk/ui/output/ui/src/main/resources/META-INF/pn.faces-config.xml 2010-12-15 13:59:15 UTC (rev 20580)
@@ -8,6 +8,26 @@
<behavior>
<behavior-id>org.richfaces.component.behavior.ToggleControl</behavior-id>
<behavior-class>org.richfaces.component.behavior.ToggleControl</behavior-class>
+ <property>
+ <property-name>targetPanel</property-name>
+ <property-class>java.lang.String</property-class>
+ </property>
+ <property>
+ <property-name>targetItem</property-name>
+ <property-class>java.lang.String</property-class>
+ </property>
+ <property>
+ <property-name>event</property-name>
+ <property-class>java.lang.String</property-class>
+ </property>
+ <property>
+ <property-name>disableDefault</property-name>
+ <property-class>java.lang.Boolean</property-class>
+ </property>
+ <property>
+ <property-name>for</property-name>
+ <property-class>java.lang.String</property-class>
+ </property>
</behavior>
<component>
Modified: trunk/ui/output/ui/src/main/resources/META-INF/pn.taglib.xml
===================================================================
--- trunk/ui/output/ui/src/main/resources/META-INF/pn.taglib.xml 2010-12-15 13:32:31 UTC (rev 20579)
+++ trunk/ui/output/ui/src/main/resources/META-INF/pn.taglib.xml 2010-12-15 13:59:15 UTC (rev 20580)
@@ -3,6 +3,33 @@
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-facelettaglibrary_2_0.xsd">
<namespace>http://richfaces.org/pn</namespace>
<tag>
+ <tag-name>toggleControl</tag-name>
+ <behavior>
+ <behavior-id>org.richfaces.component.behavior.ToggleControl</behavior-id>
+ <handler-class>org.richfaces.view.facelets.html.CustomBehaviorHandler</handler-class>
+ </behavior>
+ <attribute>
+ <name>targetPanel</name>
+ <type>java.lang.String</type>
+ </attribute>
+ <attribute>
+ <name>targetItem</name>
+ <type>java.lang.String</type>
+ </attribute>
+ <attribute>
+ <name>event</name>
+ <type>java.lang.String</type>
+ </attribute>
+ <attribute>
+ <name>disableDefault</name>
+ <type>java.lang.Boolean</type>
+ </attribute>
+ <attribute>
+ <name>for</name>
+ <type>java.lang.String</type>
+ </attribute>
+ </tag>
+ <tag>
<tag-name>tabPanel</tag-name>
<component>
<component-type>org.richfaces.TabPanel</component-type>
14 years
JBoss Rich Faces SVN: r20579 - in trunk: core/impl/src/main/java/org/richfaces/resource and 2 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2010-12-15 08:32:31 -0500 (Wed, 15 Dec 2010)
New Revision: 20579
Modified:
trunk/core/api/src/main/java/org/richfaces/resource/ResourceFactory.java
trunk/core/impl/src/main/java/org/richfaces/resource/ResourceFactoryImpl.java
trunk/ui/core/ui/src/main/java/org/richfaces/component/AbstractMediaOutput.java
trunk/ui/core/ui/src/main/java/org/richfaces/resource/MediaOutputResource.java
Log:
https://issues.jboss.org/browse/RF-10008
Modified: trunk/core/api/src/main/java/org/richfaces/resource/ResourceFactory.java
===================================================================
--- trunk/core/api/src/main/java/org/richfaces/resource/ResourceFactory.java 2010-12-15 13:04:17 UTC (rev 20578)
+++ trunk/core/api/src/main/java/org/richfaces/resource/ResourceFactory.java 2010-12-15 13:32:31 UTC (rev 20579)
@@ -44,8 +44,4 @@
public abstract Resource createResource(FacesContext context, ResourceRequestData resourceData);
- public abstract Resource createResource(UserResource resource);
-
- public abstract Resource createResource(Java2DUserResource resource);
-
}
Modified: trunk/core/impl/src/main/java/org/richfaces/resource/ResourceFactoryImpl.java
===================================================================
--- trunk/core/impl/src/main/java/org/richfaces/resource/ResourceFactoryImpl.java 2010-12-15 13:04:17 UTC (rev 20578)
+++ trunk/core/impl/src/main/java/org/richfaces/resource/ResourceFactoryImpl.java 2010-12-15 13:32:31 UTC (rev 20579)
@@ -476,7 +476,7 @@
return Collections.unmodifiableSet(mappedResourceDataMap.keySet());
}
- public Resource createResource(Java2DUserResource resource) {
+ protected Resource createResource(Java2DUserResource resource) {
boolean cacheable = isCacheableSet(resource.getClass());
boolean versioned = isVersionedSet(resource.getClass());
@@ -488,7 +488,7 @@
}
}
- public Resource createResource(UserResource resource) {
+ protected Resource createResource(UserResource resource) {
boolean cacheable = isCacheableSet(resource.getClass());
boolean versioned = isVersionedSet(resource.getClass());
Modified: trunk/ui/core/ui/src/main/java/org/richfaces/component/AbstractMediaOutput.java
===================================================================
--- trunk/ui/core/ui/src/main/java/org/richfaces/component/AbstractMediaOutput.java 2010-12-15 13:04:17 UTC (rev 20578)
+++ trunk/ui/core/ui/src/main/java/org/richfaces/component/AbstractMediaOutput.java 2010-12-15 13:32:31 UTC (rev 20579)
@@ -28,11 +28,11 @@
import javax.el.MethodExpression;
import javax.faces.application.Resource;
+import javax.faces.application.ResourceHandler;
import javax.faces.component.UIOutput;
import javax.faces.el.MethodBinding;
import org.ajax4jsf.resource.ResourceComponent2;
-import org.richfaces.application.ServiceTracker;
import org.richfaces.cdk.annotations.Attribute;
import org.richfaces.cdk.annotations.EventName;
import org.richfaces.cdk.annotations.JsfComponent;
@@ -41,7 +41,6 @@
import org.richfaces.cdk.annotations.Tag;
import org.richfaces.cdk.annotations.TagType;
import org.richfaces.resource.MediaOutputResource;
-import org.richfaces.resource.ResourceFactory;
/**
* @author shura
@@ -119,12 +118,8 @@
}
public Resource getResource() {
- ResourceFactory factory = ServiceTracker.getService(ResourceFactory.class);
-
- MediaOutputResource mediaOutputResource = new MediaOutputResource();
- mediaOutputResource.initialize(this);
-
- return factory.createResource(mediaOutputResource);
+ ResourceHandler resourceHandler = getFacesContext().getApplication().getResourceHandler();
+ return resourceHandler.createResource(MediaOutputResource.class.getName());
}
@Attribute
Modified: trunk/ui/core/ui/src/main/java/org/richfaces/resource/MediaOutputResource.java
===================================================================
--- trunk/ui/core/ui/src/main/java/org/richfaces/resource/MediaOutputResource.java 2010-12-15 13:04:17 UTC (rev 20578)
+++ trunk/ui/core/ui/src/main/java/org/richfaces/resource/MediaOutputResource.java 2010-12-15 13:32:31 UTC (rev 20579)
@@ -30,6 +30,7 @@
import javax.el.MethodExpression;
import javax.el.ValueExpression;
import javax.faces.component.StateHolder;
+import javax.faces.component.UIComponent;
import javax.faces.component.UIComponentBase;
import javax.faces.context.FacesContext;
@@ -98,7 +99,9 @@
*/
// TODO use ResourceComponent or exchange object as argument?
- public void initialize(AbstractMediaOutput uiMediaOutput) {
+ @PostConstructResource
+ public void initialize() {
+ AbstractMediaOutput uiMediaOutput = (AbstractMediaOutput) UIComponent.getCurrentComponent(FacesContext.getCurrentInstance());
this.setCacheable(uiMediaOutput.isCacheable());
this.setContentType(uiMediaOutput.getMimeType());
this.userData = uiMediaOutput.getValue();
14 years
JBoss Rich Faces SVN: r20578 - trunk/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces.
by richfaces-svn-commits@lists.jboss.org
Author: pyaschenko
Date: 2010-12-15 08:04:17 -0500 (Wed, 15 Dec 2010)
New Revision: 20578
Modified:
trunk/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/calendar.js
Log:
https://issues.jboss.org/browse/RF-9981
Modified: trunk/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/calendar.js
===================================================================
--- trunk/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/calendar.js 2010-12-15 13:03:51 UTC (rev 20577)
+++ trunk/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/calendar.js 2010-12-15 13:04:17 UTC (rev 20578)
@@ -19,11 +19,11 @@
getSelectedDateControl: function(calendar) {
- if (!calendar.selectedDate || calendar.params.showApplyButton) return "";
+ if (!calendar.selectedDate || calendar.options.showApplyButton) return "";
- var text = rf.calendarUtils.formatDate(calendar.selectedDate,(calendar.timeType ? calendar.datePattern : calendar.params.datePattern), calendar.params.monthLabels, calendar.params.monthLabelsShort);
+ var text = rf.calendarUtils.formatDate(calendar.selectedDate,(calendar.timeType ? calendar.datePattern : calendar.options.datePattern), calendar.options.monthLabels, calendar.options.monthLabelsShort);
var onclick = "RichFaces.$$('Calendar',this).showSelectedDate(); return true;"
- var markup = ( calendar.params.disabled ?
+ var markup = ( calendar.options.disabled ?
new E('div', {'class': 'rf-ca-tl-btn-dis'}, [new ET(text)]) :
new E('div', {'class': 'rf-ca-tl-btn', 'onclick': onclick}, [new ET(text)]) );
@@ -34,12 +34,12 @@
if (!calendar.selectedDate || !calendar.timeType) return "";
- var text = rf.calendarUtils.formatDate(calendar.selectedDate, calendar.timePattern, calendar.params.monthLabels, calendar.params.monthLabelsShort);
+ var text = rf.calendarUtils.formatDate(calendar.selectedDate, calendar.timePattern, calendar.options.monthLabels, calendar.options.monthLabelsShort);
var onmouseover = "jQuery(this).removeClass('rf-ca-tl-btn-press');";
var onmouseout = "jQuery(this).addClass('rf-ca-tl-btn-press');";
var onclick = "RichFaces.$$('Calendar',this).showTimeEditor();return true;";
- var markup = calendar.params.disabled || calendar.params.readonly ?
+ var markup = calendar.options.disabled || calendar.options.readonly ?
new E('div', {'class': 'rf-ca-tl-btn-btn-dis'}, [new ET(text)]) :
new E('div', {'class': 'rf-ca-tl-btn rf-ca-tl-btn-hov rf-ca-tl-btn-press', 'onclick': onclick,
'onmouseover': + onmouseover ,
@@ -50,35 +50,35 @@
toolButtonAttributes: {className: "rf-ca-tl-btn", onmouseover:"this.className='rf-ca-tl-btn rf-ca-tl-btn-hov'", onmouseout:"this.className='rf-ca-tl-btn'", onmousedown:"this.className='rf-ca-tl-btn rf-ca-tl-btn-hov rf-ca-tl-btn-btn-press'", onmouseup:"this.className='rf-ca-tl-btn rf-ca-tl-btn-hov'"},
nextYearControl: function (context) {
- return (!context.calendar.params.disabled ? CalendarView.getControl(">>", CalendarView.toolButtonAttributes, "nextYear") : "");
+ return (!context.calendar.options.disabled ? CalendarView.getControl(">>", CalendarView.toolButtonAttributes, "nextYear") : "");
},
previousYearControl: function (context) {
- return (!context.calendar.params.disabled ? CalendarView.getControl("<<", CalendarView.toolButtonAttributes, "prevYear") : "");
+ return (!context.calendar.options.disabled ? CalendarView.getControl("<<", CalendarView.toolButtonAttributes, "prevYear") : "");
},
nextMonthControl: function (context) {
- return (!context.calendar.params.disabled ? CalendarView.getControl(">", CalendarView.toolButtonAttributes, "nextMonth") : "");
+ return (!context.calendar.options.disabled ? CalendarView.getControl(">", CalendarView.toolButtonAttributes, "nextMonth") : "");
},
previousMonthControl: function (context) {
- return (!context.calendar.params.disabled ? CalendarView.getControl("<", CalendarView.toolButtonAttributes, "prevMonth") : "");
+ return (!context.calendar.options.disabled ? CalendarView.getControl("<", CalendarView.toolButtonAttributes, "prevMonth") : "");
},
currentMonthControl: function (context) {
var text = rf.calendarUtils.formatDate(context.calendar.getCurrentDate(), "MMMM, yyyy", context.monthLabels, context.monthLabelsShort);
- var markup = context.calendar.params.disabled ?
+ var markup = context.calendar.options.disabled ?
new E('div',{className: "rf-ca-tl-btn-dis"},[new T(text)]) :
CalendarView.getControl(text, CalendarView.toolButtonAttributes, "showDateEditor");
return markup;
},
todayControl: function (context) {
- return (!context.calendar.params.disabled && context.calendar.params.todayControlMode!='hidden' ? CalendarView.getControl(context.controlLabels.today, CalendarView.toolButtonAttributes, "today") : "");
+ return (!context.calendar.options.disabled && context.calendar.options.todayControlMode!='hidden' ? CalendarView.getControl(context.controlLabels.today, CalendarView.toolButtonAttributes, "today") : "");
},
closeControl: function (context) {
- return (context.calendar.params.popup ? CalendarView.getControl(context.controlLabels.close, CalendarView.toolButtonAttributes, "close", "false") : "");
+ return (context.calendar.options.popup ? CalendarView.getControl(context.controlLabels.close, CalendarView.toolButtonAttributes, "close", "false") : "");
},
applyControl: function (context) {
- return (!context.calendar.params.disabled && !context.calendar.params.readonly && context.calendar.params.showApplyButton ? CalendarView.getControl(context.controlLabels.apply, CalendarView.toolButtonAttributes, "close", "true") : "");
+ return (!context.calendar.options.disabled && !context.calendar.options.readonly && context.calendar.options.showApplyButton ? CalendarView.getControl(context.controlLabels.apply, CalendarView.toolButtonAttributes, "close", "true") : "");
},
cleanControl: function (context) {
- return (!context.calendar.params.disabled && !context.calendar.params.readonly && context.calendar.selectedDate ? CalendarView.getControl(context.controlLabels.clean, CalendarView.toolButtonAttributes, "resetSelectedDate") : "");
+ return (!context.calendar.options.disabled && !context.calendar.options.readonly && context.calendar.selectedDate ? CalendarView.getControl(context.controlLabels.clean, CalendarView.toolButtonAttributes, "resetSelectedDate") : "");
},
selectedDateControl: function (context) { return CalendarView.getSelectedDateControl(context.calendar);},
@@ -141,7 +141,7 @@
new ET(function (context) { return rf.calendarTemplates.evalMacro("timeControl", context)})
]),
new E('td',{'class': 'rf-ca-tl-ftr', 'style': 'background-image:none;', 'width': '100%'}, []),
- new E('td',{'class': 'rf-ca-tl-ftr', 'style':function(context){return (this.isEmpty ? 'display:none;' : '')+(context.calendar.params.disabled || context.calendar.params.readonly || !context.calendar.params.showApplyButton ? 'background-image:none;' : '');}},
+ new E('td',{'class': 'rf-ca-tl-ftr', 'style':function(context){return (this.isEmpty ? 'display:none;' : '')+(context.calendar.options.disabled || context.calendar.options.readonly || !context.calendar.options.showApplyButton ? 'background-image:none;' : '');}},
[
new ET(function (context) { return rf.calendarTemplates.evalMacro("todayControl", context)})
]),
@@ -204,11 +204,11 @@
// calendar context
var CalendarContext = function(calendar) {
this.calendar=calendar;
- this.monthLabels=calendar.params.monthLabels;
- this.monthLabelsShort=calendar.params.monthLabelsShort;
- this.weekDayLabels=calendar.params.weekDayLabels;
- this.weekDayLabelsShort=calendar.params.weekDayLabelsShort;
- this.controlLabels=calendar.params.labels;
+ this.monthLabels=calendar.options.monthLabels;
+ this.monthLabelsShort=calendar.options.monthLabelsShort;
+ this.weekDayLabels=calendar.options.weekDayLabels;
+ this.weekDayLabelsShort=calendar.options.weekDayLabelsShort;
+ this.controlLabels=calendar.options.labels;
};
$.extend(CalendarContext.prototype, {
@@ -333,37 +333,37 @@
//create parameters
//this.options = $.extend(this.options, defaultOptions, options);
- this.params = $.extend({}, defaultOptions, locales[locale], options, markups);
+ this.options = $.extend(this.options, defaultOptions, locales[locale], options, markups);
// labels
var value = options.labels || {};
for (var name in defaultLabels) {
if (!value[name]) value[name] = defaultLabels[name];
}
- this.params.labels = value;
+ this.options.labels = value;
- this.popupOffset = [this.params.horizontalOffset, this.params.verticalOffset];
+ this.popupOffset = [this.options.horizontalOffset, this.options.verticalOffset];
//
- if (!this.params.popup) this.params.showApplyButton = false;
+ if (!this.options.popup) this.options.showApplyButton = false;
//
- this.params.boundaryDatesMode = this.params.boundaryDatesMode.toLowerCase();
- this.params.todayControlMode = this.params.todayControlMode.toLowerCase();
+ this.options.boundaryDatesMode = this.options.boundaryDatesMode.toLowerCase();
+ this.options.todayControlMode = this.options.todayControlMode.toLowerCase();
// time
this.setTimeProperties();
- this.customDayListMarkup = (this.params.dayListMarkup!=CalendarView.dayList);
+ this.customDayListMarkup = (this.options.dayListMarkup!=CalendarView.dayList);
- this.currentDate = this.params.currentDate ? this.params.currentDate : (this.params.selectedDate ? this.params.selectedDate : new Date());
+ this.currentDate = this.options.currentDate ? this.options.currentDate : (this.options.selectedDate ? this.options.selectedDate : new Date());
this.currentDate.setDate(1);
- this.selectedDate = this.params.selectedDate;
+ this.selectedDate = this.options.selectedDate;
this.todayDate = new Date();
- this.firstWeekendDayNumber = 6-this.params.firstWeekDay;
- this.secondWeekendDayNumber = (this.params.firstWeekDay>0 ? 7-this.params.firstWeekDay : 0);
+ this.firstWeekendDayNumber = 6-this.options.firstWeekDay;
+ this.secondWeekendDayNumber = (this.options.firstWeekDay>0 ? 7-this.options.firstWeekDay : 0);
this.calendarContext = new CalendarContext(this);
@@ -400,7 +400,7 @@
var popupStyles = "";
this.isVisible = true;
- if (this.params.popup==true)
+ if (this.options.popup==true)
{
// popup mode initialisation
popupStyles = "display:none; position:absolute;"
@@ -409,12 +409,12 @@
var tempStr = "RichFaces.$('"+this.id+"').";
- var htmlTextHeader = '<table id="'+this.CALENDAR_CONTENT+'" border="0" cellpadding="0" cellspacing="0" class="rf-ca-extr rf-ca-popup '+this.params.styleClass+'" style="'+popupStyles+this.params.style+'" onclick="'+tempStr+'skipEventOnCollapse=true;"><tbody>';
- var colspan = (this.params.showWeeksBar ? "8" : "7");
- var htmlHeaderOptional = (this.params.optionalHeaderMarkup) ? '<tr><td class="rf-ca-hdr-optnl" colspan="'+colspan+'" id="'+this.id+'HeaderOptional"></td></tr>' : '';
- var htmlFooterOptional = (this.params.optionalFooterMarkup) ? '<tr><td class="rf-ca-ftr-optl" colspan="'+colspan+'" id="'+this.id+'FooterOptional"></td></tr>' : '';
- var htmlControlsHeader = (this.params.showHeader ? '<tr><td class="rf-ca-hdr" colspan="'+colspan+'" id="'+this.id+'Header"></td></tr>' : '');
- var htmlControlsFooter = (this.params.showFooter ? '<tr><td class="rf-ca-ftr" colspan="'+colspan+'" id="'+this.id+'Footer"></td></tr>' : '');
+ var htmlTextHeader = '<table id="'+this.CALENDAR_CONTENT+'" border="0" cellpadding="0" cellspacing="0" class="rf-ca-extr rf-ca-popup '+this.options.styleClass+'" style="'+popupStyles+this.options.style+'" onclick="'+tempStr+'skipEventOnCollapse=true;"><tbody>';
+ var colspan = (this.options.showWeeksBar ? "8" : "7");
+ var htmlHeaderOptional = (this.options.optionalHeaderMarkup) ? '<tr><td class="rf-ca-hdr-optnl" colspan="'+colspan+'" id="'+this.id+'HeaderOptional"></td></tr>' : '';
+ var htmlFooterOptional = (this.options.optionalFooterMarkup) ? '<tr><td class="rf-ca-ftr-optl" colspan="'+colspan+'" id="'+this.id+'FooterOptional"></td></tr>' : '';
+ var htmlControlsHeader = (this.options.showHeader ? '<tr><td class="rf-ca-hdr" colspan="'+colspan+'" id="'+this.id+'Header"></td></tr>' : '');
+ var htmlControlsFooter = (this.options.showFooter ? '<tr><td class="rf-ca-ftr" colspan="'+colspan+'" id="'+this.id+'Footer"></td></tr>' : '');
var htmlTextFooter = '</tbody></table>'
// days bar creation
@@ -423,16 +423,16 @@
var htmlTextWeekDayBar=[];
var context;
- var eventsStr = this.params.disabled || this.params.readonly ? '' : 'onclick="'+tempStr+'eventCellOnClick(event, this);" onmouseover="'+tempStr+'eventCellOnMouseOver(event, this);" onmouseout="'+tempStr+'eventCellOnMouseOut(event, this);"';
- if (this.params.showWeekDaysBar)
+ var eventsStr = this.options.disabled || this.options.readonly ? '' : 'onclick="'+tempStr+'eventCellOnClick(event, this);" onmouseover="'+tempStr+'eventCellOnMouseOver(event, this);" onmouseout="'+tempStr+'eventCellOnMouseOut(event, this);"';
+ if (this.options.showWeekDaysBar)
{
htmlTextWeekDayBar.push('<tr id="'+this.WEEKDAY_BAR_ID+'">');
- if (this.params.showWeeksBar) htmlTextWeekDayBar.push('<td class="rf-ca-days"><br/></td>');
- var weekDayCounter = this.params.firstWeekDay;
+ if (this.options.showWeeksBar) htmlTextWeekDayBar.push('<td class="rf-ca-days"><br/></td>');
+ var weekDayCounter = this.options.firstWeekDay;
for (var i=0;i<7;i++)
{
- context = {weekDayLabel: this.params.weekDayLabels[weekDayCounter], weekDayLabelShort: this.params.weekDayLabelsShort[weekDayCounter], weekDayNumber:weekDayCounter, isWeekend:this.isWeekend(i), elementId:this.WEEKDAY_ELEMENT_ID+i, component:this};
- var weekDayHtml = this.evaluateMarkup(this.params.weekDayMarkup, context );
+ context = {weekDayLabel: this.options.weekDayLabels[weekDayCounter], weekDayLabelShort: this.options.weekDayLabelsShort[weekDayCounter], weekDayNumber:weekDayCounter, isWeekend:this.isWeekend(i), elementId:this.WEEKDAY_ELEMENT_ID+i, component:this};
+ var weekDayHtml = this.evaluateMarkup(this.options.weekDayMarkup, context );
if (weekDayCounter==6) weekDayCounter=0; else weekDayCounter++;
styleClass = "rf-ca-days";
@@ -455,24 +455,24 @@
{
bottomStyleClass = (k==6 ? "rf-btm-c " : "");
htmlTextWeek.push('<tr id="'+this.WEEKNUMBER_BAR_ID+k+'">');
- if (this.params.showWeeksBar)
+ if (this.options.showWeeksBar)
{
context = {weekNumber: k, elementId:this.WEEKNUMBER_ELEMENT_ID+k, component:this};
- var weekNumberHtml = this.evaluateMarkup(this.params.weekNumberMarkup, context );
+ var weekNumberHtml = this.evaluateMarkup(this.options.weekNumberMarkup, context );
htmlTextWeek.push('<td class="rf-ca-week '+bottomStyleClass+'" id="'+context.elementId+'">'+weekNumberHtml+'</td>');
}
// day cells creation
for (var i=0;i<7;i++)
{
- styleClass = bottomStyleClass+(!this.params.dayCellClass ? "rf-ca-c-size" : (!this.customDayListMarkup ? this.params.dayCellClass : ""))+" rf-ca-c";
+ styleClass = bottomStyleClass+(!this.options.dayCellClass ? "rf-ca-c-size" : (!this.customDayListMarkup ? this.options.dayCellClass : ""))+" rf-ca-c";
if (i==this.firstWeekendDayNumber || i==this.secondWeekendDayNumber) styleClass+=" rf-ca-holly";
if (i==6) styleClass+=" rf-rgh-c";
this.dayCellClassName.push(styleClass);
htmlTextWeek.push('<td class="'+styleClass+'" id="'+this.DATE_ELEMENT_ID+p+'" '+
eventsStr+
- '>'+(this.customDayListMarkup ? '<div class="rf-ca-c-div'+(this.params.dayCellClass ? ' '+this.params.dayCellClass : '')+'"></div>' : '')+'</td>');
+ '>'+(this.customDayListMarkup ? '<div class="rf-ca-c-div'+(this.options.dayCellClass ? ' '+this.options.dayCellClass : '')+'"></div>' : '')+'</td>');
p++;
}
htmlTextWeek.push('</tr>');
@@ -486,11 +486,11 @@
div = null;
// add onclick event handlers to input field and popup button
- if (this.params.popup && !this.params.disabled)
+ if (this.options.popup && !this.options.disabled)
{
var handler = new Function ('event', "RichFaces.$('"+this.id+"').doSwitch();");
rf.Event.bindById(this.POPUP_BUTTON_ID, "click"+this.namespace, handler, this);
- if (!this.params.enableManualInput)
+ if (!this.options.enableManualInput)
{
rf.Event.bindById(this.INPUT_DATE_ID, "click"+this.namespace, handler, this);
}
@@ -501,13 +501,15 @@
//alert(new Date().getTime()-_d.getTime());
//define isAjaxMode variable
- "ajax" == this.params.mode ? this.isAjaxMode = true : this.isAjaxMode = false;
+ "ajax" == this.options.mode ? this.isAjaxMode = true : this.isAjaxMode = false;
+ /*
//events handler binding
for (var i in eventHandlerNames) {
- var handler = this.params["on"+eventHandlerNames[i]];
+ var handler = this.options["on"+eventHandlerNames[i]];
if (handler) rf.Event.bindById(this.id, eventHandlerNames[i], handler, this);
- }
+ }
+ */
};
// Extend component class and add protected methods from parent class to our container
@@ -532,7 +534,7 @@
name: "Calendar",
destroy: function()
{
- if (this.params.popup && this.isVisible)
+ if (this.options.popup && this.isVisible)
{
this.scrollElements && rf.Event.unbindScrollEventHandlers(this.scrollElements, this);
this.scrollElements = null;
@@ -723,16 +725,16 @@
var month = 0;
this.dateEditorYear = this.getCurrentYear();
var year = this.dateEditorStartYear = this.dateEditorYear-4;
- var htmlContent = '<td align="center">'+this.createDECell(this.DATE_EDITOR_LAYOUT_ID+'M'+month, this.params.monthLabelsShort[month], 1, month)+'</td>'
- +'<td align="center" class="rf-ca-date-layout-split">'+this.createDECell(this.DATE_EDITOR_LAYOUT_ID+'M'+(month+6), this.params.monthLabelsShort[month+6], 1, month+6)+'</td>'
+ var htmlContent = '<td align="center">'+this.createDECell(this.DATE_EDITOR_LAYOUT_ID+'M'+month, this.options.monthLabelsShort[month], 1, month)+'</td>'
+ +'<td align="center" class="rf-ca-date-layout-split">'+this.createDECell(this.DATE_EDITOR_LAYOUT_ID+'M'+(month+6), this.options.monthLabelsShort[month+6], 1, month+6)+'</td>'
+'<td align="center">'+this.createDECell('','<', 0, -1)+'</td>'
+'<td align="center">'+this.createDECell('','>', 0, 1)+'</td>';
month++;
for (var i=0;i<5;i++)
{
- htmlContent+='</tr><tr><td align="center">'+this.createDECell(this.DATE_EDITOR_LAYOUT_ID+'M'+month, this.params.monthLabelsShort[month], 1, month)+'</td>'
- +'<td align="center" class="rf-ca-date-layout-split">'+this.createDECell(this.DATE_EDITOR_LAYOUT_ID+'M'+(month+6), this.params.monthLabelsShort[month+6], 1, month+6)+'</td>'
+ htmlContent+='</tr><tr><td align="center">'+this.createDECell(this.DATE_EDITOR_LAYOUT_ID+'M'+month, this.options.monthLabelsShort[month], 1, month)+'</td>'
+ +'<td align="center" class="rf-ca-date-layout-split">'+this.createDECell(this.DATE_EDITOR_LAYOUT_ID+'M'+(month+6), this.options.monthLabelsShort[month+6], 1, month+6)+'</td>'
+'<td align="center">'+this.createDECell(this.DATE_EDITOR_LAYOUT_ID+'Y'+i, year, 2, i, (i==4 ? 'rf-ca-edtr-btn-sel' : ''))+'</td>'
+'<td align="center">'+this.createDECell(this.DATE_EDITOR_LAYOUT_ID+'Y'+(i+5), year+5, 2, i+5)+'</td>';
month++;
@@ -743,9 +745,9 @@
this.dateEditorMonthID = this.DATE_EDITOR_LAYOUT_ID+'M'+this.dateEditorMonth;
htmlContent+='</tr><tr><td colspan="2" class="rf-ca-date-layout-ok">'+
- '<div id="'+this.DATE_EDITOR_BUTTON_OK+'" class="rf-ca-time-btn" style="float:right;" onmousedown="jQuery(this).addClass(\'rf-ca-time-btn-press\');" onmouseout="$(this).removeClass(\'rf-ca-time-btn-press\');" onmouseup="$(this).removeClass(\'rf-ca-time-btn-press\');" onclick="RichFaces.$(\''+this.id+'\').hideDateEditor(true);"><span>'+this.params.labels.ok+'</span></div>'+
+ '<div id="'+this.DATE_EDITOR_BUTTON_OK+'" class="rf-ca-time-btn" style="float:right;" onmousedown="jQuery(this).addClass(\'rf-ca-time-btn-press\');" onmouseout="$(this).removeClass(\'rf-ca-time-btn-press\');" onmouseup="$(this).removeClass(\'rf-ca-time-btn-press\');" onclick="RichFaces.$(\''+this.id+'\').hideDateEditor(true);"><span>'+this.options.labels.ok+'</span></div>'+
'</td><td colspan="2" class="rf-ca-date-layout-cancel">'+
- '<div id="'+this.DATE_EDITOR_BUTTON_CANCEL+'" class="rf-ca-time-btn" style="float:left;" onmousedown="jQuery(this).addClass(\'rf-ca-time-btn-press\');" onmouseout="$(this).removeClass(\'rf-ca-time-btn-press\');" onmouseup="$(this).removeClass(\'rf-ca-time-btn-press\');" onclick="RichFaces.$(\''+this.id+'\').hideDateEditor(false);"><span>'+this.params.labels.cancel+'</span></div>'+
+ '<div id="'+this.DATE_EDITOR_BUTTON_CANCEL+'" class="rf-ca-time-btn" style="float:left;" onmousedown="jQuery(this).addClass(\'rf-ca-time-btn-press\');" onmouseout="$(this).removeClass(\'rf-ca-time-btn-press\');" onmouseup="$(this).removeClass(\'rf-ca-time-btn-press\');" onclick="RichFaces.$(\''+this.id+'\').hideDateEditor(false);"><span>'+this.options.labels.cancel+'</span></div>'+
'</td>';
@@ -785,7 +787,7 @@
setTimeProperties: function() {
this.timeType = 0;
- var dateTimePattern = this.params.datePattern;
+ var dateTimePattern = this.options.datePattern;
var pattern = [];
var re = /(\\\\|\\[yMdaHhms])|(y+|M+|d+|a|H{1,2}|h{1,2}|m{2}|s{2})/g;
var r;
@@ -877,7 +879,7 @@
doCollapse: function() {
- if (!this.params.popup || !this.isVisible) return;
+ if (!this.options.popup || !this.isVisible) return;
if (this.invokeEvent("hide", rf.getDomElement(this.id)))
{
@@ -903,7 +905,7 @@
}
this.skipEventOnCollapse = false;
if (e && e.type=='click') this.skipEventOnCollapse = true;
- if (!this.params.popup || this.isVisible) return;
+ if (!this.options.popup || this.isVisible) return;
var element = rf.getDomElement(this.id);
@@ -920,14 +922,14 @@
//rect calculation
- if (this.params.showInput)
+ if (this.options.showInput)
{
base = base.children;
} else {
base = baseButton;
};
- $(rf.getDomElement(this.CALENDAR_CONTENT)).setPosition(base, {type:"DROPDOWN", from: this.params.jointPoint, to:this.params.direction, offset: this.popupOffset}).show();
+ $(rf.getDomElement(this.CALENDAR_CONTENT)).setPosition(base, {type:"DROPDOWN", from: this.options.jointPoint, to:this.options.direction, offset: this.popupOffset}).show();
this.isVisible = true;
@@ -935,7 +937,7 @@
this.scrollElements && rf.Event.unbindScrollEventHandlers(this.scrollElements, this);
this.scrollElements = null;
- if (this.params.hidePopupOnScroll) {
+ if (this.options.hidePopupOnScroll) {
this.scrollElements = rf.Event.bindScrollEventHandlers(element, this.eventOnScroll, this);
}
}
@@ -960,7 +962,7 @@
return true;
}
- if (e.target.id == this.POPUP_BUTTON_ID || (!this.params.enableManualInput && e.target.id == this.INPUT_DATE_ID) ) return true;
+ if (e.target.id == this.POPUP_BUTTON_ID || (!this.options.enableManualInput && e.target.id == this.INPUT_DATE_ID) ) return true;
this.doCollapse();
@@ -985,8 +987,8 @@
},
getSelectedDateString: function(pattern) {
if (!this.selectedDate) return "";
- if (!pattern) pattern = this.params.datePattern;
- return rf.calendarUtils.formatDate(this.selectedDate, pattern, this.params.monthLabels, this.params.monthLabelsShort);
+ if (!pattern) pattern = this.options.datePattern;
+ return rf.calendarUtils.formatDate(this.selectedDate, pattern, this.options.monthLabels, this.options.monthLabelsShort);
},
getPrevYear: function() {
@@ -999,7 +1001,7 @@
if (value < 0 ) value = 11;
if (asMonthLabel)
{
- return this.params.monthLabels[value];
+ return this.options.monthLabels[value];
} else return value;
},
getCurrentYear: function() {
@@ -1009,7 +1011,7 @@
var value = this.currentDate.getMonth();
if (asMonthLabel)
{
- return this.params.monthLabels[value];
+ return this.options.monthLabels[value];
} else return value;
},
getNextYear: function() {
@@ -1020,7 +1022,7 @@
if (value > 11 ) value = 0;
if (asMonthLabel)
{
- return this.params.monthLabels[value];
+ return this.options.monthLabels[value];
} else return value;
},
@@ -1029,7 +1031,7 @@
},
setupTimeForDate: function (date) {
- if (this.selectedDate && (!this.params.resetTimeOnDateSelect ||
+ if (this.selectedDate && (!this.options.resetTimeOnDateSelect ||
(this.selectedDate.getFullYear() == date.getFullYear() &&
this.selectedDate.getMonth() == date.getMonth() &&
this.selectedDate.getDate() == date.getDate())))
@@ -1039,9 +1041,9 @@
date.setSeconds(this.selectedDate.getSeconds());
} else
{
- date.setHours(this.params.defaultTime.hours);
- date.setMinutes(this.params.defaultTime.minutes);
- date.setSeconds(this.params.defaultTime.seconds);
+ date.setHours(this.options.defaultTime.hours);
+ date.setMinutes(this.options.defaultTime.minutes);
+ date.setSeconds(this.options.defaultTime.seconds);
}
},
@@ -1056,15 +1058,15 @@
this.setupTimeForDate(date);
}
- if (this.selectDate(date,true, {event:e, element:obj}) && !this.params.showApplyButton)
+ if (this.selectDate(date,true, {event:e, element:obj}) && !this.options.showApplyButton)
{
this.doCollapse();
}
} else if (daydata._month!=0){
- if (this.params.boundaryDatesMode == "scroll")
+ if (this.options.boundaryDatesMode == "scroll")
if (daydata._month==-1) this.prevMonth(); else this.nextMonth();
- else if (this.params.boundaryDatesMode == "select")
+ else if (this.options.boundaryDatesMode == "select")
{
var date = new Date(daydata.date);
if (this.timeType)
@@ -1072,7 +1074,7 @@
this.setupTimeForDate(date);
}
- if (this.selectDate(date, false, {event:e, element:obj}) && !this.params.showApplyButton)
+ if (this.selectDate(date, false, {event:e, element:obj}) && !this.options.showApplyButton)
{
this.doCollapse();
}
@@ -1187,7 +1189,7 @@
var selectedflag = this.selectedDate && (currentYear == this.selectedDate.getFullYear() && currentMonth == this.selectedDate.getMonth())
var selecteddate = this.selectedDate && this.selectedDate.getDate();
- var wd = rf.calendarUtils.getDay(this.currentDate, this.params.firstWeekDay);
+ var wd = rf.calendarUtils.getDay(this.currentDate, this.options.firstWeekDay);
var currentMonthDays = rf.calendarUtils.daysInMonthByDate(this.currentDate);
var previousMonthDays = rf.calendarUtils.daysInMonth(currentYear, currentMonth-1);
@@ -1255,13 +1257,13 @@
var element;
var dataobj;
var wn;
- if (this.params.showWeeksBar) wn = rf.calendarUtils.weekNumber(currentYear, currentMonth, this.params.minDaysInFirstWeek, this.params.firstWeekDay); /// fix it
+ if (this.options.showWeeksBar) wn = rf.calendarUtils.weekNumber(currentYear, currentMonth, this.options.minDaysInFirstWeek, this.options.firstWeekDay); /// fix it
this.selectedDayElement=null;
var weekflag=true;
var e;
- var boundaryDatesModeFlag = (this.params.boundaryDatesMode == "scroll" || this.params.boundaryDatesMode == "select");
+ var boundaryDatesModeFlag = (this.options.boundaryDatesMode == "scroll" || this.options.boundaryDatesMode == "select");
this.todayCellId = this.clearEffect(this.todayCellId);
this.selectedDateCellId = this.clearEffect(this.selectedDateCellId);
@@ -1277,23 +1279,23 @@
var weeknumber;
// week number update
- if (this.params.showWeeksBar)
+ if (this.options.showWeeksBar)
{
// TODO: fix: there is no weekNumber in dataobj if showWeeksBar == false;
if (weekflag && currentMonth==11 &&
(k==5||k==6) &&
- (dataobj._month==1 || (7 - (currentMonthDays - dataobj.day + 1)) >= this.params.minDaysInFirstWeek) )
+ (dataobj._month==1 || (7 - (currentMonthDays - dataobj.day + 1)) >= this.options.minDaysInFirstWeek) )
{
wn=1;
weekflag=false;
}
weeknumber = wn;
- element.innerHTML = this.evaluateMarkup(this.params.weekNumberMarkup, {weekNumber: wn++, elementId:element.id, component:this} );
+ element.innerHTML = this.evaluateMarkup(this.options.weekNumberMarkup, {weekNumber: wn++, elementId:element.id, component:this} );
if (k==1&&wn>52) wn=1;
element = element.nextSibling;
}
- var weekdaycounter = this.params.firstWeekDay;
+ var weekdaycounter = this.options.firstWeekDay;
var contentElement = null;
while (element)
@@ -1306,18 +1308,18 @@
dataobj.weekDayNumber = weekdaycounter;
// call user function to get day state
- if (dataobj.enabled != false) dataobj.enabled = this.params.isDayEnabled(dataobj);
+ if (dataobj.enabled != false) dataobj.enabled = this.options.isDayEnabled(dataobj);
// call user function to custom class style
- if (!dataobj.styleClass) dataobj.customStyleClass = this.params.dayStyleClass(dataobj);
+ if (!dataobj.styleClass) dataobj.customStyleClass = this.options.dayStyleClass(dataobj);
else
{
- var styleclass = this.params.dayStyleClass(dataobj);
+ var styleclass = this.options.dayStyleClass(dataobj);
dataobj.customStyleClass = dataobj.styleClass;
if (styleclass) dataobj.customStyleClass += " " + styleclass;
}
contentElement = (this.customDayListMarkup ? element.firstChild : element);
- contentElement.innerHTML = this.evaluateMarkup(this.params.dayListMarkup, dataobj );
+ contentElement.innerHTML = this.evaluateMarkup(this.options.dayListMarkup, dataobj );
if (weekdaycounter==6) weekdaycounter=0; else weekdaycounter++;
@@ -1327,7 +1329,7 @@
if (dataobj._month!=0)
{
classNames+=' rf-ca-boundary-dates';
- if (!this.params.disabled && !this.params.readonly && boundaryDatesModeFlag)
+ if (!this.options.disabled && !this.options.readonly && boundaryDatesModeFlag)
{
classNames+=' rf-ca-btn';
}
@@ -1347,7 +1349,7 @@
this.selectedDateCellColor = this.getCellBackgroundColor(element);
classNames+=" rf-ca-sel";
}
- else if (!this.params.disabled && !this.params.readonly && dataobj.enabled) classNames+=' rf-ca-btn';
+ else if (!this.options.disabled && !this.options.readonly && dataobj.enabled) classNames+=' rf-ca-btn';
// add custom style class
if (dataobj.customStyleClass)
@@ -1371,8 +1373,8 @@
renderHF: function()
{
- if (this.params.showHeader) this.renderMarkup(this.params.headerMarkup, this.id+"Header", this.calendarContext);
- if (this.params.showFooter) this.renderMarkup(this.params.footerMarkup, this.id+"Footer", this.calendarContext);
+ if (this.options.showHeader) this.renderMarkup(this.options.headerMarkup, this.id+"Header", this.calendarContext);
+ if (this.options.showFooter) this.renderMarkup(this.options.footerMarkup, this.id+"Footer", this.calendarContext);
this.renderHeaderOptional();
this.renderFooterOptional();
@@ -1380,12 +1382,12 @@
renderHeaderOptional: function()
{
- this.renderMarkup(this.params.optionalHeaderMarkup, this.id+"HeaderOptional", this.calendarContext);
+ this.renderMarkup(this.options.optionalHeaderMarkup, this.id+"HeaderOptional", this.calendarContext);
},
renderFooterOptional: function()
{
- this.renderMarkup(this.params.optionalFooterMarkup, this.id+"FooterOptional", this.calendarContext);
+ this.renderMarkup(this.options.optionalFooterMarkup, this.id+"FooterOptional", this.calendarContext);
},
renderMarkup: function (markup, elementId, context)
@@ -1510,7 +1512,7 @@
this.currentDate = new Date(nowyear, nowmonth, 1);
}
- if (this.params.todayControlMode=='select')
+ if (this.options.todayControlMode=='select')
{
noHighlight=true;
}
@@ -1534,7 +1536,7 @@
}
// todayControl select mode
- if (this.params.todayControlMode=='select' && !this.params.disabled && !this.params.readonly)
+ if (this.options.todayControlMode=='select' && !this.options.disabled && !this.options.readonly)
if (updateflag && !noUpdate && this.submitFunction)
{
this.afterLoad = this.selectToday;
@@ -1554,7 +1556,7 @@
{
this.setupTimeForDate(date);
}
- if (daydata.enabled && this.selectDate(date,true) && !this.params.showApplyButton)
+ if (daydata.enabled && this.selectDate(date,true) && !this.options.showApplyButton)
{
this.doCollapse();
}
@@ -1574,7 +1576,7 @@
{
if (typeof date=='string')
{
- date = rf.calendarUtils.parseDate(date,this.params.datePattern, this.params.monthLabels, this.params.monthLabelsShort);
+ date = rf.calendarUtils.parseDate(date,this.options.datePattern, this.options.monthLabels, this.options.monthLabelsShort);
}
newSelectedDate = date;
}
@@ -1604,7 +1606,7 @@
// find cell and change style class
var e = $(rf.getDomElement(this.DATE_ELEMENT_ID+(this.firstDateIndex + this.selectedDate.getDate()-1)));
- this.clearEffect(this.selectedDateCellId, "rf-ca-sel", (this.params.disabled || this.params.readonly ? null : "rf-ca-btn"));
+ this.clearEffect(this.selectedDateCellId, "rf-ca-sel", (this.options.disabled || this.options.readonly ? null : "rf-ca-btn"));
this.selectedDateCellId = e.attr('id');
this.selectedDateCellColor = this.getCellBackgroundColor(e);
@@ -1635,7 +1637,7 @@
{
this.selectedDate = null;
- this.clearEffect(this.selectedDateCellId, "rf-ca-sel", (this.params.disabled || this.params.readonly ? null : "rf-ca-btn"));
+ this.clearEffect(this.selectedDateCellId, "rf-ca-sel", (this.options.disabled || this.options.readonly ? null : "rf-ca-btn"));
if (this.selectedDateCellId)
{
@@ -1649,19 +1651,19 @@
this.renderHF();
}
- var todayControlMode = this.params.todayControlMode;
- this.params.todayControlMode = '';
+ var todayControlMode = this.options.todayControlMode;
+ this.options.todayControlMode = '';
this.today(noUpdate, true);
- this.params.todayControlMode = todayControlMode;
+ this.options.todayControlMode = todayControlMode;
}
// call user event
if (isDateChange)
{
this.invokeEvent("dateselect", eventData.element, eventData.event, this.selectedDate);
- if (!this.params.showApplyButton)
+ if (!this.options.showApplyButton)
{
- this.setInputField(this.selectedDate!=null ? this.getSelectedDateString(this.params.datePattern) : "", eventData.event);
+ this.setInputField(this.selectedDate!=null ? this.getSelectedDateString(this.options.datePattern) : "", eventData.event);
}
}
}
@@ -1677,10 +1679,10 @@
this.selectedDate = null;
this.invokeEvent("dateselect", null, null, null);
- this.selectedDateCellId = this.clearEffect(this.selectedDateCellId, "rf-ca-sel", (this.params.disabled || this.params.readonly ? null : "rf-ca-btn"));
+ this.selectedDateCellId = this.clearEffect(this.selectedDateCellId, "rf-ca-sel", (this.options.disabled || this.options.readonly ? null : "rf-ca-btn"));
this.invokeEvent("clean", null, null, null);
this.renderHF();
- if (!this.params.showApplyButton)
+ if (!this.options.showApplyButton)
{
this.setInputField("", null);
this.doCollapse();
@@ -1716,7 +1718,7 @@
{
if (updateDate)
{
- this.setInputField(this.getSelectedDateString(this.params.datePattern), null);
+ this.setInputField(this.getSelectedDateString(this.options.datePattern), null);
}
this.doCollapse();
},
@@ -1777,7 +1779,7 @@
this.hideEditor();
if (updateTime && this.selectedDate)
{
- var s = this.showSeconds ? parseInt(rf.getDomElement(this.id+'TimeSeconds').value,10) : this.params.defaultTime.seconds;
+ var s = this.showSeconds ? parseInt(rf.getDomElement(this.id+'TimeSeconds').value,10) : this.options.defaultTime.seconds;
var m = parseInt(rf.getDomElement(this.id+'TimeMinutes').value,10);
var h = parseInt(rf.getDomElement(this.id+'TimeHours').value,10);
if (this.timeType==2)
@@ -1796,11 +1798,11 @@
{
this.selectedDate = date;
this.renderHF();
- if (!this.params.popup || !this.params.showApplyButton) this.setInputField(this.getSelectedDateString(this.params.datePattern), null);
+ if (!this.options.popup || !this.options.showApplyButton) this.setInputField(this.getSelectedDateString(this.options.datePattern), null);
this.invokeEvent("timeselect",null, null, this.selectedDate);
}
}
- if (this.params.popup && !this.params.showApplyButton) this.close(false);
+ if (this.options.popup && !this.options.showApplyButton) this.close(false);
},
showDateEditor: function()
14 years