JBoss Rich Faces SVN: r20547 - in trunk: ui/output/ui/src/main/java/org/richfaces/component and 1 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: Alex.Kolonitsky
Date: 2010-12-14 04:31:06 -0500 (Tue, 14 Dec 2010)
New Revision: 20547
Modified:
trunk/examples/output-demo/src/main/webapp/examples/tabPanel.xhtml
trunk/ui/output/ui/src/main/java/org/richfaces/component/AbstractTogglePanel.java
trunk/ui/output/ui/src/main/resources/META-INF/pn.taglib.xml
Log:
RF-9926 Tab panel: attribute itemChangeListener ignored
Modified: trunk/examples/output-demo/src/main/webapp/examples/tabPanel.xhtml
===================================================================
--- trunk/examples/output-demo/src/main/webapp/examples/tabPanel.xhtml 2010-12-14 08:57:11 UTC (rev 20546)
+++ trunk/examples/output-demo/src/main/webapp/examples/tabPanel.xhtml 2010-12-14 09:31:06 UTC (rev 20547)
@@ -15,7 +15,7 @@
<p>Page</p>
<h:form id="f">
- <pn:tabPanel id="panel" switchType="ajax" tabHeaderClassDisabled="myClass_01">
+ <pn:tabPanel id="panel" switchType="ajax" tabHeaderClassDisabled="myClass_01" itemChangeListener="#{togglePanelBean.itemChangeActionListener}">
<pn:tab header="tab1 header" headerClassDisabled="myClass_02">
Content will be here. Content will be here. Content will be here. Content will be here. Content will be here. Content will be here. Content will be here. Content will be here. Content will be here. Content will be here. Content will be here. Content will be here. Content will be here. Content will be here.
</pn:tab>
Modified: trunk/ui/output/ui/src/main/java/org/richfaces/component/AbstractTogglePanel.java
===================================================================
--- trunk/ui/output/ui/src/main/java/org/richfaces/component/AbstractTogglePanel.java 2010-12-14 08:57:11 UTC (rev 20546)
+++ trunk/ui/output/ui/src/main/java/org/richfaces/component/AbstractTogglePanel.java 2010-12-14 09:31:06 UTC (rev 20547)
@@ -376,7 +376,7 @@
String previous = (String) getValue();
setValue(activeItem);
setSubmittedActiveItem(null);
- if (previous != null && !previous.equalsIgnoreCase(activeItem)) {
+ if (previous == null || !previous.equalsIgnoreCase(activeItem)) {
queueEvent(new ItemChangeEvent(this, previous, activeItem));
}
}
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-14 08:57:11 UTC (rev 20546)
+++ trunk/ui/output/ui/src/main/resources/META-INF/pn.taglib.xml 2010-12-14 09:31:06 UTC (rev 20547)
@@ -7,7 +7,7 @@
<component>
<component-type>org.richfaces.TabPanel</component-type>
<renderer-type>org.richfaces.TabPanel</renderer-type>
- <handler-class/>
+ <handler-class>org.richfaces.view.facelets.html.TogglePanelTagHandler</handler-class>
</component>
</tag>
<tag>
@@ -15,7 +15,6 @@
<component>
<component-type>org.richfaces.TabPanelItem</component-type>
<renderer-type>org.richfaces.Tab</renderer-type>
- <handler-class/>
</component>
</tag>
<tag>
14 years, 1 month
JBoss Rich Faces SVN: r20546 - in trunk: examples/output-demo/src/main/webapp/examples and 2 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: Alex.Kolonitsky
Date: 2010-12-14 03:57:11 -0500 (Tue, 14 Dec 2010)
New Revision: 20546
Modified:
trunk/examples/output-demo/src/main/java/org/richfaces/TogglePanelBean.java
trunk/examples/output-demo/src/main/webapp/examples/accordion.xhtml
trunk/examples/output-demo/src/main/webapp/examples/togglePanel.xhtml
trunk/ui/output/ui/src/main/java/org/richfaces/view/facelets/html/TogglePanelTagHandler.java
trunk/ui/output/ui/src/main/resources/META-INF/pn.taglib.xml
Log:
RF-9933 Accordion: attribute itemChangeListener ignored
Modified: trunk/examples/output-demo/src/main/java/org/richfaces/TogglePanelBean.java
===================================================================
--- trunk/examples/output-demo/src/main/java/org/richfaces/TogglePanelBean.java 2010-12-14 06:28:45 UTC (rev 20545)
+++ trunk/examples/output-demo/src/main/java/org/richfaces/TogglePanelBean.java 2010-12-14 08:57:11 UTC (rev 20546)
@@ -2,6 +2,7 @@
import java.io.Serializable;
+import org.richfaces.event.ItemChangeEvent;
import org.richfaces.log.LogFactory;
import org.richfaces.log.Logger;
@@ -39,4 +40,8 @@
public void itemChangeActionListener() {
LOGGER.info("TogglePanelBean.itemChangeActionListener");
}
+
+ public void itemChangeActionListener(ItemChangeEvent event) {
+ LOGGER.info("TogglePanelBean.itemChangeActionListener(event)");
+ }
}
Modified: trunk/examples/output-demo/src/main/webapp/examples/accordion.xhtml
===================================================================
--- trunk/examples/output-demo/src/main/webapp/examples/accordion.xhtml 2010-12-14 06:28:45 UTC (rev 20545)
+++ trunk/examples/output-demo/src/main/webapp/examples/accordion.xhtml 2010-12-14 08:57:11 UTC (rev 20546)
@@ -16,7 +16,7 @@
<h:form id="f" style="border:blue solid thin;">
<h:panelGroup>
- <pn:accordion width="500px" height="300px">
+ <pn:accordion width="500px" height="300px" itemChangeListener="#{togglePanelBean.itemChangeActionListener}">
<pn:accordionItem header="label 1">Content will be here. Content will be here. Content will be here. Content will be here. Content will be here. Content will be here. Content will be here. Content will be here. Content will be here. Content will be here. Content will be here. Content will be here. Content will be here. Content will be here. Content will be here. Content will be here. Content will be here. Content will be here. Content will be here. Content will be here. Content will be here. Content will be here. Content will be here. Content will be here. Content will be here. Content will be here. Content will be here. Content will be here. Content will be here. Content will be here. Content will be here. Content will be here. Content will be here. Content will be here.</pn:accordionItem>
<pn:accordionItem header="label 2">content 2</pn:accordionItem>
<pn:accordionItem header="label 3">content 3</pn:accordionItem>
Modified: trunk/examples/output-demo/src/main/webapp/examples/togglePanel.xhtml
===================================================================
--- trunk/examples/output-demo/src/main/webapp/examples/togglePanel.xhtml 2010-12-14 06:28:45 UTC (rev 20545)
+++ trunk/examples/output-demo/src/main/webapp/examples/togglePanel.xhtml 2010-12-14 08:57:11 UTC (rev 20546)
@@ -14,11 +14,11 @@
<ui:define name="body">
<h:form id="f">
- <pn:togglePanel id="my_id" lang="en" activeItem="name1">
- <pn:togglePanelItem name="name1" onenter="alert('enter 01')" onleave="alert('leave 01')">
+ <pn:togglePanel id="my_id" lang="en" activeItem="name1" itemChangeListener="#{togglePanelBean.itemChangeActionListener}">
+ <pn:togglePanelItem name="name1">
hello name1
</pn:togglePanelItem>
- <pn:togglePanelItem name="name2" onenter="alert('enter 02')" onleave="alert('leave 02')">
+ <pn:togglePanelItem name="name2">
hello name2
</pn:togglePanelItem>
</pn:togglePanel>
Modified: trunk/ui/output/ui/src/main/java/org/richfaces/view/facelets/html/TogglePanelTagHandler.java
===================================================================
--- trunk/ui/output/ui/src/main/java/org/richfaces/view/facelets/html/TogglePanelTagHandler.java 2010-12-14 06:28:45 UTC (rev 20545)
+++ trunk/ui/output/ui/src/main/java/org/richfaces/view/facelets/html/TogglePanelTagHandler.java 2010-12-14 08:57:11 UTC (rev 20546)
@@ -22,19 +22,11 @@
package org.richfaces.view.facelets.html;
-import org.richfaces.component.AbstractTogglePanel;
-
-import org.richfaces.event.MethodExpressionItemChangeListener;
import org.richfaces.event.ItemChangeEvent;
+import org.richfaces.event.ItemChangeSource;
+import org.richfaces.event.MethodExpressionItemChangeListener;
-import javax.faces.view.facelets.ComponentConfig;
-import javax.faces.view.facelets.ComponentHandler;
-import javax.faces.view.facelets.FaceletContext;
-import javax.faces.view.facelets.MetaRule;
-import javax.faces.view.facelets.MetaRuleset;
-import javax.faces.view.facelets.Metadata;
-import javax.faces.view.facelets.MetadataTarget;
-import javax.faces.view.facelets.TagAttribute;
+import javax.faces.view.facelets.*;
/**
* @author akolonitsky
@@ -60,7 +52,7 @@
@Override
public Metadata applyRule(String name, TagAttribute attribute, MetadataTarget meta) {
- if (meta.isTargetInstanceOf(AbstractTogglePanel.class)) {
+ if (meta.isTargetInstanceOf(ItemChangeSource.class)) {
if ("itemChangeListener".equals(name)) {
return new ItemChangeExpressionMetadata(attribute);
}
@@ -81,8 +73,8 @@
@Override
public void applyMetadata(FaceletContext ctx, Object instance) {
- ((AbstractTogglePanel) instance).addItemChangeListener(new MethodExpressionItemChangeListener(
- this.attr.getMethodExpression(ctx, null, ITEM_CHANGE_SIG)));
+ ((ItemChangeSource) instance).addItemChangeListener(new MethodExpressionItemChangeListener(
+ this.attr.getMethodExpression(ctx, null, ITEM_CHANGE_SIG)));
}
}
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-14 06:28:45 UTC (rev 20545)
+++ trunk/ui/output/ui/src/main/resources/META-INF/pn.taglib.xml 2010-12-14 08:57:11 UTC (rev 20546)
@@ -873,35 +873,35 @@
</attribute>
</tag>
<tag>
- <description>
- Register a PanelToggleListener instance on the UIComponent
- associated with the closest parent UIComponent custom
- action.
+ <description>
+ Register a PanelToggleListener instance on the UIComponent
+ associated with the closest parent UIComponent custom
+ action.
</description>
<tag-name>panelToggleListener</tag-name>
<handler-class>org.richfaces.view.facelets.html.PanelToggleListenerHandler</handler-class>
<attribute>
- <description>
- Fully qualified Java class name of a
- PanelToggleListener to be created and registered.
+ <description>
+ Fully qualified Java class name of a
+ PanelToggleListener to be created and registered.
</description>
<name>type</name>
<type>java.lang.String</type>
</attribute>
<attribute>
- <description>
- Value binding expression that evaluates to an object that
- implements org.richfaces.event.PanelToggleListener.
+ <description>
+ Value binding expression that evaluates to an object that
+ implements org.richfaces.event.PanelToggleListener.
</description>
<name>binding</name>
<required>false</required>
<type>org.richfaces.event.PanelToggleListener</type>
</attribute>
<attribute>
- <description>
- <p class="changed_added_2_0">If present, this attribute refers
- to the value of one of the exposed attached objects within the
- composite component inside of which this tag is nested.</p>
+ <description>
+ <p class="changed_added_2_0">If present, this attribute refers
+ to the value of one of the exposed attached objects within the
+ composite component inside of which this tag is nested.</p>
</description>
<name>for</name>
<required>false</required>
@@ -1032,35 +1032,35 @@
</attribute>
</tag>
<tag>
- <description>
- Register a ItemChangeListener instance on the UIComponent
- associated with the closest parent UIComponent custom
- action.
+ <description>
+ Register a ItemChangeListener instance on the UIComponent
+ associated with the closest parent UIComponent custom
+ action.
</description>
<tag-name>itemChangeListener</tag-name>
<handler-class>org.richfaces.view.facelets.html.ItemChangeListenerHandler</handler-class>
<attribute>
- <description>
- Fully qualified Java class name of a
- ItemChangeListener to be created and registered.
+ <description>
+ Fully qualified Java class name of a
+ ItemChangeListener to be created and registered.
</description>
<name>type</name>
<type>java.lang.String</type>
</attribute>
<attribute>
- <description>
- Value binding expression that evaluates to an object that
- implements org.richfaces.event.ItemChangeListener.
+ <description>
+ Value binding expression that evaluates to an object that
+ implements org.richfaces.event.ItemChangeListener.
</description>
<name>binding</name>
<required>false</required>
<type>org.richfaces.event.ItemChangeListener</type>
</attribute>
<attribute>
- <description>
- <p class="changed_added_2_0">If present, this attribute refers
- to the value of one of the exposed attached objects within the
- composite component inside of which this tag is nested.</p>
+ <description>
+ <p class="changed_added_2_0">If present, this attribute refers
+ to the value of one of the exposed attached objects within the
+ composite component inside of which this tag is nested.</p>
</description>
<name>for</name>
<required>false</required>
@@ -1159,7 +1159,7 @@
<component>
<component-type>org.richfaces.Accordion</component-type>
<renderer-type>org.richfaces.Accordion</renderer-type>
- <handler-class/>
+ <handler-class>org.richfaces.view.facelets.html.TogglePanelTagHandler</handler-class>
</component>
<attribute>
<name>cycledSwitching</name>
14 years, 1 month
JBoss Rich Faces SVN: r20545 - in modules/docs/trunk/Component_Reference/src/main/docbook/en-US: extras and 1 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: SeanRogers
Date: 2010-12-14 01:28:45 -0500 (Tue, 14 Dec 2010)
New Revision: 20545
Added:
modules/docs/trunk/Component_Reference/src/main/docbook/en-US/extras/exam-Component_Reference-richtree-Identifying_nodes.js
modules/docs/trunk/Component_Reference/src/main/docbook/en-US/extras/exam-Component_Reference-richtree-Identifying_nodes.xml_sample
modules/docs/trunk/Component_Reference/src/main/docbook/en-US/extras/exam-Component_Reference-richtreeNode-rendered_attribute.xml_sample
modules/docs/trunk/Component_Reference/src/main/docbook/en-US/images/exam-Component_Reference-richtreeNode-rendered_attribute.png
Modified:
modules/docs/trunk/Component_Reference/src/main/docbook/en-US/chap-Component_Reference-Trees.xml
modules/docs/trunk/Component_Reference/src/main/docbook/en-US/extras/exam-Component_Reference-richtree-nodeFace_attribute_with_Expression_Language.xml_sample
Log:
Draft of rich:treeNode RF-9455
Modified: modules/docs/trunk/Component_Reference/src/main/docbook/en-US/chap-Component_Reference-Trees.xml
===================================================================
--- modules/docs/trunk/Component_Reference/src/main/docbook/en-US/chap-Component_Reference-Trees.xml 2010-12-13 23:54:02 UTC (rev 20544)
+++ modules/docs/trunk/Component_Reference/src/main/docbook/en-US/chap-Component_Reference-Trees.xml 2010-12-14 06:28:45 UTC (rev 20545)
@@ -50,7 +50,7 @@
The <sgmltag><rich:tree></sgmltag> component requires the <varname>value</varname> attribute to point to the data model for populating the tree. The data model must be either an <interfacename>org.richfaces.model.TreeNode</interfacename> interface, an <varname>org.richfaces.model.TreeDataModel</varname> interface, or a <interfacename>javax.swing.tree.TreeNode</interfacename> interface. The <varname>var</varname> attribute declares the variable used for iterating through the data model, so that child <sgmltag><rich:treeNode></sgmltag> components can reference each iteration.
</para>
<para>
- In addition to these attributes, the <sgmltag><rich:tree></sgmltag> component needs one or more <sgmltag><rich:treeNode></sgmltag> components to work with the data model.
+ For basic usage, the <sgmltag><rich:tree></sgmltag> component needs one or more <sgmltag><rich:treeNode></sgmltag> components to work with the data model.
</para>
<example id="exam-Component_Reference-richtree-Basic_usage">
<title>Basic usage</title>
@@ -127,7 +127,7 @@
</varlistentry>
</variablelist>
<para>
- Alternatively, use facets with the same names as the attributes to define the icons, as shown in <xref linkend="exam-Component_Reference-richtree-Icon_facets" />.
+ Alternatively, use facets with the same names as the attributes to define the icons, as shown in <xref linkend="exam-Component_Reference-richtree-Icon_facets" />. The width of the rendered facet is 16 pixels.
</para>
<example id="exam-Component_Reference-richtree-Icon_facets">
<title>Icon facets</title>
@@ -170,8 +170,47 @@
<section id="sect-Component_Reference-richtree-Identifying_nodes">
<title>Identifying nodes</title>
<para>
- During requests.
+ The <sgmltag><rich:tree></sgmltag> component uses a data model to represent the node structure on the page. To identify a particular node during a client request, the model provides unique keys for tree nodes. The <sgmltag><rich:tree></sgmltag> component can use strings as key values. These strings may contain special characters that are not allowed by browsers, such as the left angle bracket (<) and ampersand (&). To allow these characters in the keys, the following converter is provided:
</para>
+ <variablelist>
+ <varlistentry>
+ <term><classname>org.richfaces.TreeRowKeyConverter</classname></term>
+ <listitem>
+ <para>
+ The <classname>org.richfaces.TreeRowKeyConverter</classname> converter is used for trees constructed using <sgmltag><rich:treeNode></sgmltag> components. The key should be of the type <type>java.lang.String</type>.
+ </para>
+ </listitem>
+ </varlistentry>
+ <!-- TODO not in M5
+ <varlistentry>
+ <term><classname>org.richfaces.TreeAdaptorRowKeyConverter</classname></term>
+ <listitem>
+ <para>
+ The <classname>org.richfaces.TreeAdaptorRowKeyConverter</classname> converter is used for trees constructed using <sgmltag><rich:treeNodesAdaptor></sgmltag> components. The key should be of the type <type>java.lang.String</type>.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><classname>org.richfaces.TreeAdaptorIntegerRowKeyConverter</classname></term>
+ <listitem>
+ <para>
+ The <classname>org.richfaces.TreeAdaptorIntegerRowKeyConverter</classname> converter is used for trees constructed using <sgmltag><rich:treeNodesAdaptor></sgmltag> components, but uses a numerical key. The key should be of the type <type>java.lang.Integer</type>.
+ </para>
+ </listitem>
+ </varlistentry>
+ -->
+ </variablelist>
+ <para>
+ To apply a converter to the <sgmltag><rich:tree></sgmltag> component, define it with the <varname>rowKeyConverter</varname> attribute. <xref linkend="exam-Component_Reference-richtree-Identifying_nodes" /> demonstrates the use of a converter to identify tree nodes.
+ </para>
+ <example id="exam-Component_Reference-richtree-Identifying_nodes">
+ <title>Identifying nodes</title>
+ <programlisting language="XML" role="XML"><xi:include parse="text" href="extras/exam-Component_Reference-richtree-Identifying_nodes.xml_sample" xmlns:xi="http://www.w3.org/2001/XInclude" /></programlisting>
+ <para>
+ The tree uses the following data model. The model can contain special characters normally disallowed in web page code.
+ </para>
+ <programlisting language="Java" role="JAVA"><xi:include parse="text" href="extras/exam-Component_Reference-richtree-Identifying_nodes.js" xmlns:xi="http://www.w3.org/2001/XInclude" /></programlisting>
+ </example>
</section>
</section>
@@ -283,22 +322,75 @@
<section id="sect-Component_Reference-Trees-richtreeNode">
<title><sgmltag><rich:treeNode></sgmltag></title>
<para>
- Incomplete
+ The <sgmltag><rich:treeNode></sgmltag> component is a child component of the <sgmltag><rich:tree></sgmltag> component. It represents nodes in the parent tree. The appearance and functionality of each tree node can be customized.
</para>
<section id="sect-Component_Reference-richtreeNode-Basic_usage">
<title>Basic usage</title>
<para>
- Incomplete
+ The <sgmltag><rich:treeNode></sgmltag> component must be a child of a <sgmltag><rich:tree></sgmltag> component. It does not need any attributes declared for basic usage, but should contain the content of the nodes. Refer to <xref linkend="exam-Component_Reference-richtree-Basic_usage" /> for an example of basic <sgmltag><rich:treeNode></sgmltag> component usage.
</para>
</section>
<section id="sect-Component_Reference-richtreeNode-Appearance">
<title>Appearance</title>
<para>
- Use the <varname>rendered</varname> attribute to determine whether the node should actually be rendered in the tree or not. Using the <varname>rendered</varname> attribute in combination with the other <sgmltag><rich:treeNode></sgmltag> attributes
+ Refer to <xref linkend="sect-Component_Reference-richtree-Appearance" /> for the <sgmltag><rich:tree></sgmltag> component for details and examples on styling nodes and icons. Icon styling for individual <sgmltag><rich:treeNode></sgmltag> components uses the same attributes as the parent <sgmltag><rich:tree></sgmltag> component: <varname>icon</varname>, <varname>iconLeaf</varname>, <varname>iconExpanded</varname>, and <varname>iconCollapsed</varname>. Icon-related attributes specified for child <sgmltag><rich:treeNode></sgmltag> components overwrite any global icon attributes of the parent <sgmltag><rich:tree></sgmltag> component.
</para>
+ <para>
+ Use the <varname>rendered</varname> attribute to determine whether the node should actually be rendered in the tree or not. Using the <varname>rendered</varname> attribute in combination with the <sgmltag><rich:treeNode></sgmltag> <varname>type</varname> attribute can allow further style differentiation between node content, as shown in <xref linkend="exam-Component_Reference-richtreeNode-rendered_attribute" />.
+ </para>
+ <example id="exam-Component_Reference-richtreeNode-rendered_attribute">
+ <title>rendered attribute</title>
+ <para>
+ The <varname>rendered</varname> attribute is used to differentiate between music albums that are in stock and those that are not. The item <varname>type</varname> attributes return values that are otherwise identical; only the <property>item.exist</property> property differs, so it is used for the <varname>rendered</varname> attribute.
+ </para>
+ <programlisting language="XML" role="XML"><xi:include parse="text" href="extras/exam-Component_Reference-richtreeNode-rendered_attribute.xml_sample" xmlns:xi="http://www.w3.org/2001/XInclude" /></programlisting>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/exam-Component_Reference-richtreeNode-rendered_attribute.png" format="PNG" />
+ </imageobject>
+ </mediaobject>
+ </example>
</section>
+
+ <section id="sect-Component_Reference-richtreeNode-Interactivity">
+ <title>Interactivity</title>
+ <para>
+ All interactivity with individual nodes, such as expanding and collapsing, drag-and-drop, and other events handling, is managed by the parent <sgmltag><rich:tree></sgmltag> component. Refer to <xref linkend="sect-Component_Reference-richtree-Expanding_and_collapsing_tree_nodes" /><!--, <xref linkend="sect-Component_Reference-richtree-Built-in_drag_and_drop" />,--> and <xref linkend="sect-Component_Reference-richtree-Event_handling" /> for further details.
+ </para>
+ </section>
+
+ <section id="sect-Component_Reference-richtreeNode-Reference_data">
+ <title>Reference data</title>
+ <itemizedlist>
+ <listitem>
+ <para>
+ <parameter>component-type</parameter>: <classname>org.richfaces.treeNode</classname>
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <parameter>component-class</parameter>: <classname>org.richfaces.component.html.HtmltreeNode</classname>
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <parameter>component-family</parameter>: <classname>org.richfaces.treeNode</classname>
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <parameter>renderer-type</parameter>: <classname>org.richfaces.treeNodeRenderer</classname>
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <parameter>tag-class</parameter>: <classname>org.richfaces.taglib.treeNodeTag</classname>
+ </para>
+ </listitem>
+ </itemizedlist>
+ </section>
</section>
</section>
Added: modules/docs/trunk/Component_Reference/src/main/docbook/en-US/extras/exam-Component_Reference-richtree-Identifying_nodes.js
===================================================================
--- modules/docs/trunk/Component_Reference/src/main/docbook/en-US/extras/exam-Component_Reference-richtree-Identifying_nodes.js (rev 0)
+++ modules/docs/trunk/Component_Reference/src/main/docbook/en-US/extras/exam-Component_Reference-richtree-Identifying_nodes.js 2010-12-14 06:28:45 UTC (rev 20545)
@@ -0,0 +1,17 @@
+String[ ] components = {"< a4j:keepAlive >", "< a4j:actionParam >" };
+String[ ][ ] attributes = {{"ajaxOnly", "beanName"},
+ {"name", "value", "assignTo"}};
+
+data = new TreeNodeImpl<String>();
+
+for (int i = 0; i < components.length; i++) {
+ TreeNode<String> child = new TreeNodeImpl<String>();
+ child.setData(components[i]);
+ data.addChild(components[i], child);
+
+ for (int j = 0; j < attributes[i].length; j++) {
+ TreeNode<String> grandChild = new TreeNodeImpl<String>();
+ grandChild.setData(attributes[i][j]);
+ child.addChild(attributes[i][j], grandChild);
+ }
+}
Added: modules/docs/trunk/Component_Reference/src/main/docbook/en-US/extras/exam-Component_Reference-richtree-Identifying_nodes.xml_sample
===================================================================
--- modules/docs/trunk/Component_Reference/src/main/docbook/en-US/extras/exam-Component_Reference-richtree-Identifying_nodes.xml_sample (rev 0)
+++ modules/docs/trunk/Component_Reference/src/main/docbook/en-US/extras/exam-Component_Reference-richtree-Identifying_nodes.xml_sample 2010-12-14 06:28:45 UTC (rev 20545)
@@ -0,0 +1,6 @@
+<rich:tree value="#{treeBean.data}" var="node"
+ rowKeyConverter="org.richfaces.TreeRowKeyConverter">
+ <rich:treeNode>
+ <h:outputText value="#{node}"/>
+ </rich:treeNode>
+</rich:tree>
Modified: modules/docs/trunk/Component_Reference/src/main/docbook/en-US/extras/exam-Component_Reference-richtree-nodeFace_attribute_with_Expression_Language.xml_sample
===================================================================
--- modules/docs/trunk/Component_Reference/src/main/docbook/en-US/extras/exam-Component_Reference-richtree-nodeFace_attribute_with_Expression_Language.xml_sample 2010-12-13 23:54:02 UTC (rev 20544)
+++ modules/docs/trunk/Component_Reference/src/main/docbook/en-US/extras/exam-Component_Reference-richtree-nodeFace_attribute_with_Expression_Language.xml_sample 2010-12-14 06:28:45 UTC (rev 20545)
@@ -1 +1,2 @@
-<rich:tree value="#{library.data}" var="item" nodeFace="#{data.name != 'param-value' ? 'artist' : 'album'}">
+<rich:tree value="#{library.data}" var="item"
+ nodeFace="#{data.name != 'param-value' ? 'artist' : 'album'}">
Added: modules/docs/trunk/Component_Reference/src/main/docbook/en-US/extras/exam-Component_Reference-richtreeNode-rendered_attribute.xml_sample
===================================================================
--- modules/docs/trunk/Component_Reference/src/main/docbook/en-US/extras/exam-Component_Reference-richtreeNode-rendered_attribute.xml_sample (rev 0)
+++ modules/docs/trunk/Component_Reference/src/main/docbook/en-US/extras/exam-Component_Reference-richtreeNode-rendered_attribute.xml_sample 2010-12-14 06:28:45 UTC (rev 20545)
@@ -0,0 +1,12 @@
+<rich:tree style="width:300px" value="#{library.data}" var="item" nodeFace="#{item.type}">
+ ...
+ <rich:treeNode type="album" iconLeaf="/images/tree/album.gif" icon="/images/tree/album.gif"
+ rendered="#{item.exist}">
+ <h:outputText value="#{item.name}" />
+ </rich:treeNode>
+ <rich:treeNode type="album" iconLeaf="/images/tree/album_absent.gif" icon="/images/tree/album_absent.gif"
+ rendered="#{not item.exist}">
+ <h:outputText value="#{item.name}" />
+ </rich:treeNode>
+ ...
+</rich:tree>
Added: modules/docs/trunk/Component_Reference/src/main/docbook/en-US/images/exam-Component_Reference-richtreeNode-rendered_attribute.png
===================================================================
(Binary files differ)
Property changes on: modules/docs/trunk/Component_Reference/src/main/docbook/en-US/images/exam-Component_Reference-richtreeNode-rendered_attribute.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
14 years, 1 month
JBoss Rich Faces SVN: r20544 - in trunk: ui/core/ui/src/main/java/org/richfaces/component and 2 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2010-12-13 18:54:02 -0500 (Mon, 13 Dec 2010)
New Revision: 20544
Added:
trunk/cdk/attributes/src/main/resources/META-INF/cdk/attributes/ajax-props.xml
Modified:
trunk/cdk/attributes/src/main/resources/META-INF/cdk/attributes/command-button-props.xml
trunk/cdk/attributes/src/main/resources/META-INF/cdk/attributes/link-props.xml
trunk/ui/core/ui/src/main/java/org/richfaces/component/AbstractAjaxFunction.java
trunk/ui/core/ui/src/main/java/org/richfaces/component/AbstractCommandButton.java
trunk/ui/core/ui/src/main/java/org/richfaces/component/AbstractCommandLink.java
trunk/ui/core/ui/src/main/java/org/richfaces/component/AbstractPoll.java
trunk/ui/core/ui/src/main/templates/org/ajax4jsf/renderkit/html/link.template.xml
trunk/ui/output/ui/src/main/java/org/richfaces/component/AbstractMenuItem.java
Log:
https://issues.jboss.org/browse/RF-9878
Added: trunk/cdk/attributes/src/main/resources/META-INF/cdk/attributes/ajax-props.xml
===================================================================
--- trunk/cdk/attributes/src/main/resources/META-INF/cdk/attributes/ajax-props.xml (rev 0)
+++ trunk/cdk/attributes/src/main/resources/META-INF/cdk/attributes/ajax-props.xml 2010-12-13 23:54:02 UTC (rev 20544)
@@ -0,0 +1,64 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- JBoss, Home of Professional Open Source Copyright ${year}, 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. -->
+<cdk:properties xmlns:xi="http://www.w3.org/2001/XInclude"
+ xmlns:cdk="http://jboss.org/schema/richfaces/cdk/extensions"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee">
+
+ <property>
+ <property-name>execute</property-name>
+ <property-class>java.lang.Object</property-class>
+ </property>
+ <property>
+ <property-name>render</property-name>
+ <property-class>java.lang.Object</property-class>
+ </property>
+ <property>
+ <property-name>limitRender</property-name>
+ <property-class>boolean</property-class>
+ <default-value>false</default-value>
+ </property>
+
+ <property>
+ <property-name>onbegin</property-name>
+ <property-class>java.lang.String</property-class>
+ <property-extension>
+ <cdk:event-name default="false">begin</cdk:event-name>
+ </property-extension>
+ </property>
+ <property>
+ <property-name>onbeforedomupdate</property-name>
+ <property-class>java.lang.String</property-class>
+ <property-extension>
+ <cdk:event-name default="false">beforedomupdate</cdk:event-name>
+ </property-extension>
+ </property>
+ <property>
+ <property-name>oncomplete</property-name>
+ <property-class>java.lang.String</property-class>
+ <property-extension>
+ <cdk:event-name default="false">complete</cdk:event-name>
+ </property-extension>
+ </property>
+
+ <property>
+ <property-name>status</property-name>
+ <property-class>java.lang.String</property-class>
+ </property>
+ <property>
+ <property-name>data</property-name>
+ <property-class>java.lang.Object</property-class>
+ </property>
+
+</cdk:properties>
Modified: trunk/cdk/attributes/src/main/resources/META-INF/cdk/attributes/command-button-props.xml
===================================================================
--- trunk/cdk/attributes/src/main/resources/META-INF/cdk/attributes/command-button-props.xml 2010-12-13 19:32:01 UTC (rev 20543)
+++ trunk/cdk/attributes/src/main/resources/META-INF/cdk/attributes/command-button-props.xml 2010-12-13 23:54:02 UTC (rev 20544)
@@ -31,7 +31,7 @@
<property-class>java.lang.String</property-class>
<property-extension>
<cdk:pass-through>false</cdk:pass-through>
- <cdk:event-name />
+ <cdk:event-name>click</cdk:event-name>
<cdk:event-name>action</cdk:event-name>
<default-behavior>true</default-behavior>
</property-extension>
@@ -48,27 +48,12 @@
<property-class>java.lang.String</property-class>
<property-extension>
<cdk:pass-through>true</cdk:pass-through>
- <cdk:event-name />
+ <cdk:event-name>dblclick</cdk:event-name>
</property-extension>
</property>
<property>
<description>
- Javascript code executed when this element loses focus
- and its value has been modified since gaining focus.
- </description>
- <display-name>Input Change Script</display-name>
- <icon />
- <property-name>onchange</property-name>
- <property-class>java.lang.String</property-class>
- <property-extension>
- <cdk:pass-through>true</cdk:pass-through>
- <cdk:event-name />
- </property-extension>
- </property>
-
- <property>
- <description>
Javascript code executed when a pointer button is
pressed down over this element.
</description>
@@ -78,7 +63,7 @@
<property-class>java.lang.String</property-class>
<property-extension>
<cdk:pass-through>true</cdk:pass-through>
- <cdk:event-name />
+ <cdk:event-name>mousedown</cdk:event-name>
</property-extension>
</property>
@@ -93,7 +78,7 @@
<property-class>java.lang.String</property-class>
<property-extension>
<cdk:pass-through>true</cdk:pass-through>
- <cdk:event-name />
+ <cdk:event-name>mouseup</cdk:event-name>
</property-extension>
</property>
@@ -108,7 +93,7 @@
<property-class>java.lang.String</property-class>
<property-extension>
<cdk:pass-through>true</cdk:pass-through>
- <cdk:event-name />
+ <cdk:event-name>mouseover</cdk:event-name>
</property-extension>
</property>
@@ -123,7 +108,7 @@
<property-class>java.lang.String</property-class>
<property-extension>
<cdk:pass-through>true</cdk:pass-through>
- <cdk:event-name />
+ <cdk:event-name>mousemove</cdk:event-name>
</property-extension>
</property>
@@ -138,7 +123,7 @@
<property-class>java.lang.String</property-class>
<property-extension>
<cdk:pass-through>true</cdk:pass-through>
- <cdk:event-name />
+ <cdk:event-name>mouseout</cdk:event-name>
</property-extension>
</property>
@@ -153,7 +138,7 @@
<property-class>java.lang.String</property-class>
<property-extension>
<cdk:pass-through>true</cdk:pass-through>
- <cdk:event-name />
+ <cdk:event-name>keypress</cdk:event-name>
</property-extension>
</property>
@@ -168,7 +153,7 @@
<property-class>java.lang.String</property-class>
<property-extension>
<cdk:pass-through>true</cdk:pass-through>
- <cdk:event-name />
+ <cdk:event-name>keydown</cdk:event-name>
</property-extension>
</property>
@@ -183,7 +168,7 @@
<property-class>java.lang.String</property-class>
<property-extension>
<cdk:pass-through>true</cdk:pass-through>
- <cdk:event-name />
+ <cdk:event-name>keyup</cdk:event-name>
</property-extension>
</property>
Modified: trunk/cdk/attributes/src/main/resources/META-INF/cdk/attributes/link-props.xml
===================================================================
--- trunk/cdk/attributes/src/main/resources/META-INF/cdk/attributes/link-props.xml 2010-12-13 19:32:01 UTC (rev 20543)
+++ trunk/cdk/attributes/src/main/resources/META-INF/cdk/attributes/link-props.xml 2010-12-13 23:54:02 UTC (rev 20544)
@@ -164,7 +164,7 @@
<property-class>java.lang.String</property-class>
<property-extension>
<cdk:pass-through>false</cdk:pass-through>
- <cdk:event-name />
+ <cdk:event-name>click</cdk:event-name>
<cdk:event-name>action</cdk:event-name>
<default-behavior>true</default-behavior>
</property-extension>
@@ -181,7 +181,7 @@
<property-class>java.lang.String</property-class>
<property-extension>
<cdk:pass-through>true</cdk:pass-through>
- <cdk:event-name />
+ <cdk:event-name>dblclick</cdk:event-name>
</property-extension>
</property>
@@ -196,7 +196,7 @@
<property-class>java.lang.String</property-class>
<property-extension>
<cdk:pass-through>true</cdk:pass-through>
- <cdk:event-name />
+ <cdk:event-name>mousedown</cdk:event-name>
</property-extension>
</property>
@@ -211,7 +211,7 @@
<property-class>java.lang.String</property-class>
<property-extension>
<cdk:pass-through>true</cdk:pass-through>
- <cdk:event-name />
+ <cdk:event-name>mouseup</cdk:event-name>
</property-extension>
</property>
@@ -226,7 +226,7 @@
<property-class>java.lang.String</property-class>
<property-extension>
<cdk:pass-through>true</cdk:pass-through>
- <cdk:event-name />
+ <cdk:event-name>mouseover</cdk:event-name>
</property-extension>
</property>
@@ -241,7 +241,7 @@
<property-class>java.lang.String</property-class>
<property-extension>
<cdk:pass-through>true</cdk:pass-through>
- <cdk:event-name />
+ <cdk:event-name>mousemove</cdk:event-name>
</property-extension>
</property>
@@ -256,7 +256,7 @@
<property-class>java.lang.String</property-class>
<property-extension>
<cdk:pass-through>true</cdk:pass-through>
- <cdk:event-name />
+ <cdk:event-name>mouseout</cdk:event-name>
</property-extension>
</property>
@@ -271,7 +271,7 @@
<property-class>java.lang.String</property-class>
<property-extension>
<cdk:pass-through>true</cdk:pass-through>
- <cdk:event-name />
+ <cdk:event-name>keypress</cdk:event-name>
</property-extension>
</property>
@@ -286,7 +286,7 @@
<property-class>java.lang.String</property-class>
<property-extension>
<cdk:pass-through>true</cdk:pass-through>
- <cdk:event-name />
+ <cdk:event-name>keydown</cdk:event-name>
</property-extension>
</property>
@@ -301,7 +301,7 @@
<property-class>java.lang.String</property-class>
<property-extension>
<cdk:pass-through>true</cdk:pass-through>
- <cdk:event-name />
+ <cdk:event-name>keyup</cdk:event-name>
</property-extension>
</property>
Modified: trunk/ui/core/ui/src/main/java/org/richfaces/component/AbstractAjaxFunction.java
===================================================================
--- trunk/ui/core/ui/src/main/java/org/richfaces/component/AbstractAjaxFunction.java 2010-12-13 19:32:01 UTC (rev 20543)
+++ trunk/ui/core/ui/src/main/java/org/richfaces/component/AbstractAjaxFunction.java 2010-12-13 23:54:02 UTC (rev 20544)
@@ -24,7 +24,6 @@
package org.richfaces.component;
import org.richfaces.cdk.annotations.Attribute;
-import org.richfaces.cdk.annotations.EventName;
import org.richfaces.cdk.annotations.JsfComponent;
import org.richfaces.cdk.annotations.JsfRenderer;
import org.richfaces.cdk.annotations.Tag;
@@ -37,7 +36,8 @@
*/
@JsfComponent(
renderer = @JsfRenderer(type = "org.richfaces.FunctionRenderer"),
- tag = @Tag(name = "jsFunction", type = TagType.Facelets)
+ tag = @Tag(name = "jsFunction", type = TagType.Facelets),
+ attributes = {"ajax-props.xml"}
)
public abstract class AbstractAjaxFunction extends AbstractActionComponent {
@@ -45,27 +45,7 @@
public static final String COMPONENT_TYPE = "org.richfaces.Function";
- @Attribute
- public abstract boolean isLimitRender();
-
@Attribute(required = true)
public abstract String getName();
- @Attribute
- public abstract Object getExecute();
-
- @Attribute
- public abstract Object getRender();
-
- @Attribute
- public abstract String getStatus();
-
- @Attribute(events = @EventName("begin"))
- public abstract String getOnbegin();
-
- @Attribute(events = @EventName("beforedomupdate"))
- public abstract String getOnbeforedomupdate();
-
- @Attribute(events = @EventName("complete"))
- public abstract String getOncomplete();
}
Modified: trunk/ui/core/ui/src/main/java/org/richfaces/component/AbstractCommandButton.java
===================================================================
--- trunk/ui/core/ui/src/main/java/org/richfaces/component/AbstractCommandButton.java 2010-12-13 19:32:01 UTC (rev 20543)
+++ trunk/ui/core/ui/src/main/java/org/richfaces/component/AbstractCommandButton.java 2010-12-13 23:54:02 UTC (rev 20544)
@@ -19,16 +19,12 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-
-
package org.richfaces.component;
import javax.faces.component.UICommand;
import javax.faces.component.UIComponent;
import javax.faces.context.FacesContext;
-import org.richfaces.cdk.annotations.Attribute;
-import org.richfaces.cdk.annotations.EventName;
import org.richfaces.cdk.annotations.JsfComponent;
import org.richfaces.cdk.annotations.JsfRenderer;
import org.richfaces.cdk.annotations.Tag;
@@ -37,65 +33,29 @@
/**
* @author Nick Belaevski
- *
+ *
*/
-@JsfComponent(renderer = @JsfRenderer(type = "org.richfaces.CommandButtonRenderer"), tag = @Tag(type = TagType.Facelets))
+@JsfComponent(renderer = @JsfRenderer(type = "org.richfaces.CommandButtonRenderer"),
+ tag = @Tag(type = TagType.Facelets),
+ attributes = { "ajax-props.xml", "command-button-props.xml", "core-props.xml" }
+)
public abstract class AbstractCommandButton extends AbstractActionComponent implements MetaComponentResolver {
public static final String COMPONENT_TYPE = "org.richfaces.CommandButton";
public static final String COMPONENT_FAMILY = UICommand.COMPONENT_FAMILY;
-
- @Attribute(events = {@EventName("click"), @EventName(value = "action", defaultEvent = true)})
- public abstract String getOnclick();
- @Attribute(events = @EventName("mousemove"))
- public abstract String getOnmousemove();
-
- @Attribute(events = @EventName("dblclick"))
- public abstract String getOndblclick();
-
- @Attribute(events = @EventName("keydown"))
- public abstract String getOnkeydown();
-
- @Attribute(events = @EventName("keypress"))
- public abstract String getOnkeypress();
-
- @Attribute(events = @EventName("keyup"))
- public abstract String getOnkeyup();
-
- @Attribute(events = @EventName("mousedown"))
- public abstract String getOnmousedown();
-
- @Attribute(events = @EventName("mouseout"))
- public abstract String getOnmouseout();
-
- @Attribute(events = @EventName("mouseover"))
- public abstract String getOnmouseover();
-
- @Attribute(events = @EventName("mouseup"))
- public abstract String getOnmouseup();
-
- @Attribute(defaultValue = "")
- public abstract String getStyle();
-
- @Attribute(defaultValue = "")
- public abstract String getStyleClass();
-
- @Attribute
- public abstract boolean isLimitRender();
-
public String resolveClientId(FacesContext facesContext, UIComponent contextComponent, String metaComponentId) {
return null;
}
-
+
public String substituteUnresolvedClientId(FacesContext facesContext, UIComponent contextComponent,
String metaComponentId) {
-
+
if (AjaxContainer.META_COMPONENT_ID.equals(metaComponentId)) {
return AjaxConstants.FORM;
}
-
+
return null;
}
}
Modified: trunk/ui/core/ui/src/main/java/org/richfaces/component/AbstractCommandLink.java
===================================================================
--- trunk/ui/core/ui/src/main/java/org/richfaces/component/AbstractCommandLink.java 2010-12-13 19:32:01 UTC (rev 20543)
+++ trunk/ui/core/ui/src/main/java/org/richfaces/component/AbstractCommandLink.java 2010-12-13 23:54:02 UTC (rev 20544)
@@ -27,7 +27,6 @@
import javax.faces.context.FacesContext;
import org.richfaces.cdk.annotations.Attribute;
-import org.richfaces.cdk.annotations.EventName;
import org.richfaces.cdk.annotations.JsfComponent;
import org.richfaces.cdk.annotations.JsfRenderer;
import org.richfaces.cdk.annotations.Tag;
@@ -39,7 +38,8 @@
*/
@JsfComponent (
renderer = @JsfRenderer(type = "org.richfaces.CommandLinkRenderer"),
- tag = @Tag(type = TagType.Facelets)
+ tag = @Tag(type = TagType.Facelets),
+ attributes = { "ajax-props.xml", "link-props.xml", "core-props.xml" }
)
public abstract class AbstractCommandLink extends AbstractActionComponent implements MetaComponentResolver {
@@ -47,45 +47,9 @@
public static final String COMPONENT_FAMILY = UICommand.COMPONENT_FAMILY;
- @Attribute(events = {@EventName("click"), @EventName(value = "action", defaultEvent = true)})
- public abstract String getOnclick();
-
- @Attribute(events = @EventName("mousemove"))
- public abstract String getOnmousemove();
-
- @Attribute(events = @EventName("dblclick"))
- public abstract String getOndblclick();
-
- @Attribute(events = @EventName("keydown"))
- public abstract String getOnkeydown();
-
- @Attribute(events = @EventName("keypress"))
- public abstract String getOnkeypress();
-
- @Attribute(events = @EventName("keyup"))
- public abstract String getOnkeyup();
-
- @Attribute(events = @EventName("mousedown"))
- public abstract String getOnmousedown();
-
- @Attribute(events = @EventName("mouseout"))
- public abstract String getOnmouseout();
-
- @Attribute(events = @EventName("mouseover"))
- public abstract String getOnmouseover();
-
- @Attribute(events = @EventName("mouseup"))
- public abstract String getOnmouseup();
-
- @Attribute(defaultValue = "")
- public abstract String getStyle();
-
- @Attribute(defaultValue = "")
- public abstract String getStyleClass();
-
- @Attribute
- public abstract boolean isLimitRender();
-
+ @Attribute(hidden = true)
+ private String target;
+
public String resolveClientId(FacesContext facesContext, UIComponent contextComponent, String metaComponentId) {
return null;
}
Modified: trunk/ui/core/ui/src/main/java/org/richfaces/component/AbstractPoll.java
===================================================================
--- trunk/ui/core/ui/src/main/java/org/richfaces/component/AbstractPoll.java 2010-12-13 19:32:01 UTC (rev 20543)
+++ trunk/ui/core/ui/src/main/java/org/richfaces/component/AbstractPoll.java 2010-12-13 23:54:02 UTC (rev 20544)
@@ -37,7 +37,8 @@
*/
@JsfComponent(
tag = @Tag(generate = false, handler = "org.richfaces.view.facelets.html.AjaxPollHandler", type = TagType.Facelets),
- renderer = @JsfRenderer(type = "org.richfaces.PollRenderer")
+ renderer = @JsfRenderer(type = "org.richfaces.PollRenderer"),
+ attributes = { "ajax-props.xml" }
)
public abstract class AbstractPoll extends AbstractActionComponent {
public static final String COMPONENT_TYPE = "org.richfaces.Poll";
@@ -66,15 +67,6 @@
@Attribute(defaultValue = "true")
public abstract boolean isEnabled();
- @Attribute(events = @EventName("begin"))
- public abstract String getOnbegin();
-
- @Attribute(events = @EventName("beforedomupdate"))
- public abstract String getOnbeforedomupdate();
-
- @Attribute(events = @EventName("complete"))
- public abstract String getOncomplete();
-
@Attribute(events = @EventName(value = TIMER, defaultEvent = true))
public abstract String getOntimer();
Modified: trunk/ui/core/ui/src/main/templates/org/ajax4jsf/renderkit/html/link.template.xml
===================================================================
--- trunk/ui/core/ui/src/main/templates/org/ajax4jsf/renderkit/html/link.template.xml 2010-12-13 19:32:01 UTC (rev 20543)
+++ trunk/ui/core/ui/src/main/templates/org/ajax4jsf/renderkit/html/link.template.xml 2010-12-13 23:54:02 UTC (rev 20544)
@@ -23,7 +23,7 @@
</a>
</c:when>
<c:otherwise>
- <span id="#{clientId}" cdk:passThroughWithExclusions="value">
+ <span id="#{clientId}" cdk:passThrough="dir lang class style title">
#{component.attributes['value']}
<cdk:call expression="renderChildren(facesContext, component)" />
</span>
Modified: trunk/ui/output/ui/src/main/java/org/richfaces/component/AbstractMenuItem.java
===================================================================
--- trunk/ui/output/ui/src/main/java/org/richfaces/component/AbstractMenuItem.java 2010-12-13 19:32:01 UTC (rev 20543)
+++ trunk/ui/output/ui/src/main/java/org/richfaces/component/AbstractMenuItem.java 2010-12-13 23:54:02 UTC (rev 20544)
@@ -11,7 +11,7 @@
type = AbstractMenuItem.COMPONENT_TYPE,
renderer=@JsfRenderer(type = MenuItemRendererBase.RENDERER_TYPE),
tag = @Tag(name="menuItem"),
- attributes = {"events-props.xml", "core-props.xml", "i18n-props.xml"})
+ attributes = {"events-props.xml", "core-props.xml", "i18n-props.xml", "ajax-props.xml"})
public abstract class AbstractMenuItem extends AbstractActionComponent
implements MenuComponent {
@@ -31,12 +31,6 @@
@Attribute
public abstract boolean isDisabled();
-
- @Attribute
- public abstract String getStyleClass();
-
- @Attribute
- public abstract String getStyle();
public enum Facets {
ICON("icon"), ICON_DISABLED("iconDisabled");
14 years, 1 month
JBoss Rich Faces SVN: r20543 - in trunk/ui/output/ui/src/main: resources/META-INF/resources/org.richfaces and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2010-12-13 14:32:01 -0500 (Mon, 13 Dec 2010)
New Revision: 20543
Modified:
trunk/ui/output/ui/src/main/java/org/richfaces/renderkit/html/PanelMenuItemRenderer.java
trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/panelMenuItem.js
Log:
https://issues.jboss.org/browse/RF-9463
Modified: trunk/ui/output/ui/src/main/java/org/richfaces/renderkit/html/PanelMenuItemRenderer.java
===================================================================
--- trunk/ui/output/ui/src/main/java/org/richfaces/renderkit/html/PanelMenuItemRenderer.java 2010-12-13 19:09:26 UTC (rev 20542)
+++ trunk/ui/output/ui/src/main/java/org/richfaces/renderkit/html/PanelMenuItemRenderer.java 2010-12-13 19:32:01 UTC (rev 20543)
@@ -144,6 +144,7 @@
HtmlPanelMenuItem panelMenuItem = (HtmlPanelMenuItem) component;
Map<String, Object> options = new HashMap<String, Object>();
+ //TODO nick - ajax options should not be rendered in client mode
options.put("ajax", getAjaxOptions(context, panelMenuItem));
options.put("disabled", panelMenuItem.isDisabled());
options.put("mode", panelMenuItem.getMode());
Modified: trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/panelMenuItem.js
===================================================================
--- trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/panelMenuItem.js 2010-12-13 19:09:26 UTC (rev 20542)
+++ trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/panelMenuItem.js 2010-12-13 19:32:01 UTC (rev 20543)
@@ -61,6 +61,7 @@
* */
execServer : function (item) {
item.__changeState();
+ //TODO nick - 'target' attribute?
rf.submitForm(this.__getParentForm(item));
return false;
@@ -73,6 +74,7 @@
* */
execAjax : function (item) {
var oldItem = item.__changeState();
+ //TODO nick - check for interaction with queue
rf.ajax(item.__panelMenu().id, null, $.extend({}, item.options["ajax"], {}));
item.__restoreState(oldItem);
@@ -209,7 +211,8 @@
if (panelMenu.selectedItem() == this.itemName) {
panelMenu.selectedItem(null);
} else {
- rf.warn("You try unselect item (name=" + this.itemName + ") that isn't seleted")
+ //TODO nick - should be rf.log.warn
+ rf.warn("You tried to unselect item (name=" + this.itemName + ") that isn't seleted")
}
this.__unselect();
@@ -253,6 +256,7 @@
},
__rfPanelMenu : function () {
+ //TODO nick - return rf.$(this.__panelMenu())
return rf.$(this.__item().parents(".rf-pm")[0]);
},
@@ -270,6 +274,7 @@
return $(rf.getDomElement(this.id));
},
+ //TODO nick - __item() vs __header()?
__header : function () {
return this.__item();
},
@@ -283,7 +288,9 @@
},
__fireBeforeSelect : function () {
+ //TODO nick - 'new' is not necessary here
return new rf.Event.fireById(this.id, "beforeselect", {
+ //TODO nick - pass item here
id: this.id
});
},
14 years, 1 month
JBoss Rich Faces SVN: r20542 - in trunk/ui/output: api/src/main/java/org/richfaces/event and 3 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2010-12-13 14:09:26 -0500 (Mon, 13 Dec 2010)
New Revision: 20542
Modified:
trunk/ui/output/api/src/main/java/org/richfaces/PanelMenuMode.java
trunk/ui/output/api/src/main/java/org/richfaces/event/PanelToggleEvent.java
trunk/ui/output/ui/src/main/java/org/richfaces/component/AbstractPanelMenu.java
trunk/ui/output/ui/src/main/java/org/richfaces/component/AbstractPanelMenuGroup.java
trunk/ui/output/ui/src/main/java/org/richfaces/component/AbstractPanelMenuItem.java
trunk/ui/output/ui/src/main/java/org/richfaces/component/UIPanelMenu.java
trunk/ui/output/ui/src/main/java/org/richfaces/component/UIPanelMenuGroup.java
trunk/ui/output/ui/src/main/java/org/richfaces/component/UIPanelMenuItem.java
trunk/ui/output/ui/src/main/java/org/richfaces/renderkit/html/PanelMenuGroupRenderer.java
trunk/ui/output/ui/src/main/java/org/richfaces/renderkit/html/PanelMenuItemRenderer.java
trunk/ui/output/ui/src/main/java/org/richfaces/renderkit/html/PanelMenuRenderer.java
trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/panelMenu.js
trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/panelMenuGroup.js
Log:
https://issues.jboss.org/browse/RF-9463
Modified: trunk/ui/output/api/src/main/java/org/richfaces/PanelMenuMode.java
===================================================================
--- trunk/ui/output/api/src/main/java/org/richfaces/PanelMenuMode.java 2010-12-13 18:46:54 UTC (rev 20541)
+++ trunk/ui/output/api/src/main/java/org/richfaces/PanelMenuMode.java 2010-12-13 19:09:26 UTC (rev 20542)
@@ -4,6 +4,7 @@
* @author akolonitsky
* @since Oct 19, 2010
*/
+//TODO nick - having separate enum for each component is a bad idea
public enum PanelMenuMode {
ajax,
server,
Modified: trunk/ui/output/api/src/main/java/org/richfaces/event/PanelToggleEvent.java
===================================================================
--- trunk/ui/output/api/src/main/java/org/richfaces/event/PanelToggleEvent.java 2010-12-13 18:46:54 UTC (rev 20541)
+++ trunk/ui/output/api/src/main/java/org/richfaces/event/PanelToggleEvent.java 2010-12-13 19:09:26 UTC (rev 20542)
@@ -33,6 +33,9 @@
*/
public class PanelToggleEvent extends FacesEvent {
+ private static final long serialVersionUID = 852945229559247489L;
+
+ //TODO nick - why not primitive boolean here?
private final Boolean isExpanded;
Modified: trunk/ui/output/ui/src/main/java/org/richfaces/component/AbstractPanelMenu.java
===================================================================
--- trunk/ui/output/ui/src/main/java/org/richfaces/component/AbstractPanelMenu.java 2010-12-13 18:46:54 UTC (rev 20541)
+++ trunk/ui/output/ui/src/main/java/org/richfaces/component/AbstractPanelMenu.java 2010-12-13 19:09:26 UTC (rev 20542)
@@ -23,11 +23,6 @@
package org.richfaces.component;
-import org.richfaces.PanelMenuMode;
-import org.richfaces.event.ItemChangeEvent;
-import org.richfaces.event.ItemChangeListener;
-import org.richfaces.event.ItemChangeSource;
-
import javax.el.ValueExpression;
import javax.faces.component.UIComponent;
import javax.faces.component.UIOutput;
@@ -36,6 +31,11 @@
import javax.faces.event.FacesEvent;
import javax.faces.event.PhaseId;
+import org.richfaces.PanelMenuMode;
+import org.richfaces.event.ItemChangeEvent;
+import org.richfaces.event.ItemChangeListener;
+import org.richfaces.event.ItemChangeSource;
+
/**
* @author akolonitsky
* @since 2010-10-25
@@ -61,6 +61,8 @@
public void processDecodes(FacesContext context) {
super.processDecodes(context);
+ //TODO nick - is component immediate = true only?
+ //TODO nick - validate should be executed in context of component, i.e. when 'component' EL variable is set
executeValidate(context);
}
@@ -78,6 +80,7 @@
String previous = (String) getValue();
setActiveItem(activeItem);
setSubmittedActiveItem(null);
+
if (previous == null || !previous.equalsIgnoreCase(activeItem)) {
queueEvent(new ItemChangeEvent(this, previous, activeItem));
}
@@ -91,6 +94,7 @@
throw e;
}
+ //TODO nick - where is 'valid' attribute set?
if (!isValid()) {
context.validationFailed();
context.renderResponse();
@@ -120,8 +124,10 @@
public void broadcast(FacesEvent event) throws AbortProcessingException {
super.broadcast(event);
+ //TODO nick - check for (isBypassUpdates() || isImmediate()) can be removed
if (event instanceof ItemChangeEvent
&& (isBypassUpdates() || isImmediate())) {
+ //TODO nick - use getFacesContext() instead
FacesContext.getCurrentInstance().renderResponse();
}
}
@@ -132,6 +138,7 @@
return this.submittedActiveItem;
}
+ //TODO nick - change argument to String
public void setSubmittedActiveItem(Object submittedValue) {
this.submittedActiveItem = String.valueOf(submittedValue);
}
@@ -148,6 +155,7 @@
return (String) getValue();
}
+ //TODO nick - where is EL-expression updated?
public void setActiveItem(String value) {
setValue(value);
}
@@ -216,6 +224,7 @@
return (AbstractPanelMenuItem) comp;
}
+ //TODO nick - what if panel menu is nested?
for (UIComponent item : comp.getChildren()) {
AbstractPanelMenuItem resItem = getItem(itemName, item);
if (resItem != null) {
Modified: trunk/ui/output/ui/src/main/java/org/richfaces/component/AbstractPanelMenuGroup.java
===================================================================
--- trunk/ui/output/ui/src/main/java/org/richfaces/component/AbstractPanelMenuGroup.java 2010-12-13 18:46:54 UTC (rev 20541)
+++ trunk/ui/output/ui/src/main/java/org/richfaces/component/AbstractPanelMenuGroup.java 2010-12-13 19:09:26 UTC (rev 20542)
@@ -23,14 +23,14 @@
package org.richfaces.component;
-import org.richfaces.event.ItemChangeEvent;
-import org.richfaces.event.PanelToggleEvent;
-
import javax.el.ValueExpression;
import javax.faces.context.FacesContext;
import javax.faces.event.FacesEvent;
import javax.faces.event.PhaseId;
+import org.richfaces.event.ItemChangeEvent;
+import org.richfaces.event.PanelToggleEvent;
+
/**
* @author akolonitsky
* @since 2010-10-25
@@ -60,6 +60,7 @@
public void processDecodes(FacesContext context) {
super.processDecodes(context);
+ //TODO nick - is component immediate==true always?
executeValidate(context);
}
@@ -90,6 +91,7 @@
throw e;
}
+ //TODO nick - isValid()/setValid() is not called anywhere
if (!isValid()) {
context.validationFailed();
context.renderResponse();
@@ -169,5 +171,6 @@
public abstract boolean isBubbleSelection();
+ //TODO nick - this should be MethodExpression
public abstract String getChangeExpandListener();
}
Modified: trunk/ui/output/ui/src/main/java/org/richfaces/component/AbstractPanelMenuItem.java
===================================================================
--- trunk/ui/output/ui/src/main/java/org/richfaces/component/AbstractPanelMenuItem.java 2010-12-13 18:46:54 UTC (rev 20541)
+++ trunk/ui/output/ui/src/main/java/org/richfaces/component/AbstractPanelMenuItem.java 2010-12-13 19:09:26 UTC (rev 20542)
@@ -23,23 +23,25 @@
package org.richfaces.component;
+import javax.faces.component.UICommand;
+import javax.faces.component.UIComponent;
+
import org.richfaces.PanelMenuMode;
import org.richfaces.event.ItemChangeListener;
import org.richfaces.event.ItemChangeSource;
-import javax.faces.component.UICommand;
-import javax.faces.component.UIComponent;
-
/**
* @author akolonitsky
* @since 2010-10-25
*/
+//TODO nick - use org.richfaces.component.AbstractActionComponent as super class
public abstract class AbstractPanelMenuItem extends UICommand implements ItemChangeSource{
public static final String COMPONENT_TYPE = "org.richfaces.PanelMenuItem";
public static final String COMPONENT_FAMILY = "org.richfaces.PanelMenuItem";
+ //TODO nick - move this enum to renderkit package
public enum Icons {
none("rf-pm-none"),
disc("rf-pm-disc"),
@@ -59,6 +61,7 @@
this.cssClass = cssClass;
}
+ //TODO nick - should this become getCssClass()?
public String cssClass() {
return cssClass;
}
@@ -72,6 +75,7 @@
return getParentItem() instanceof AbstractPanelMenu;
}
+ //TODO nick - this can be replaced with ComponentIterators.parents(UIComponent) + Iterators.find(...)
public AbstractPanelMenu getPanelMenu() { // TODO refactor
UIComponent parentItem = getParent();
while (parentItem != null) {
@@ -85,6 +89,7 @@
return null;
}
+ //TODO nick - this can be replaced with ComponentIterators.parents(UIComponent) + Iterators.find(...)
public UIComponent getParentItem() {
UIComponent parentItem = getParent();
while (parentItem != null) {
@@ -126,6 +131,7 @@
// ------------------------------------------------ Event Processing Methods
+ //TODO nick - it seems these listeners are never triggered
public void addItemChangeListener(ItemChangeListener listener) {
addFacesListener(listener);
}
Modified: trunk/ui/output/ui/src/main/java/org/richfaces/component/UIPanelMenu.java
===================================================================
--- trunk/ui/output/ui/src/main/java/org/richfaces/component/UIPanelMenu.java 2010-12-13 18:46:54 UTC (rev 20541)
+++ trunk/ui/output/ui/src/main/java/org/richfaces/component/UIPanelMenu.java 2010-12-13 19:09:26 UTC (rev 20542)
@@ -29,6 +29,7 @@
* @author akolonitsky
* @since 2010-11-29
*/
+//TODO nick - this class should be generated by CDK
public class UIPanelMenu extends AbstractPanelMenu {
public enum PropertyKeys {
Modified: trunk/ui/output/ui/src/main/java/org/richfaces/component/UIPanelMenuGroup.java
===================================================================
--- trunk/ui/output/ui/src/main/java/org/richfaces/component/UIPanelMenuGroup.java 2010-12-13 18:46:54 UTC (rev 20541)
+++ trunk/ui/output/ui/src/main/java/org/richfaces/component/UIPanelMenuGroup.java 2010-12-13 19:09:26 UTC (rev 20542)
@@ -29,6 +29,7 @@
* @author akolonitsky
* @since 2010-10-25
*/
+//TODO nick - this class should be generated by CDK
public class UIPanelMenuGroup extends AbstractPanelMenuGroup {
public enum PropertyKeys {
Modified: trunk/ui/output/ui/src/main/java/org/richfaces/component/UIPanelMenuItem.java
===================================================================
--- trunk/ui/output/ui/src/main/java/org/richfaces/component/UIPanelMenuItem.java 2010-12-13 18:46:54 UTC (rev 20541)
+++ trunk/ui/output/ui/src/main/java/org/richfaces/component/UIPanelMenuItem.java 2010-12-13 19:09:26 UTC (rev 20542)
@@ -29,6 +29,7 @@
* @author akolonitsky
* @since 2010-11-29
*/
+//TODO nick - this class should be generated by CDK
public class UIPanelMenuItem extends AbstractPanelMenuItem {
public enum PropertyKeys {
Modified: trunk/ui/output/ui/src/main/java/org/richfaces/renderkit/html/PanelMenuGroupRenderer.java
===================================================================
--- trunk/ui/output/ui/src/main/java/org/richfaces/renderkit/html/PanelMenuGroupRenderer.java 2010-12-13 18:46:54 UTC (rev 20541)
+++ trunk/ui/output/ui/src/main/java/org/richfaces/renderkit/html/PanelMenuGroupRenderer.java 2010-12-13 19:09:26 UTC (rev 20542)
@@ -23,6 +23,17 @@
package org.richfaces.renderkit.html;
+import static org.richfaces.renderkit.html.TogglePanelRenderer.addEventOption;
+import static org.richfaces.renderkit.html.TogglePanelRenderer.getAjaxOptions;
+
+import java.io.IOException;
+import java.util.HashMap;
+import java.util.Map;
+
+import javax.faces.component.UIComponent;
+import javax.faces.context.FacesContext;
+import javax.faces.context.ResponseWriter;
+
import org.ajax4jsf.context.AjaxContext;
import org.ajax4jsf.javascript.JSObject;
import org.richfaces.component.AbstractPanelMenuGroup;
@@ -31,16 +42,6 @@
import org.richfaces.renderkit.HtmlConstants;
import org.richfaces.renderkit.RenderKitUtils;
-import javax.faces.component.UIComponent;
-import javax.faces.context.FacesContext;
-import javax.faces.context.ResponseWriter;
-import java.io.IOException;
-import java.util.HashMap;
-import java.util.Map;
-
-import static org.richfaces.renderkit.html.TogglePanelRenderer.addEventOption;
-import static org.richfaces.renderkit.html.TogglePanelRenderer.getAjaxOptions;
-
/**
* @author akolonitsky
* @since 2010-10-25
@@ -54,6 +55,7 @@
public static final String BEFORE_EXPAND = "beforeexpand";
public static final String BEFORE_SWITCH = "beforeswitch";
private static final String CSS_CLASS_PREFIX = "rf-pm-gr";
+ //TODO nick - shouldn't this be rf-pm-gr-top?
private static final String TOP_CSS_CLASS_PREFIX = "rf-pm-top-gr";
@Override
@@ -64,12 +66,14 @@
context.getExternalContext().getRequestParameterMap();
// Don't overwrite the value unless you have to!
+ //TODO nick - ":expanded" suffix is not necessary
String newValue = requestMap.get(component.getClientId() + ":expanded");
if (newValue != null) {
menuGroup.setSubmittedExpanded(newValue);
}
String compClientId = component.getClientId(context);
+ //TODO nick - rename clientId to smth.
String clientId = requestMap.get(compClientId);
if (clientId != null && clientId.equals(compClientId)) {
context.getPartialViewContext().getRenderIds().add(clientId);
@@ -79,6 +83,7 @@
}
}
+ //TODO nick - copy of org.richfaces.renderkit.html.PanelMenuRenderer.addOnCompleteParam(String)
protected static void addOnCompleteParam(String itemId) {
AjaxContext.getCurrentInstance().appendOncomplete(new StringBuilder()
.append("RichFaces.$('").append(itemId).append("').onCompleteHandler();").toString());
@@ -94,6 +99,7 @@
writer.startElement(HtmlConstants.INPUT_ELEM, component);
+ //TODO nick - there is no need to encode this input - group state can be extracted from class
final String expanded = component.getClientId(context) + ":expanded";
writer.writeAttribute(HtmlConstants.ID_ATTRIBUTE, expanded, null);
writer.writeAttribute(HtmlConstants.NAME_ATTRIBUTE, expanded, null);
@@ -106,6 +112,7 @@
}
private void encodeHeader(ResponseWriter writer, FacesContext context, HtmlPanelMenuGroup menuGroup) throws IOException {
+ //TODO nick - HtmlConstants.* should be used
writer.startElement("div", null);
writer.writeAttribute("id", menuGroup.getClientId(context) + ":hdr", null);
writer.writeAttribute("class", getCssClass(menuGroup, "-hdr"), null);
@@ -116,12 +123,15 @@
private void encodeHeaderGroup(ResponseWriter writer, FacesContext context, HtmlPanelMenuGroup menuItem, String classPrefix) throws IOException {
writer.startElement("table", null);
writer.writeAttribute("class", classPrefix + "-gr", null);
+ //TODO nick - TBODY is missing
writer.startElement("tr", null);
encodeHeaderGroupIconLeft(writer, context, menuItem, classPrefix);
writer.startElement("td", null);
writer.writeAttribute("class", classPrefix + "-lbl", null);
+ //TODO nick - this will render 'null' if label is null
+ //TODO nick - should there be 'label' facet also?
writer.writeText(String.valueOf(menuItem.getLabel()), null);
writer.endElement("td");
@@ -142,6 +152,7 @@
String iconCollapsed = menuItem.isDisabled() ? menuItem.getIconRightDisabled() : menuItem.getIconRightCollapsed();
String iconExpanded = menuItem.isDisabled() ? menuItem.getIconRightDisabled() : menuItem.getIconRightExpanded();
+ //TODO nick - should this be "-ico-exp"? also why expanded icon state is connected with right icon alignment?
encodeTdIcon(writer, context, classPrefix + "-exp-ico", menuItem.isExpanded(), iconCollapsed, iconExpanded);
}
@@ -149,11 +160,13 @@
writer.startElement("td", null);
writer.writeAttribute("class", cssClass, null);
try {
+ //TODO nick - attrIconCollapsedValue == null?
AbstractPanelMenuItem.Icons iconCollapsed = AbstractPanelMenuItem.Icons.valueOf(attrIconCollapsedValue);
writer.startElement("div", null);
writer.writeAttribute("class", concatClasses("rf-pm-ico-colps", iconCollapsed.cssClass()), null);
writer.writeAttribute("style", styleElement("display", isExpanded ? "none" : "block"), null);
writer.endElement("div");
+ //TODO nick - I suggest to wrap only Enum.valueOf(...) into try/catch
} catch (IllegalArgumentException e) {
if(attrIconCollapsedValue != null && attrIconCollapsedValue.trim().length() != 0) {
writer.startElement(HtmlConstants.IMG_ELEMENT, null);
@@ -219,6 +232,7 @@
HtmlPanelMenuGroup panelMenuGroup = (HtmlPanelMenuGroup) component;
Map<String, Object> options = new HashMap<String, Object>();
+ //TODO nick - non-default values should not be rendered
options.put("ajax", getAjaxOptions(context, panelMenuGroup));
options.put("name", panelMenuGroup.getName());
options.put("mode", panelMenuGroup.getMode());
@@ -244,6 +258,7 @@
encodeContentEnd(writer, context, component);
writer.endElement(HtmlConstants.DIV_ELEM);
+ //TODO nick - call super.doEncodeEnd(...)?
}
@Override
Modified: trunk/ui/output/ui/src/main/java/org/richfaces/renderkit/html/PanelMenuItemRenderer.java
===================================================================
--- trunk/ui/output/ui/src/main/java/org/richfaces/renderkit/html/PanelMenuItemRenderer.java 2010-12-13 18:46:54 UTC (rev 20541)
+++ trunk/ui/output/ui/src/main/java/org/richfaces/renderkit/html/PanelMenuItemRenderer.java 2010-12-13 19:09:26 UTC (rev 20542)
@@ -23,22 +23,23 @@
package org.richfaces.renderkit.html;
+import static org.richfaces.renderkit.html.TogglePanelRenderer.addEventOption;
+import static org.richfaces.renderkit.html.TogglePanelRenderer.getAjaxOptions;
+
+import java.io.IOException;
+import java.util.HashMap;
+import java.util.Map;
+
+import javax.faces.component.UIComponent;
+import javax.faces.context.FacesContext;
+import javax.faces.context.ResponseWriter;
+
import org.ajax4jsf.javascript.JSObject;
import org.richfaces.component.AbstractPanelMenuItem;
import org.richfaces.component.html.HtmlPanelMenuItem;
import org.richfaces.renderkit.HtmlConstants;
import org.richfaces.renderkit.RenderKitUtils;
-import javax.faces.component.UIComponent;
-import javax.faces.context.FacesContext;
-import javax.faces.context.ResponseWriter;
-import java.io.IOException;
-import java.util.HashMap;
-import java.util.Map;
-
-import static org.richfaces.renderkit.html.TogglePanelRenderer.addEventOption;
-import static org.richfaces.renderkit.html.TogglePanelRenderer.getAjaxOptions;
-
/**
* @author akolonitsky
* @since 2010-10-25
@@ -63,6 +64,7 @@
private void encodeHeaderGroupBegin(ResponseWriter writer, FacesContext context, HtmlPanelMenuItem menuItem, String classPrefix) throws IOException {
writer.startElement("table", null);
writer.writeAttribute("class", classPrefix + "-gr", null);
+ //TODO nick - TBODY element is missing
writer.startElement("tr", null);
encodeHeaderGroupLeftIcon(writer, context, menuItem, classPrefix);
@@ -99,6 +101,7 @@
encodeTdIcon(writer, context, cssClasses, icon);
}
+ //TODO nick - the same as in PanelMenuGroupRenderer
public void encodeTdIcon(ResponseWriter writer, FacesContext context, String classPrefix, String attrIconValue) throws IOException {
writer.startElement("td", null);
try {
Modified: trunk/ui/output/ui/src/main/java/org/richfaces/renderkit/html/PanelMenuRenderer.java
===================================================================
--- trunk/ui/output/ui/src/main/java/org/richfaces/renderkit/html/PanelMenuRenderer.java 2010-12-13 18:46:54 UTC (rev 20541)
+++ trunk/ui/output/ui/src/main/java/org/richfaces/renderkit/html/PanelMenuRenderer.java 2010-12-13 19:09:26 UTC (rev 20542)
@@ -23,31 +23,33 @@
package org.richfaces.renderkit.html;
-import org.ajax4jsf.context.AjaxContext;
-import org.ajax4jsf.javascript.JSObject;
-import org.richfaces.component.AbstractPanelMenu;
-import org.richfaces.component.AbstractPanelMenuItem;
-import org.richfaces.component.html.HtmlPanelMenu;
-import org.richfaces.renderkit.HtmlConstants;
+import static org.richfaces.renderkit.html.TogglePanelRenderer.getAjaxOptions;
+import static org.richfaces.renderkit.html.TogglePanelRenderer.getValueRequestParamName;
+import java.io.IOException;
+import java.util.HashMap;
+import java.util.Map;
+
import javax.faces.application.ResourceDependencies;
import javax.faces.application.ResourceDependency;
import javax.faces.component.UIComponent;
import javax.faces.context.FacesContext;
import javax.faces.context.ResponseWriter;
import javax.faces.event.ActionEvent;
-import java.io.IOException;
-import java.util.HashMap;
-import java.util.Map;
-import static org.richfaces.renderkit.html.TogglePanelRenderer.getAjaxOptions;
-import static org.richfaces.renderkit.html.TogglePanelRenderer.getValueRequestParamName;
+import org.ajax4jsf.context.AjaxContext;
+import org.ajax4jsf.javascript.JSObject;
+import org.richfaces.component.AbstractPanelMenu;
+import org.richfaces.component.AbstractPanelMenuItem;
+import org.richfaces.component.html.HtmlPanelMenu;
+import org.richfaces.renderkit.HtmlConstants;
/**
* @author akolonitsky
* @since 2010-10-25
*/
@ResourceDependencies( { // TODO review
+ //TODO nick - use org.richfaces:ajax.reslib
@ResourceDependency(library = "javax.faces", name = "jsf.js"),
@ResourceDependency(name = "jquery.js"),
@ResourceDependency(name = "richfaces.js"),
@@ -67,11 +69,13 @@
context.getExternalContext().getRequestParameterMap();
// Don't overwrite the value unless you have to!
+ //TODO nick - getValueRequestParamName(...) is method of TogglePanelRenderer - how are these components connected?
String newValue = requestMap.get(getValueRequestParamName(context, component));
if (newValue != null) {
panelMenu.setSubmittedActiveItem(newValue);
}
+ //TODO nick - I suggest to get this code moved to item renderer
String compClientId = component.getClientId(context);
String clientId = requestMap.get(compClientId);
if (clientId != null && clientId.equals(compClientId)) {
@@ -79,6 +83,8 @@
AbstractPanelMenuItem panelItem = panelMenu.getItem(newValue);
if (panelItem != null) {
new ActionEvent(panelItem).queue();
+
+ //TODO nick - why render item by default?
context.getPartialViewContext().getRenderIds().add(panelItem.getClientId(context));
//TODO nick - this should be done on encode, not on decode
@@ -124,6 +130,7 @@
HtmlPanelMenu panelMenu = (HtmlPanelMenu) component;
Map<String, Object> options = new HashMap<String, Object>();
+ //TODO nick - only options with non-default values should be rendered
options.put("ajax", getAjaxOptions(context, panelMenu));
options.put("disabled", panelMenu.isDisabled());
options.put("expandSingle", panelMenu.isExpandSingle());
Modified: trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/panelMenu.js
===================================================================
--- trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/panelMenu.js 2010-12-13 18:46:54 UTC (rev 20541)
+++ trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/panelMenu.js 2010-12-13 19:09:26 UTC (rev 20542)
@@ -195,6 +195,7 @@
__addUserEventHandler : function (name) {
var handler = this.options["on" + name];
if (handler) {
+ //TODO nick - this will cause slowdowns in IE
rf.Event.bindById(this.id, name, handler);
}
},
Modified: trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/panelMenuGroup.js
===================================================================
--- trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/panelMenuGroup.js 2010-12-13 18:46:54 UTC (rev 20541)
+++ trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/panelMenuGroup.js 2010-12-13 19:09:26 UTC (rev 20542)
@@ -127,6 +127,7 @@
var menuGroup = this;
if (!this.options.selectable) {
+ //TODO nick - this can be replaced by jQuery.delegate on menu itself
this.__header().bind("click", function () {
return menuGroup.switchExpantion();
});
@@ -170,6 +171,7 @@
}
});
+ //TODO nick - why?
event.stopPropagation();
});
}
@@ -211,6 +213,7 @@
this.__collapse();
this.__childGroups().each (function(index, group) {
+ //TODO nick - why not group.collapse()?
rf.$(group.id).__collapse();
});
@@ -342,12 +345,14 @@
},
__fireCollapse : function () {
+ //TODO nick - 'new' should be removed
return new rf.Event.fireById(this.id, "collapse", {
id: this.id
});
},
__fireExpand : function () {
+ //TODO nick - 'new' should be removed
return new rf.Event.fireById(this.id, "expand", {
id: this.id
});
14 years, 1 month
JBoss Rich Faces SVN: r20541 - modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean.
by richfaces-svn-commits@lists.jboss.org
Author: lfryc(a)redhat.com
Date: 2010-12-13 13:46:54 -0500 (Mon, 13 Dec 2010)
New Revision: 20541
Modified:
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichFileUploadBean.java
Log:
fixed RichFileUploadBean dependency (UploadEvent > FileUploadEvent)
Modified: modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichFileUploadBean.java
===================================================================
--- modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichFileUploadBean.java 2010-12-13 18:46:10 UTC (rev 20540)
+++ modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichFileUploadBean.java 2010-12-13 18:46:54 UTC (rev 20541)
@@ -28,12 +28,13 @@
import javax.annotation.PostConstruct;
import javax.faces.bean.ManagedBean;
import javax.faces.bean.ViewScoped;
+
import org.richfaces.component.UIFileUpload;
-import org.richfaces.event.UploadEvent;
import org.richfaces.model.UploadedFile;
import org.richfaces.tests.metamer.Attributes;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
+import org.richfaces.event.FileUploadEvent;
/**
* Managed bean for rich:fileUpload.
@@ -82,7 +83,7 @@
return files;
}
- public void listener(UploadEvent event) {
+ public void listener(FileUploadEvent event) {
UploadedFile file = event.getUploadedFile();
if (file != null) {
14 years, 1 month
JBoss Rich Faces SVN: r20540 - in modules/tests/metamer/trunk/application: src/main/java/org/richfaces/tests/metamer/bean and 2 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: lfryc(a)redhat.com
Date: 2010-12-13 13:46:10 -0500 (Mon, 13 Dec 2010)
New Revision: 20540
Added:
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/model/treeAdaptor/LazyLoadingChecker.java
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/model/treeAdaptor/LazyLoadingListener.java
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/model/treeAdaptor/Reference.java
Modified:
modules/tests/metamer/trunk/application/pom.xml
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichTreeModelRecursiveAdaptorBean.java
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/model/treeAdaptor/ModelNode.java
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/model/treeAdaptor/Node.java
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/model/treeAdaptor/RecursiveNode.java
modules/tests/metamer/trunk/application/src/main/webapp/components/richTree/treeAdaptors.xhtml
Log:
added lazy loading checking capability (RF-9698)
Modified: modules/tests/metamer/trunk/application/pom.xml
===================================================================
--- modules/tests/metamer/trunk/application/pom.xml 2010-12-13 18:44:55 UTC (rev 20539)
+++ modules/tests/metamer/trunk/application/pom.xml 2010-12-13 18:46:10 UTC (rev 20540)
@@ -110,6 +110,12 @@
<artifactId>testng</artifactId>
<scope>test</scope>
</dependency>
+
+ <dependency>
+ <groupId>javassist</groupId>
+ <artifactId>javassist</artifactId>
+ <version>3.12.1.GA</version>
+ </dependency>
<!--
<dependency> <groupId>org.hibernate</groupId> <artifactId>hibernate-validator</artifactId>
Modified: modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichTreeModelRecursiveAdaptorBean.java
===================================================================
--- modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichTreeModelRecursiveAdaptorBean.java 2010-12-13 18:44:55 UTC (rev 20539)
+++ modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichTreeModelRecursiveAdaptorBean.java 2010-12-13 18:46:10 UTC (rev 20540)
@@ -22,7 +22,9 @@
package org.richfaces.tests.metamer.bean;
import java.io.Serializable;
+import java.util.LinkedHashSet;
import java.util.List;
+import java.util.Set;
import javax.annotation.PostConstruct;
import javax.faces.bean.ManagedBean;
@@ -30,7 +32,10 @@
import org.richfaces.component.UITreeModelRecursiveAdaptor;
import org.richfaces.tests.metamer.Attributes;
+import org.richfaces.tests.metamer.model.treeAdaptor.LazyLoadingListener;
+import org.richfaces.tests.metamer.model.treeAdaptor.Node;
import org.richfaces.tests.metamer.model.treeAdaptor.RecursiveNode;
+import org.richfaces.tests.metamer.model.treeAdaptor.Reference;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -48,6 +53,21 @@
private boolean leafChildrenNullable = true;
private transient List<RecursiveNode> rootNodes;
+ /*
+ * Nodes which was loaded lazily in the current request
+ */
+ private Set<Node> lazyInitializedNodes = new LinkedHashSet<Node>();
+
+ private LazyLoadingListener<Node> nodeLazyLoadingListener = new LazyLoadingListener<Node>() {
+ public void notify(Node node) {
+ lazyInitializedNodes.add(node);
+ };
+ };
+
+ public Set<Node> getLazyInitializedNodes() {
+ return lazyInitializedNodes;
+ }
+
/**
* Initializes the managed bean.
*/
@@ -71,7 +91,13 @@
public List<RecursiveNode> getRootNodes() {
if (rootNodes == null) {
- rootNodes = RecursiveNode.createChildren(null, leafChildrenNullable);
+ rootNodes = RecursiveNode.createChildren(null, leafChildrenNullable,
+ new Reference<LazyLoadingListener<Node>>() {
+ @Override
+ public LazyLoadingListener<Node> get() {
+ return nodeLazyLoadingListener;
+ }
+ });
}
return rootNodes;
}
Added: modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/model/treeAdaptor/LazyLoadingChecker.java
===================================================================
--- modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/model/treeAdaptor/LazyLoadingChecker.java (rev 0)
+++ modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/model/treeAdaptor/LazyLoadingChecker.java 2010-12-13 18:46:10 UTC (rev 20540)
@@ -0,0 +1,56 @@
+package org.richfaces.tests.metamer.model.treeAdaptor;
+
+import static java.lang.reflect.Modifier.isStatic;
+
+import java.lang.reflect.Method;
+
+import javassist.util.proxy.MethodHandler;
+import javassist.util.proxy.ProxyFactory;
+import javassist.util.proxy.ProxyObject;
+
+import org.apache.commons.lang.Validate;
+
+public final class LazyLoadingChecker<T> implements MethodHandler {
+
+ T instance;
+ Reference<LazyLoadingListener<T>> listenerReference = null;
+
+ private LazyLoadingChecker(T instance, Reference<LazyLoadingListener<T>> listenerReference) {
+ this.instance = instance;
+ this.listenerReference = listenerReference;
+ }
+
+ @SuppressWarnings("unchecked")
+ public static <T> T wrapInstance(T instance, Reference<LazyLoadingListener<T>> listenerReference) {
+ Validate.notNull(listenerReference);
+ ProxyFactory f = new ProxyFactory();
+ f.setSuperclass(instance.getClass());
+ Class<?> c = f.createClass();
+
+ T proxy;
+ try {
+ proxy = (T) c.newInstance();
+ } catch (InstantiationException e) {
+ throw new IllegalStateException(e);
+ } catch (IllegalAccessException e) {
+ throw new IllegalStateException(e);
+ }
+
+ ((ProxyObject) proxy).setHandler(new LazyLoadingChecker<T>(instance, listenerReference));
+ return proxy;
+ }
+
+ @Override
+ public Object invoke(Object self, Method m, Method proceed, Object[] args) throws Throwable {
+ if (!isStatic(m.getModifiers())) {
+ LazyLoadingListener<T> listener = listenerReference.get();
+ if (listener != null) {
+ listener.notify(instance);
+ } else {
+ throw new IllegalStateException();
+ }
+ }
+ Object result = m.invoke(instance, args);
+ return result;
+ }
+}
Added: modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/model/treeAdaptor/LazyLoadingListener.java
===================================================================
--- modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/model/treeAdaptor/LazyLoadingListener.java (rev 0)
+++ modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/model/treeAdaptor/LazyLoadingListener.java 2010-12-13 18:46:10 UTC (rev 20540)
@@ -0,0 +1,5 @@
+package org.richfaces.tests.metamer.model.treeAdaptor;
+
+public interface LazyLoadingListener<T> {
+ void notify(T instance);
+}
Modified: modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/model/treeAdaptor/ModelNode.java
===================================================================
--- modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/model/treeAdaptor/ModelNode.java 2010-12-13 18:44:55 UTC (rev 20539)
+++ modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/model/treeAdaptor/ModelNode.java 2010-12-13 18:46:10 UTC (rev 20540)
@@ -34,10 +34,18 @@
List<B> bs;
List<RecursiveNode> rs;
- public ModelNode(Node parent, boolean nullable) {
- super(parent, nullable);
+ public ModelNode() {
+ super(null, true, null);
}
+
+ protected ModelNode(Node parent, boolean nullable, Reference<LazyLoadingListener<Node>> lazyLoadingListenerReference) {
+ super(parent, nullable, lazyLoadingListenerReference);
+ }
+ public static ModelNode getInstance(Node parent, boolean nullable, Reference<LazyLoadingListener<Node>> lazyLoadingListenerReference) {
+ return lazyLoadingChecker(new ModelNode(parent, nullable, lazyLoadingListenerReference));
+ }
+
public String getLabel() {
return isRoot() ? "M" : parent.getLabel() + "-M";
}
@@ -58,7 +66,7 @@
public List<RecursiveNode> getRecursive() {
if (rs == null) {
- rs = RecursiveNode.createChildren(this, nullable);
+ rs = RecursiveNode.createChildren(this, nullable, null);
}
return rs;
}
@@ -80,6 +88,11 @@
return ModelNode.this.getLabel() + "-B-" + number;
}
}
+
+ @Override
+ public String toString() {
+ return getLabel();
+ }
private RecursiveNode getParentRecursive() {
for (Node predecessor : getPredecessorsFromRoot()) {
@@ -89,4 +102,5 @@
}
return null;
}
+
}
\ No newline at end of file
Modified: modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/model/treeAdaptor/Node.java
===================================================================
--- modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/model/treeAdaptor/Node.java 2010-12-13 18:44:55 UTC (rev 20539)
+++ modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/model/treeAdaptor/Node.java 2010-12-13 18:46:10 UTC (rev 20540)
@@ -32,12 +32,20 @@
Node parent;
boolean nullable;
- public Node(Node parent, boolean nullable) {
- super();
+ Reference<LazyLoadingListener<Node>> lazyLoadingListenerReference = new NodeReference();
+
+ protected Node(Node parent, boolean nullable, Reference<LazyLoadingListener<Node>> lazyLoadingListenerReference) {
this.parent = parent;
this.nullable = nullable;
+ if (lazyLoadingListenerReference != null) {
+ this.lazyLoadingListenerReference = lazyLoadingListenerReference;
+ }
}
+ public static <T extends Node> T lazyLoadingChecker(T node) {
+ return (T) LazyLoadingChecker.wrapInstance(node, node.getLazyLoadingListenerReference());
+ }
+
public Node getParent() {
return parent;
}
@@ -66,4 +74,23 @@
}
public abstract String getLabel();
+
+ public Reference<LazyLoadingListener<Node>> getLazyLoadingListenerReference() {
+ return lazyLoadingListenerReference;
+ }
+
+ public void setLazyLoadingListener(Reference<LazyLoadingListener<Node>> lazyLoadingListener) {
+ this.lazyLoadingListenerReference = lazyLoadingListener;
+ }
+
+ public class NodeReference implements Reference<LazyLoadingListener<Node>> {
+ @Override
+ public LazyLoadingListener<Node> get() {
+ Node root = getRoot();
+ if (root == Node.this) {
+ return null;
+ }
+ return getRoot().getLazyLoadingListenerReference().get();
+ }
+ }
}
Modified: modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/model/treeAdaptor/RecursiveNode.java
===================================================================
--- modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/model/treeAdaptor/RecursiveNode.java 2010-12-13 18:44:55 UTC (rev 20539)
+++ modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/model/treeAdaptor/RecursiveNode.java 2010-12-13 18:46:10 UTC (rev 20540)
@@ -37,11 +37,19 @@
List<RecursiveNode> children = null;
ModelNode model;
- public RecursiveNode(Node parent, boolean nullable, int number) {
- super(parent, nullable);
+ public RecursiveNode() {
+ super(null, true, null);
+ }
+
+ protected RecursiveNode(Node parent, boolean nullable, int number, Reference<LazyLoadingListener<Node>> lazyLoadingListenerReference) {
+ super(parent, nullable, lazyLoadingListenerReference);
this.number = number;
}
+ public static RecursiveNode getInstance(Node parent, boolean nullable, int number, Reference<LazyLoadingListener<Node>> lazyLoadingListenerReference) {
+ return lazyLoadingChecker(new RecursiveNode(parent, nullable, number, lazyLoadingListenerReference));
+ }
+
public int getNumber() {
return number;
}
@@ -55,7 +63,7 @@
return getEmpty();
}
if (children == null) {
- children = createChildren(this, nullable);
+ children = createChildren(this, nullable, null);
}
return children;
}
@@ -73,7 +81,7 @@
public ModelNode getModel() {
if (isLeaf() && !isPreceededByModel()) {
if (model == null) {
- model = new ModelNode(this, nullable);
+ model = ModelNode.getInstance(this, nullable, null);
}
return model;
}
@@ -92,10 +100,11 @@
}
}
- public static List<RecursiveNode> createChildren(Node parent, boolean nullable) {
+ public static List<RecursiveNode> createChildren(Node parent, boolean nullable, Reference<LazyLoadingListener<Node>> lazyLoadingListenerReference) {
List<RecursiveNode> children = new LinkedList<RecursiveNode>();
for (int i = 0; i < CHILDREN; i++) {
- children.add(new RecursiveNode(parent, nullable, i));
+ RecursiveNode node = RecursiveNode.getInstance(parent, nullable, i, lazyLoadingListenerReference);
+ children.add(node);
}
return children;
}
@@ -117,4 +126,9 @@
}
return this.number % 2 == 1;
}
+
+ @Override
+ public String toString() {
+ return getLabel();
+ }
}
\ No newline at end of file
Added: modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/model/treeAdaptor/Reference.java
===================================================================
--- modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/model/treeAdaptor/Reference.java (rev 0)
+++ modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/model/treeAdaptor/Reference.java 2010-12-13 18:46:10 UTC (rev 20540)
@@ -0,0 +1,6 @@
+package org.richfaces.tests.metamer.model.treeAdaptor;
+
+public interface Reference<T> {
+
+ public T get();
+}
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-13 18:44:55 UTC (rev 20539)
+++ modules/tests/metamer/trunk/application/src/main/webapp/components/richTree/treeAdaptors.xhtml 2010-12-13 18:46:10 UTC (rev 20540)
@@ -72,7 +72,9 @@
>
<a4j:ajax event="selectionchange" render="selectionOutput" />
+ <a4j:ajax event="nodetoggle" render="selectionOutput" />
+
<rich:treeModelRecursiveAdaptor
roots="#{richTreeModelRecursiveAdaptorBean.rootNodes}"
nodes="#{node.recursive}"
@@ -84,12 +86,6 @@
#{node.label}
</a4j:outputPanel>
</rich:treeNode>
-
- <!-- <rich:treeModelAdaptor nodes="{node.model.value}" rendered="{not empty node.model}">
- <rich:treeNode>
- {node}
- </rich:treeNode>
- </rich:treeModelAdaptor>-->
<rich:treeModelAdaptor nodes="#{node.model.list}" rendered="#{richTreeModelAdaptorBean.attributes['rendered'].value}">
<rich:treeNode>
@@ -98,7 +94,7 @@
</rich:treeModelAdaptor>
<rich:treeModelRecursiveAdaptor roots="#{node.model.recursive}" nodes="#{node.recursive}" rendered="#{richTreeModelRecursiveAdaptorBean.attributes['rendered'].value}">
- <rich:treeNode rendered="#{richTreeNodeBean.attributes['rendered'].value || node.number != 1}">
+ <rich:treeNode rendered="#{richTreeNodeBean.attributes['rendered'].value || node.number != 1}">
#{node.label}
</rich:treeNode>
</rich:treeModelRecursiveAdaptor>
@@ -109,9 +105,16 @@
<ui:define name="outOfTemplateAfter">
- <a4j:outputPanel id="selectionOutput">
+ <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:panelGrid>
+
+ <a4j:outputPanel>
+
</a4j:outputPanel>
<fieldset>
14 years, 1 month
JBoss Rich Faces SVN: r20539 - 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-13 13:44:55 -0500 (Mon, 13 Dec 2010)
New Revision: 20539
Modified:
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichTreeModelAdaptorBean.java
modules/tests/metamer/trunk/application/src/main/webapp/components/richTree/treeAdaptors.xhtml
Log:
rich:tree adaptors - added possibility to test @rendered (RF-9698
Modified: modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichTreeModelAdaptorBean.java
===================================================================
--- modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichTreeModelAdaptorBean.java 2010-12-13 18:44:26 UTC (rev 20538)
+++ modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichTreeModelAdaptorBean.java 2010-12-13 18:44:55 UTC (rev 20539)
@@ -53,6 +53,7 @@
logger.debug("initializing bean " + getClass().getName());
attributes = Attributes.getUIComponentAttributes(UITreeModelAdaptor.class, getClass(), false);
+ attributes.setAttribute("rendered", true);
}
public Attributes getAttributes() {
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-13 18:44:26 UTC (rev 20538)
+++ modules/tests/metamer/trunk/application/src/main/webapp/components/richTree/treeAdaptors.xhtml 2010-12-13 18:44:55 UTC (rev 20539)
@@ -77,7 +77,6 @@
roots="#{richTreeModelRecursiveAdaptorBean.rootNodes}"
nodes="#{node.recursive}"
recursionOrder="#{richTreeModelRecursiveAdaptorBean.attributes['recursionOrder'].value}"
- rendered="#{richTreeModelRecursiveAdaptorBean.attributes['rendered'].value}"
>
<rich:treeNode rendered="#{node.class.simpleName != 'RecursiveNode' || node.number != 1 || richTreeNodeBean.attributes['rendered'].value}">
@@ -92,13 +91,13 @@
</rich:treeNode>
</rich:treeModelAdaptor>-->
- <rich:treeModelAdaptor nodes="#{node.model.list}">
+ <rich:treeModelAdaptor nodes="#{node.model.list}" rendered="#{richTreeModelAdaptorBean.attributes['rendered'].value}">
<rich:treeNode>
#{node.label}
</rich:treeNode>
</rich:treeModelAdaptor>
- <rich:treeModelRecursiveAdaptor roots="#{node.model.recursive}" nodes="#{node.recursive}">
+ <rich:treeModelRecursiveAdaptor roots="#{node.model.recursive}" nodes="#{node.recursive}" rendered="#{richTreeModelRecursiveAdaptorBean.attributes['rendered'].value}">
<rich:treeNode rendered="#{richTreeNodeBean.attributes['rendered'].value || node.number != 1}">
#{node.label}
</rich:treeNode>
@@ -114,21 +113,32 @@
<h:outputLabel value="Selection: " />
<h:outputText value="#{richTreeBean.selection}" />
</a4j:outputPanel>
-
+
<fieldset>
<legend>rich:tree</legend>
- <metamer:attributes value="#{richTreeBean.attributes}" id="treeAttributes" />
+
+ <fieldset>
+ <legend>rich:treeModelRecursiveAdaptor [1]</legend>
+
+ <fieldset>
+ <legend>rich:treeNode</legend>
+ <metamer:attributes value="#{richTreeNodeBean.attributes}" id="nodeAttributes" />
+ </fieldset>
+
+ <fieldset>
+ <legend>rich:treeModelAdaptor</legend>
+ <metamer:attributes value="#{richTreeModelAdaptorBean.attributes}" id="listAttributes" />
+ </fieldset>
+
+ <fieldset>
+ <legend>rich:treeModelRecursiveAdaptor [2]</legend>
+ <metamer:attributes value="#{richTreeModelRecursiveAdaptorBean.attributes}" id="recursiveAttributes" />
+ </fieldset>
+ </fieldset>
+
+ <metamer:attributes value="#{richTreeBean.attributes}" id="treeAttributes" />
</fieldset>
- <fieldset>
- <legend>rich:treeModelRecursiveAdaptor</legend>
- <metamer:attributes value="#{richTreeModelRecursiveAdaptorBean.attributes}" id="nodeAttributes" />
- </fieldset>
-
- <fieldset>
- <legend>rich:treeNode</legend>
- <metamer:attributes value="#{richTreeNodeBean.attributes}" id="recursiveAttributes" />
- </fieldset>
</ui:define>
</ui:composition>
14 years, 1 month
JBoss Rich Faces SVN: r20538 - trunk.
by richfaces-svn-commits@lists.jboss.org
Author: alexsmirnov
Date: 2010-12-13 13:44:26 -0500 (Mon, 13 Dec 2010)
New Revision: 20538
Modified:
trunk/
Log:
Removed merge tracking for "svnmerge" for
https://svn.jboss.org/repos/richfaces/branches/RF-8742-1
Property changes on: trunk
___________________________________________________________________
Name: svnmerge-integrated
- /branches/RF-7817:1-19154 /branches/RF-8742:1-19867 /branches/RF-8742-1:1-20514 /branches/RF-9309:1-19112,19378
+ /branches/RF-7817:1-19154 /branches/RF-8742:1-19867 /branches/RF-9309:1-19112,19378
14 years, 1 month