JBoss Rich Faces SVN: r20953 - in trunk: examples/iteration-demo/src/main/webapp and 2 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: abelevich
Date: 2011-01-11 13:32:03 -0500 (Tue, 11 Jan 2011)
New Revision: 20953
Modified:
trunk/examples/iteration-demo/src/main/java/org/richfaces/demo/DataBean.java
trunk/examples/iteration-demo/src/main/webapp/dataTable.xhtml
trunk/ui/iteration/ui/src/main/java/org/richfaces/component/AbstractDataScroller.java
trunk/ui/iteration/ui/src/main/templates/datascroller.template.xml
Log:
RF-9780: 'renderIfSinglePage' attribute is added for dataScroller.
Modified: trunk/examples/iteration-demo/src/main/java/org/richfaces/demo/DataBean.java
===================================================================
--- trunk/examples/iteration-demo/src/main/java/org/richfaces/demo/DataBean.java 2011-01-11 17:33:06 UTC (rev 20952)
+++ trunk/examples/iteration-demo/src/main/java/org/richfaces/demo/DataBean.java 2011-01-11 18:32:03 UTC (rev 20953)
@@ -34,7 +34,7 @@
private String operation = "operation";
private boolean rendered = true;
-
+ private boolean renderIfSinglePage = true;
private List<Employee> employeeList;
private boolean state = true;
@@ -152,4 +152,12 @@
public Collection<Object> getSelectedRowKeys() {
return selectedRowKeys;
}
+
+ public boolean isRenderIfSinglePage() {
+ return renderIfSinglePage;
+ }
+
+ public void setRenderIfSinglePage(boolean renderIfSinglePage) {
+ this.renderIfSinglePage = renderIfSinglePage;
+ }
}
Modified: trunk/examples/iteration-demo/src/main/webapp/dataTable.xhtml
===================================================================
--- trunk/examples/iteration-demo/src/main/webapp/dataTable.xhtml 2011-01-11 17:33:06 UTC (rev 20952)
+++ trunk/examples/iteration-demo/src/main/webapp/dataTable.xhtml 2011-01-11 18:32:03 UTC (rev 20953)
@@ -1,139 +1,154 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
- xmlns:h="http://java.sun.com/jsf/html"
- xmlns:f="http://java.sun.com/jsf/core"
- xmlns:ui="http://java.sun.com/jsf/facelets"
- xmlns:it="http://richfaces.org/iteration"
- xmlns:misc="http://richfaces.org/misc">
-<f:view contentType="text/html" />
+ xmlns:h="http://java.sun.com/jsf/html"
+ xmlns:f="http://java.sun.com/jsf/core"
+ xmlns:ui="http://java.sun.com/jsf/facelets"
+ xmlns:it="http://richfaces.org/iteration"
+ xmlns:misc="http://richfaces.org/misc"
+ xmlns:a4j="http://richfaces.org/a4j">
+<f:view contentType="text/html"/>
<h:head>
- <title>Richfaces Tables</title>
+ <title>Richfaces Tables</title>
</h:head>
<h:body>
- <h:form id="form1">
- <it:dataScroller id="scroller1" for="richTable" page="#{dataBean.page}" maxPages="7"></it:dataScroller>
-
- <it:dataTable keepSaved="true" id="richTable" var="record" rowKeyVar="rowKey" value="#{dataBean.employeeList}" rows="20" sortMode="single">
- <f:facet name="caption">
- <h:outputText id="captioFacet1" value="Caption Facet" />
- </f:facet>
+ <h:form id="form1">
+ <it:dataScroller id="scroller1" for="richTable" page="#{dataBean.page}" maxPages="7"></it:dataScroller>
- <f:facet name="header">
- <h:outputText value="header"/>
- </f:facet>
+ <it:dataTable keepSaved="true" id="richTable" var="record" rowKeyVar="rowKey" value="#{dataBean.employeeList}"
+ rows="20" sortMode="single">
+ <f:facet name="caption">
+ <h:outputText id="captioFacet1" value="Caption Facet"/>
+ </f:facet>
- <it:column id="column_name" sortBy="#{record.name}"
- sortIconAsc="resources/images/asc.gif"
- sortIconDesc="resources/images/desc.gif"
- sortIconUnsort="resources/images/unsort.gif">
- <f:facet name="header">
- <h:outputText id="columnHeader1" value="Column Header Facet" />
- </f:facet>
+ <f:facet name="header">
+ <h:outputText value="header"/>
+ </f:facet>
- <it:collapsibleSubTableToggler for="collapsibleSubTable">
- </it:collapsibleSubTableToggler>
+ <it:column id="column_name" sortBy="#{record.name}"
+ sortIconAsc="resources/images/asc.gif"
+ sortIconDesc="resources/images/desc.gif"
+ sortIconUnsort="resources/images/unsort.gif">
+ <f:facet name="header">
+ <h:outputText id="columnHeader1" value="Column Header Facet"/>
+ </f:facet>
- <h:outputText value="#{record.name}" />
- <f:facet name="footer">
- <h:outputText id="columnFooter1" value="Column Footer Facet 1" />
- </f:facet>
- </it:column>
+ <it:collapsibleSubTableToggler for="collapsibleSubTable">
+ </it:collapsibleSubTableToggler>
- <it:column id="column_title" sortBy="#{record.title}"
- sortIconAsc="resources/images/asc.gif"
- sortIconDesc="resources/images/desc.gif"
- sortIconUnsort="resources/images/unsort.gif">
- <f:facet name="header">
- <h:outputText id="columnHeader2" value="Column Header Facet 2" />
- </f:facet>
- <h:outputText value="#{record.title}" />
- </it:column>
+ <h:outputText value="#{record.name}"/>
+ <f:facet name="footer">
+ <h:outputText id="columnFooter1" value="Column Footer Facet 1"/>
+ </f:facet>
+ </it:column>
- <it:column id="column_email">
- <h:outputText value="#{record.EMail}" />
- </it:column>
+ <it:column id="column_title" sortBy="#{record.title}"
+ sortIconAsc="resources/images/asc.gif"
+ sortIconDesc="resources/images/desc.gif"
+ sortIconUnsort="resources/images/unsort.gif">
+ <f:facet name="header">
+ <h:outputText id="columnHeader2" value="Column Header Facet 2"/>
+ </f:facet>
+ <h:outputText value="#{record.title}"/>
+ </it:column>
- <it:collapsibleSubTable id="collapsibleSubTable" var="company"
- value="#{record.companies}" rows="1" switchType="ajax"
- expanded="true">
- <f:facet name="header">
- <it:dataScroller id="subscroller" for="collapsibleSubTable"
- maxPages="3"></it:dataScroller>
- </f:facet>
+ <it:column id="column_email">
+ <h:outputText value="#{record.EMail}"/>
+ </it:column>
- <f:facet name="footer">
- <h:outputText value="footer" />
- </f:facet>
+ <it:collapsibleSubTable id="collapsibleSubTable" var="company"
+ value="#{record.companies}" rows="1" switchType="ajax"
+ expanded="true">
+ <f:facet name="header">
+ <it:dataScroller id="subscroller" for="collapsibleSubTable"
+ maxPages="3"></it:dataScroller>
+ </f:facet>
- <it:column id="column_company_name">
- <h:outputText value="#{company.name}" />
- </it:column>
+ <f:facet name="footer">
+ <h:outputText value="footer"/>
+ </f:facet>
- <it:column id="column_company_state">
- <h:outputText value="#{company.state}" />
- </it:column>
+ <it:column id="column_company_name">
+ <h:outputText value="#{company.name}"/>
+ </it:column>
- <it:column id="column_company_phone">
- <h:outputText value="#{company.phone}" />
- </it:column>
- </it:collapsibleSubTable>
+ <it:column id="column_company_state">
+ <h:outputText value="#{company.state}"/>
+ </it:column>
- <f:facet name="footer">
- <it:dataScroller id="scroller3" for="richTable" page="#{dataBean.page}" maxPages="7"></it:dataScroller>
- </f:facet>
+ <it:column id="column_company_phone">
+ <h:outputText value="#{company.phone}"/>
+ </it:column>
+ </it:collapsibleSubTable>
- </it:dataTable>
-
-
+ <f:facet name="footer">
+ <it:dataScroller id="scroller3" for="richTable" page="#{dataBean.page}" maxPages="7"></it:dataScroller>
+ </f:facet>
- <br />
+ </it:dataTable>
- <!-- cc:componentControl event="click" target="#{dataBean.target}" operation="#{dataBean.operation}">
- <f:param name="event" value="event"/>
- <cc:hashParam>
- <f:param name="key1" value="value1"/>
- <f:param name="key2" value="value2"/>
- <f:param name="key3" value="value3"/>
- <cc:hashParam name="nested1">
- <f:param name="key11" value="value11"/>
- </cc:hashParam>
- </cc:hashParam>
- <cc:hashParameter name="hashkey1">
- <f:param name="keyhash1" value="value1"/>
- <f:param name="keyhash2" value="value2"/>
- </cc:hashParameter>
- <h:commandButton value="richfaces1"/>
- <h:commandButton value="richfaces2"/>
- </cc:componentControl -->
+ <br/>
- <h:commandButton value="next">
- <misc:componentControl event="click" target="form1:scroller1"
- operation="switchToPage">
- <f:param value="fastforward" />
- </misc:componentControl>
- </h:commandButton>
+ <!-- cc:componentControl event="click" target="#{dataBean.target}" operation="#{dataBean.operation}">
+ <f:param name="event" value="event"/>
+ <cc:hashParam>
+ <f:param name="key1" value="value1"/>
+ <f:param name="key2" value="value2"/>
+ <f:param name="key3" value="value3"/>
+ <cc:hashParam name="nested1">
+ <f:param name="key11" value="value11"/>
+ </cc:hashParam>
+ </cc:hashParam>
+ <cc:hashParameter name="hashkey1">
+ <f:param name="keyhash1" value="value1"/>
+ <f:param name="keyhash2" value="value2"/>
+ </cc:hashParameter>
+ <h:commandButton value="richfaces1"/>
+ <h:commandButton value="richfaces2"/>
+ </cc:componentControl -->
- <h:commandButton value="previous">
- <misc:componentControl event="click" target="form1:scroller1"
- operation="previous" />
- </h:commandButton>
- <h:commandButton value="sort">
- <misc:componentControl event="click" target="form1:richTable"
- operation="sort">
- <f:param value="column_title" />
- </misc:componentControl>
- </h:commandButton>
+ <h:commandButton value="next">
+ <misc:componentControl event="click" target="form1:scroller1"
+ operation="switchToPage">
+ <f:param value="fastforward"/>
+ </misc:componentControl>
+ </h:commandButton>
- <h:commandButton value="unsort">
- <misc:componentControl event="click" target="form1:richTable"
- operation="sort">
- </misc:componentControl>
- </h:commandButton>
+ <h:commandButton value="previous">
+ <misc:componentControl event="click" target="form1:scroller1"
+ operation="previous"/>
+ </h:commandButton>
- </h:form>
+ <h:commandButton value="sort">
+ <misc:componentControl event="click" target="form1:richTable"
+ operation="sort">
+ <f:param value="column_title"/>
+ </misc:componentControl>
+ </h:commandButton>
+
+ <h:commandButton value="unsort">
+ <misc:componentControl event="click" target="form1:richTable"
+ operation="sort">
+ </misc:componentControl>
+ </h:commandButton>
+
+ </h:form>
+ <br />
+ <h:form id="renderIfSinglePage_form">
+ <h:outputText value="DataScroller: attribute 'renderIfSinglePage' with empty table"/>
+ <br />
+ <it:dataScroller id="scroller2" for="richTable2" page="#{dataBean.page}"
+ renderIfSinglePage="#{dataBean.renderIfSinglePage}"/>
+ <it:dataTable id="richTable2" />
+ <h:selectOneRadio layout="pagedirection" value="#{dataBean.renderIfSinglePage}">
+ <f:selectItem itemValue="true" itemLabel="Set renderIfSinglePage 'true'"/>
+ <f:selectItem itemValue="false" itemLabel="Set renderIfSinglePage 'false'"/>
+ <a4j:ajax render="renderIfSinglePage_form" />
+ </h:selectOneRadio>
+ </h:form>
</h:body>
</html>
Modified: trunk/ui/iteration/ui/src/main/java/org/richfaces/component/AbstractDataScroller.java
===================================================================
--- trunk/ui/iteration/ui/src/main/java/org/richfaces/component/AbstractDataScroller.java 2011-01-11 17:33:06 UTC (rev 20952)
+++ trunk/ui/iteration/ui/src/main/java/org/richfaces/component/AbstractDataScroller.java 2011-01-11 18:32:03 UTC (rev 20953)
@@ -88,6 +88,9 @@
private Integer page;
+ @Attribute(defaultValue = "true")
+ public abstract boolean isRenderIfSinglePage();
+
@Attribute
public abstract String getLastPageMode();
@@ -127,7 +130,7 @@
public String getFor() {
return (String)getStateHelper().eval("for");
}
-
+
public void setFor(String forId) {
getStateHelper().put("for", forId);
}
Modified: trunk/ui/iteration/ui/src/main/templates/datascroller.template.xml
===================================================================
--- trunk/ui/iteration/ui/src/main/templates/datascroller.template.xml 2011-01-11 17:33:06 UTC (rev 20952)
+++ trunk/ui/iteration/ui/src/main/templates/datascroller.template.xml 2011-01-11 18:32:03 UTC (rev 20953)
@@ -37,78 +37,80 @@
<cc:implementation>
- <cdk:object type="org.richfaces.renderkit.ControlsState" name="controlsState" value="#{getControlsState(facesContext,component)}" />
-
- <span id="#{clientId}" class="rf-ds"><!-- Now decor is disabled !!! -->
-
- <c:if test="#{controlsState.firstRendered}">
- <cdk:object type="boolean" name="isEnabled" value="#{controlsState.firstEnabled}"/>
- <cdk:object type="UIComponent" name="facet" value="#{component.getFacet('first')}"/>
- <cdk:object type="String" name="enabledStyles" value="rf-ds-btn rf-ds-btn-first"/>
- <cdk:object type="String" name="disabledStyles" value="rf-ds-btn rf-ds-btn-first rf-ds-dis"/>
- <cdk:object type="String" name="id" value="#{clientId}_ds_f"/>
- <cdk:object type="String" name="defaultText" value="««««"/>
- <xi:include xpointer="xpointer(/*)" href="buttons.template.include" />
- </c:if>
-
- <c:if test="#{controlsState.fastRewindRendered}">
- <cdk:object type="boolean" name="isEnabled" value="#{controlsState.fastRewindEnabled}"/>
- <cdk:object type="UIComponent" name="facet" value="#{component.getFacet('fastRewind')}"/>
- <cdk:object type="java.lang.String" name="enabledStyles" value="rf-ds-btn rf-ds-btn-fastrwd"/>
- <cdk:object type="java.lang.String" name="disabledStyles" value="rf-ds-btn rf-ds-btn-fastrwd rf-ds-dis"/>
- <cdk:object type="java.lang.String" name="id" value="#{clientId}_ds_fr"/>
- <cdk:object type="java.lang.String" name="defaultText" value="««"/>
- <xi:include xpointer="xpointer(/*)" href="buttons.template.include" />
- </c:if>
-
- <c:if test="#{controlsState.previousRendered}">
- <cdk:object name="isEnabled" value="#{controlsState.previousEnabled}"/>
- <cdk:object name="facet" value="#{component.getFacet('previous')}"/>
- <cdk:object type="java.lang.String" name="enabledStyles" value="rf-ds-btn rf-ds-btn-prev"/>
- <cdk:object type="java.lang.String" name="disabledStyles" value="rf-ds-btn rf-ds-btn-prev rf-ds-dis"/>
- <cdk:object name="id" value="#{clientId}_ds_prev"/>
- <cdk:object name="defaultText" value="«"/>
- <xi:include xpointer="xpointer(/*)" href="buttons.template.include" />
- </c:if>
-
- <cdk:object type="java.util.Map" name="digitals" value="#{renderPager(responseWriter, facesContext, component)}" />
-
- <c:if test="#{controlsState.nextRendered}">
- <cdk:object name="isEnabled" value="#{controlsState.nextEnabled}"/>
- <cdk:object name="facet" value="#{component.getFacet('next')}"/>
- <cdk:object type="java.lang.String" name="enabledStyles" value="rf-ds-btn rf-ds-btn-next"/>
- <cdk:object type="java.lang.String" name="disabledStyles" value="rf-ds-btn rf-ds-btn-next rf-ds-dis"/>
- <cdk:object name="id" value="#{clientId}_ds_next"/>
- <cdk:object name="defaultText" value="»"/>
- <xi:include xpointer="xpointer(/*)" href="buttons.template.include" />
- </c:if>
-
- <c:if test="#{controlsState.fastForwardRendered}">
- <cdk:object name="isEnabled" value="#{controlsState.fastForwardEnabled}"/>
- <cdk:object name="facet" value="#{component.getFacet('fastForward')}"/>
- <cdk:object type="java.lang.String" name="enabledStyles" value="rf-ds-btn rf-ds-btn-fastfwd"/>
- <cdk:object type="java.lang.String" name="disabledStyles" value="rf-ds-btn rf-ds-btn-fastfwd rf-ds-dis"/>
- <cdk:object name="id" value="#{clientId}_ds_ff"/>
- <cdk:object name="defaultText" value="»»"/>
- <xi:include xpointer="xpointer(/*)" href="buttons.template.include" />
- </c:if>
-
- <c:if test="#{controlsState.lastRendered}">
- <cdk:object name="isEnabled" value="#{controlsState.lastEnabled}"/>
- <cdk:object name="facet" value="#{component.getFacet('last')}"/>
- <cdk:object type="java.lang.String" name="enabledStyles" value="rf-ds-btn rf-ds-btn-last"/>
- <cdk:object type="java.lang.String" name="disabledStyles" value="rf-ds-btn rf-ds-btn-last rf-ds-dis"/>
- <cdk:object name="id" value="#{clientId}_ds_l"/>
- <cdk:object name="defaultText" value="»»»»"/>
- <xi:include xpointer="xpointer(/*)" href="buttons.template.include" />
- </c:if>
-
- <cdk:object type="java.util.Map" name="buttons" value="#{getControls(facesContext, component, controlsState)}" />
+ <cdk:object type="org.richfaces.renderkit.ControlsState" name="controlsState" value="#{getControlsState(facesContext,component)}" />
- <script type="text/javascript">
- <cdk:call expression="buildScript(responseWriter, facesContext, component, buttons, digitals);"/>
- </script>
- </span>
+ <c:if test="#{component.attributes['renderIfSinglePage']}">
+ <span id="#{clientId}" class="rf-ds"><!-- Now decor is disabled !!! -->
+
+ <c:if test="#{controlsState.firstRendered}">
+ <cdk:object type="boolean" name="isEnabled" value="#{controlsState.firstEnabled}"/>
+ <cdk:object type="UIComponent" name="facet" value="#{component.getFacet('first')}"/>
+ <cdk:object type="String" name="enabledStyles" value="rf-ds-btn rf-ds-btn-first"/>
+ <cdk:object type="String" name="disabledStyles" value="rf-ds-btn rf-ds-btn-first rf-ds-dis"/>
+ <cdk:object type="String" name="id" value="#{clientId}_ds_f"/>
+ <cdk:object type="String" name="defaultText" value="««««"/>
+ <xi:include xpointer="xpointer(/*)" href="buttons.template.include" />
+ </c:if>
+
+ <c:if test="#{controlsState.fastRewindRendered}">
+ <cdk:object type="boolean" name="isEnabled" value="#{controlsState.fastRewindEnabled}"/>
+ <cdk:object type="UIComponent" name="facet" value="#{component.getFacet('fastRewind')}"/>
+ <cdk:object type="java.lang.String" name="enabledStyles" value="rf-ds-btn rf-ds-btn-fastrwd"/>
+ <cdk:object type="java.lang.String" name="disabledStyles" value="rf-ds-btn rf-ds-btn-fastrwd rf-ds-dis"/>
+ <cdk:object type="java.lang.String" name="id" value="#{clientId}_ds_fr"/>
+ <cdk:object type="java.lang.String" name="defaultText" value="««"/>
+ <xi:include xpointer="xpointer(/*)" href="buttons.template.include" />
+ </c:if>
+
+ <c:if test="#{controlsState.previousRendered}">
+ <cdk:object name="isEnabled" value="#{controlsState.previousEnabled}"/>
+ <cdk:object name="facet" value="#{component.getFacet('previous')}"/>
+ <cdk:object type="java.lang.String" name="enabledStyles" value="rf-ds-btn rf-ds-btn-prev"/>
+ <cdk:object type="java.lang.String" name="disabledStyles" value="rf-ds-btn rf-ds-btn-prev rf-ds-dis"/>
+ <cdk:object name="id" value="#{clientId}_ds_prev"/>
+ <cdk:object name="defaultText" value="«"/>
+ <xi:include xpointer="xpointer(/*)" href="buttons.template.include" />
+ </c:if>
+
+ <cdk:object type="java.util.Map" name="digitals" value="#{renderPager(responseWriter, facesContext, component)}" />
+
+ <c:if test="#{controlsState.nextRendered}">
+ <cdk:object name="isEnabled" value="#{controlsState.nextEnabled}"/>
+ <cdk:object name="facet" value="#{component.getFacet('next')}"/>
+ <cdk:object type="java.lang.String" name="enabledStyles" value="rf-ds-btn rf-ds-btn-next"/>
+ <cdk:object type="java.lang.String" name="disabledStyles" value="rf-ds-btn rf-ds-btn-next rf-ds-dis"/>
+ <cdk:object name="id" value="#{clientId}_ds_next"/>
+ <cdk:object name="defaultText" value="»"/>
+ <xi:include xpointer="xpointer(/*)" href="buttons.template.include" />
+ </c:if>
+
+ <c:if test="#{controlsState.fastForwardRendered}">
+ <cdk:object name="isEnabled" value="#{controlsState.fastForwardEnabled}"/>
+ <cdk:object name="facet" value="#{component.getFacet('fastForward')}"/>
+ <cdk:object type="java.lang.String" name="enabledStyles" value="rf-ds-btn rf-ds-btn-fastfwd"/>
+ <cdk:object type="java.lang.String" name="disabledStyles" value="rf-ds-btn rf-ds-btn-fastfwd rf-ds-dis"/>
+ <cdk:object name="id" value="#{clientId}_ds_ff"/>
+ <cdk:object name="defaultText" value="»»"/>
+ <xi:include xpointer="xpointer(/*)" href="buttons.template.include" />
+ </c:if>
+
+ <c:if test="#{controlsState.lastRendered}">
+ <cdk:object name="isEnabled" value="#{controlsState.lastEnabled}"/>
+ <cdk:object name="facet" value="#{component.getFacet('last')}"/>
+ <cdk:object type="java.lang.String" name="enabledStyles" value="rf-ds-btn rf-ds-btn-last"/>
+ <cdk:object type="java.lang.String" name="disabledStyles" value="rf-ds-btn rf-ds-btn-last rf-ds-dis"/>
+ <cdk:object name="id" value="#{clientId}_ds_l"/>
+ <cdk:object name="defaultText" value="»»»»"/>
+ <xi:include xpointer="xpointer(/*)" href="buttons.template.include" />
+ </c:if>
+
+ <cdk:object type="java.util.Map" name="buttons" value="#{getControls(facesContext, component, controlsState)}" />
+
+ <script type="text/javascript">
+ <cdk:call expression="buildScript(responseWriter, facesContext, component, buttons, digitals);"/>
+ </script>
+ </span>
+ </c:if>
</cc:implementation>
</cdk:root>
\ No newline at end of file
13 years, 11 months
JBoss Rich Faces SVN: r20952 - modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richToolbar.
by richfaces-svn-commits@lists.jboss.org
Author: ppitonak(a)redhat.com
Date: 2011-01-11 12:33:06 -0500 (Tue, 11 Jan 2011)
New Revision: 20952
Modified:
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richToolbar/TestRichToolbar.java
Log:
https://issues.jboss.org/browse/RFPL-954
* added 4 tests for itemSeparator
Modified: modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richToolbar/TestRichToolbar.java
===================================================================
--- modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richToolbar/TestRichToolbar.java 2011-01-11 16:30:44 UTC (rev 20951)
+++ modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richToolbar/TestRichToolbar.java 2011-01-11 17:33:06 UTC (rev 20952)
@@ -21,6 +21,8 @@
*******************************************************************************/
package org.richfaces.tests.metamer.ftest.richToolbar;
+import static org.jboss.test.selenium.locator.LocatorFactory.jq;
+import static org.jboss.test.selenium.locator.option.OptionLocatorFactory.optionLabel;
import static org.jboss.test.selenium.utils.URLUtils.buildUrl;
import static org.testng.Assert.assertFalse;
import static org.testng.Assert.assertTrue;
@@ -28,6 +30,8 @@
import java.net.URL;
import org.jboss.test.selenium.dom.Event;
+import org.jboss.test.selenium.locator.Attribute;
+import org.jboss.test.selenium.locator.AttributeLocator;
import org.jboss.test.selenium.locator.JQueryLocator;
import org.richfaces.tests.metamer.ftest.AbstractMetamerTest;
import org.richfaces.tests.metamer.ftest.annotations.Inject;
@@ -47,9 +51,13 @@
private JQueryLocator[] items = {pjq("td[id$=createDocument_itm]"), pjq("td[id$=createFolder_itm]"),
pjq("td[id$=copy_itm]"), pjq("td[id$=save_itm]"), pjq("td[id$=saveAs_itm]"), pjq("td[id$=saveAll_itm]"),
pjq("td[id$=input_itm]"), pjq("td[id$=button_itm]")};
+ private String[] separators = {"disc", "grid", "line", "square"};
@Inject
@Use(empty = true)
private JQueryLocator item;
+ @Inject
+ @Use(empty = true)
+ private String itemSeparator;
@Override
public URL getTestUrl() {
@@ -85,6 +93,65 @@
}
@Test
+ @Use(field = "itemSeparator", value = "separators")
+ public void testItemSeparatorCorrect() {
+ JQueryLocator input = pjq("select[id$=itemSeparatorInput]");
+ selenium.select(input, optionLabel(itemSeparator));
+ selenium.waitForPageToLoad();
+
+ JQueryLocator separatorDiv = separator.getDescendant(jq("div.rf-tb-sep-" + itemSeparator));
+
+ assertTrue(selenium.isElementPresent(separator), "Item separator should be present on the page.");
+ assertTrue(selenium.isElementPresent(separatorDiv), "Item separator does not work correctly.");
+ }
+
+ @Test
+ public void testItemSeparatorNone() {
+ JQueryLocator input = pjq("select[id$=itemSeparatorInput]");
+ selenium.select(input, optionLabel("none"));
+ selenium.waitForPageToLoad();
+
+ assertFalse(selenium.isElementPresent(separator), "Item separator should not be present on the page.");
+
+ selenium.select(input, optionLabel("null"));
+ selenium.waitForPageToLoad();
+
+ assertFalse(selenium.isElementPresent(separator), "Item separator should not be present on the page.");
+ }
+
+ @Test
+ public void testItemSeparatorCustom() {
+ JQueryLocator input = pjq("select[id$=itemSeparatorInput]");
+ selenium.select(input, optionLabel("star"));
+ selenium.waitForPageToLoad();
+
+ JQueryLocator separatorImg = separator.getDescendant(jq("> img"));
+ AttributeLocator attr = separatorImg.getAttribute(Attribute.SRC);
+
+ assertTrue(selenium.isElementPresent(separator), "Item separator should be present on the page.");
+ assertTrue(selenium.isElementPresent(separatorImg), "Item separator does not work correctly.");
+
+ String src = selenium.getAttribute(attr);
+ assertTrue(src.contains("star.png"), "Separator's image should link to picture star.png.");
+ }
+
+ @Test
+ public void testItemSeparatorNonExisting() {
+ JQueryLocator input = pjq("select[id$=itemSeparatorInput]");
+ selenium.select(input, optionLabel("non-existing"));
+ selenium.waitForPageToLoad();
+
+ JQueryLocator separatorImg = separator.getDescendant(jq("> img"));
+ AttributeLocator attr = separatorImg.getAttribute(Attribute.SRC);
+
+ assertTrue(selenium.isElementPresent(separator), "Item separator should be present on the page.");
+ assertTrue(selenium.isElementPresent(separatorImg), "Item separator does not work correctly.");
+
+ String src = selenium.getAttribute(attr);
+ assertTrue(src.contains("non-existing"), "Separator's image should link to \"non-existing\".");
+ }
+
+ @Test
@Use(field = "item", value = "items")
public void testItemStyle() {
testStyle(item, "itemStyle");
13 years, 11 months
JBoss Rich Faces SVN: r20951 - in modules/tests/metamer/trunk: ftest-source/src/main/java/org/richfaces/tests/metamer/ftest and 1 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: ppitonak(a)redhat.com
Date: 2011-01-11 11:30:44 -0500 (Tue, 11 Jan 2011)
New Revision: 20951
Added:
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richToolbar/
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richToolbar/TestRichToolbar.java
Modified:
modules/tests/metamer/trunk/application/src/main/webapp/components/richToolbar/simple.xhtml
Log:
https://issues.jboss.org/browse/RFPL-954
* added 17 tests for rich:toolbar
Modified: modules/tests/metamer/trunk/application/src/main/webapp/components/richToolbar/simple.xhtml
===================================================================
--- modules/tests/metamer/trunk/application/src/main/webapp/components/richToolbar/simple.xhtml 2011-01-11 16:27:52 UTC (rev 20950)
+++ modules/tests/metamer/trunk/application/src/main/webapp/components/richToolbar/simple.xhtml 2011-01-11 16:30:44 UTC (rev 20951)
@@ -6,7 +6,7 @@
<!--
JBoss, Home of Professional Open Source
-Copyright 2010, Red Hat, Inc. and individual contributors
+Copyright 2010-2011, Red Hat, Inc. and individual contributors
by the @authors tag. See the copyright.txt in the distribution for a
full listing of individual contributors.
@@ -69,19 +69,20 @@
rendered="#{richToolbarBean.attributes['rendered'].value}"
style="#{richToolbarBean.attributes['style'].value}"
styleClass="#{richToolbarBean.attributes['styleClass'].value}"
+ title="#{richToolbarBean.attributes['title'].value}"
width="#{richToolbarBean.attributes['width'].value}"
>
<rich:toolbarGroup>
- <h:graphicImage library="images/icons" name="create_doc.gif" styleClass="pic" />
- <h:graphicImage library="images/icons" name="create_folder.gif" styleClass="pic" />
- <h:graphicImage library="images/icons" name="copy.gif" styleClass="pic" />
+ <h:graphicImage id="createDocument" library="images/icons" name="create_doc.gif" styleClass="pic" />
+ <h:graphicImage id="createFolder" library="images/icons" name="create_folder.gif" styleClass="pic" />
+ <h:graphicImage id="copy" library="images/icons" name="copy.gif" styleClass="pic" />
</rich:toolbarGroup>
<rich:toolbarGroup>
- <h:graphicImage library="images/icons" name="save.gif" styleClass="pic" />
- <h:graphicImage library="images/icons" name="save_as.gif" styleClass="pic" />
- <h:graphicImage library="images/icons" name="save_all.gif" styleClass="pic" />
+ <h:graphicImage id="save" library="images/icons" name="save.gif" styleClass="pic" />
+ <h:graphicImage id="saveAs" library="images/icons" name="save_as.gif" styleClass="pic" />
+ <h:graphicImage id="saveAll" library="images/icons" name="save_all.gif" styleClass="pic" />
</rich:toolbarGroup>
<rich:toolbarGroup location="right">
Added: modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richToolbar/TestRichToolbar.java
===================================================================
--- modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richToolbar/TestRichToolbar.java (rev 0)
+++ modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richToolbar/TestRichToolbar.java 2011-01-11 16:30:44 UTC (rev 20951)
@@ -0,0 +1,170 @@
+/*******************************************************************************
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010-2011, Red Hat, Inc. and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ *******************************************************************************/
+package org.richfaces.tests.metamer.ftest.richToolbar;
+
+import static org.jboss.test.selenium.utils.URLUtils.buildUrl;
+import static org.testng.Assert.assertFalse;
+import static org.testng.Assert.assertTrue;
+
+import java.net.URL;
+
+import org.jboss.test.selenium.dom.Event;
+import org.jboss.test.selenium.locator.JQueryLocator;
+import org.richfaces.tests.metamer.ftest.AbstractMetamerTest;
+import org.richfaces.tests.metamer.ftest.annotations.Inject;
+import org.richfaces.tests.metamer.ftest.annotations.Use;
+import org.testng.annotations.Test;
+
+/**
+ * Test case for page /faces/components/richToolbar/simple.xhtml
+ *
+ * @author <a href="mailto:ppitonak@redhat.com">Pavol Pitonak</a>
+ * @version $Revision$
+ */
+public class TestRichToolbar extends AbstractMetamerTest {
+
+ private JQueryLocator toolbar = pjq("table[id$=toolbar]");
+ private JQueryLocator separator = pjq("td.rf-tb-sep");
+ private JQueryLocator[] items = {pjq("td[id$=createDocument_itm]"), pjq("td[id$=createFolder_itm]"),
+ pjq("td[id$=copy_itm]"), pjq("td[id$=save_itm]"), pjq("td[id$=saveAs_itm]"), pjq("td[id$=saveAll_itm]"),
+ pjq("td[id$=input_itm]"), pjq("td[id$=button_itm]")};
+ @Inject
+ @Use(empty = true)
+ private JQueryLocator item;
+
+ @Override
+ public URL getTestUrl() {
+ return buildUrl(contextPath, "faces/components/richToolbar/simple.xhtml");
+ }
+
+ @Test
+ public void testInit() {
+ assertTrue(selenium.isElementPresent(toolbar), "Toolbar should be present on the page.");
+ assertTrue(selenium.isVisible(toolbar), "Toolbar should be visible.");
+ assertFalse(selenium.isElementPresent(separator), "Item separator should not be present on the page.");
+ }
+
+ @Test
+ @Use(field = "item", value = "items")
+ public void testInitItems() {
+ assertTrue(selenium.isElementPresent(item), "Item (" + item + ") should be present on the page.");
+ assertTrue(selenium.isVisible(item), "Item (" + item + ") should be visible.");
+ }
+
+ @Test
+ public void testHeight() {
+ selenium.type(pjq("input[id$=heightInput]"), "");
+ selenium.waitForPageToLoad();
+
+ testHtmlAttribute(toolbar, "height", "50px");
+ }
+
+ @Test
+ @Use(field = "item", value = "items")
+ public void testItemClass() {
+ testStyleClass(item, "itemClass");
+ }
+
+ @Test
+ @Use(field = "item", value = "items")
+ public void testItemStyle() {
+ testStyle(item, "itemStyle");
+ }
+
+ @Test
+ @Use(field = "item", value = "items")
+ public void testOnitemclick() {
+ testFireEvent(Event.CLICK, item, "itemclick");
+ }
+
+ @Test
+ @Use(field = "item", value = "items")
+ public void testOnitemdblclick() {
+ testFireEvent(Event.DBLCLICK, item, "itemdblclick");
+ }
+
+ @Test
+ @Use(field = "item", value = "items")
+ public void testOnitemkeydown() {
+ testFireEvent(Event.KEYDOWN, item, "itemkeydown");
+ }
+
+ @Test
+ @Use(field = "item", value = "items")
+ public void testOnitemkeypress() {
+ testFireEvent(Event.KEYPRESS, item, "itemkeypress");
+ }
+
+ @Test
+ @Use(field = "item", value = "items")
+ public void testOnitemkeyup() {
+ testFireEvent(Event.KEYUP, item, "itemkeyup");
+ }
+
+ @Test
+ @Use(field = "item", value = "items")
+ public void testOnitemmousedown() {
+ testFireEvent(Event.MOUSEDOWN, item, "itemmousedown");
+ }
+
+ @Test
+ @Use(field = "item", value = "items")
+ public void testOnitemmousemove() {
+ testFireEvent(Event.MOUSEMOVE, item, "itemmousemove");
+ }
+
+ @Test
+ @Use(field = "item", value = "items")
+ public void testOnitemmouseout() {
+ testFireEvent(Event.MOUSEOUT, item, "itemmouseout");
+ }
+
+ @Test
+ @Use(field = "item", value = "items")
+ public void testOnitemmouseover() {
+ testFireEvent(Event.MOUSEOVER, item, "itemmouseover");
+ }
+
+ @Test
+ @Use(field = "item", value = "items")
+ public void testOnitemmouseup() {
+ testFireEvent(Event.MOUSEUP, item, "itemmouseup");
+ }
+
+ @Test
+ public void testRendered() {
+ JQueryLocator input = pjq("input[type=radio][name$=renderedInput][value=false]");
+ selenium.click(input);
+ selenium.waitForPageToLoad();
+
+ assertFalse(selenium.isElementPresent(toolbar), "Toolbar should not be rendered when rendered=false.");
+ assertTrue(selenium.isDisplayed(toolbar), "Toolbar should be displayed when item 1 is not rendered.");
+ }
+
+ @Test
+ public void testWidth() {
+ selenium.type(pjq("input[id$=widthInput]"), "");
+ selenium.waitForPageToLoad();
+
+ testHtmlAttribute(toolbar, "width", "700px");
+ }
+}
Property changes on: modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richToolbar/TestRichToolbar.java
___________________________________________________________________
Name: svn:keywords
+ Revision
13 years, 11 months
JBoss Rich Faces SVN: r20950 - in modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest: a4jMediaOutput and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: ppitonak(a)redhat.com
Date: 2011-01-11 11:27:52 -0500 (Tue, 11 Jan 2011)
New Revision: 20950
Modified:
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/AbstractMetamerTest.java
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/a4jMediaOutput/TestImage.java
Log:
* testing standard HTML attributes refactored
Modified: modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/AbstractMetamerTest.java
===================================================================
--- modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/AbstractMetamerTest.java 2011-01-11 16:13:37 UTC (rev 20949)
+++ modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/AbstractMetamerTest.java 2011-01-11 16:27:52 UTC (rev 20950)
@@ -1,6 +1,6 @@
/*******************************************************************************
* JBoss, Home of Professional Open Source
- * Copyright 2010, Red Hat, Inc. and individual contributors
+ * Copyright 2010-2011, Red Hat, Inc. and individual contributors
* by the @authors tag. See the copyright.txt in the distribution for a
* full listing of individual contributors.
*
@@ -266,9 +266,7 @@
* locator of tested element
*/
protected void testLang(ElementLocator<?> element) {
- JQueryLocator langInput = pjq("input[type=text][id$=langInput]");
JavaScript getAttributeLang = null;
-
if (SystemProperties.getBrowser().getType() == BrowserType.FIREFOX) {
getAttributeLang = new JavaScript("window.jQuery('" + element.getRawLocator() + "').attr('lang')");
} else {
@@ -279,7 +277,7 @@
String langAttr = selenium.getEval(getAttributeLang);
assertTrue("null".equals(langAttr) || "".equals(langAttr), "Attribute xml:lang should not be present.");
- selenium.type(langInput, "sk");
+ selenium.type(pjq("input[type=text][id$=langInput]"), "sk");
selenium.waitForPageToLoad();
// lang = sk
@@ -309,6 +307,25 @@
}
/**
+ * A helper method for testing standard HTML attributes (RichFaces attributes that are directly put into markup), e.g. hreflang.
+ * @param element
+ * locator of tested element
+ * @param attribute
+ * tested attribute, e.g. "hreflang"
+ * @param value
+ * value that should be set, e.g. "cs"
+ */
+ protected void testHtmlAttribute(ElementLocator<?> element, String attribute, String value) {
+ AttributeLocator<?> attr = element.getAttribute(new Attribute(attribute));
+ assertFalse(selenium.isAttributePresent(attr), "Attribute " + attribute + " should not be present.");
+
+ selenium.type(pjq("input[id$=" + attribute + "Input]"), value);
+ selenium.waitForPageToLoad();
+
+ assertTrue(selenium.getAttribute(attr).contains(value), "Attribute " + attribute + " should contain \"" + value + "\".");
+ }
+
+ /**
* Hides header, footer and inputs for attributes.
*/
protected void hideControls() {
Modified: modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/a4jMediaOutput/TestImage.java
===================================================================
--- modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/a4jMediaOutput/TestImage.java 2011-01-11 16:13:37 UTC (rev 20949)
+++ modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/a4jMediaOutput/TestImage.java 2011-01-11 16:27:52 UTC (rev 20950)
@@ -99,27 +99,27 @@
@Test
public void testAccesskey() {
- testHtmlAttribute("accesskey", "r");
+ testHtmlAttribute(image, "accesskey", "r");
}
@Test
public void testAlign() {
- testHtmlAttribute("align", "left");
+ testHtmlAttribute(image, "align", "left");
}
@Test
public void testBorder() {
- testHtmlAttribute("border", "3");
+ testHtmlAttribute(image, "border", "3");
}
@Test
public void testCharset() {
- testHtmlAttribute("charset", "utf-8");
+ testHtmlAttribute(image, "charset", "utf-8");
}
@Test
public void testCoords() {
- testHtmlAttribute("coords", "circle: 150, 60, 60");
+ testHtmlAttribute(image, "coords", "circle: 150, 60, 60");
}
@Test
@@ -129,7 +129,7 @@
@Test
public void testHreflang() {
- testHtmlAttribute("hreflang", "sk");
+ testHtmlAttribute(image, "hreflang", "sk");
}
@Test
@@ -206,7 +206,7 @@
@Test
public void testRel() {
- testHtmlAttribute("rel", "metamer");
+ testHtmlAttribute(image, "rel", "metamer");
}
@Test
@@ -220,12 +220,12 @@
@Test
public void testRev() {
- testHtmlAttribute("rev", "metamer");
+ testHtmlAttribute(image, "rev", "metamer");
}
@Test
public void testShape() {
- testHtmlAttribute("shape", "default");
+ testHtmlAttribute(image, "shape", "default");
}
@Test
@@ -240,12 +240,12 @@
@Test
public void testTabindex() {
- testHtmlAttribute("tabindex", "50");
+ testHtmlAttribute(image, "tabindex", "50");
}
@Test
public void testTarget() {
- testHtmlAttribute("target", "_blank");
+ testHtmlAttribute(image, "target", "_blank");
}
@Test
@@ -255,16 +255,6 @@
@Test
public void testUsemap() {
- testHtmlAttribute("usemap", "metamer");
+ testHtmlAttribute(image, "usemap", "metamer");
}
-
- private void testHtmlAttribute(String attribute, String value) {
- AttributeLocator<?> attr = image.getAttribute(new Attribute(attribute));
- assertFalse(selenium.isAttributePresent(attr), "Attribute " + attribute + " should not be present.");
-
- selenium.type(pjq("input[id$=" + attribute + "Input]"), value);
- selenium.waitForPageToLoad();
-
- assertTrue(selenium.getAttribute(attr).contains(value), "Attribute " + attribute + " should contain \"" + value + "\".");
- }
}
13 years, 11 months
JBoss Rich Faces SVN: r20949 - in modules/tests/metamer/trunk/application/src/main: resources/org/richfaces/tests/metamer/bean and 1 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: lfryc(a)redhat.com
Date: 2011-01-11 11:13:37 -0500 (Tue, 11 Jan 2011)
New Revision: 20949
Added:
modules/tests/metamer/trunk/application/src/main/resources/org/richfaces/tests/metamer/bean/RichCollapsibleSubTableBean.properties
Removed:
modules/tests/metamer/trunk/application/src/main/webapp/components/richCollapsibleSubTable/sorting-using-component-control.xhtml
Modified:
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichCollapsibleSubTableBean.java
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichTooltipBean.java
modules/tests/metamer/trunk/application/src/main/resources/org/richfaces/tests/metamer/bean/RichTooltipBean.properties
modules/tests/metamer/trunk/application/src/main/webapp/components/richCollapsibleSubTable/filtering.xhtml
modules/tests/metamer/trunk/application/src/main/webapp/components/richCollapsibleSubTable/list.xhtml
modules/tests/metamer/trunk/application/src/main/webapp/components/richCollapsibleSubTable/sorting-using-column.xhtml
Log:
rich:collapsibleSubTable - sample completion (RFPL-731)
Modified: modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichCollapsibleSubTableBean.java
===================================================================
--- modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichCollapsibleSubTableBean.java 2011-01-11 12:21:10 UTC (rev 20948)
+++ modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichCollapsibleSubTableBean.java 2011-01-11 16:13:37 UTC (rev 20949)
@@ -33,7 +33,9 @@
import javax.faces.bean.ViewScoped;
import org.richfaces.component.UICollapsibleSubTable;
+import org.richfaces.component.UIDataTableBase;
import org.richfaces.tests.metamer.Attributes;
+import org.richfaces.tests.metamer.ColumnSortingMap;
import org.richfaces.tests.metamer.model.Employee;
import org.richfaces.tests.metamer.model.Employee.Sex;
import org.slf4j.Logger;
@@ -45,7 +47,7 @@
* @author <a href="mailto:ppitonak@redhat.com">Pavol Pitonak</a>
* @version $Revision$
*/
-@ManagedBean(name="richSubTableBean")
+@ManagedBean(name = "richSubTableBean")
@ViewScoped
public class RichCollapsibleSubTableBean implements Serializable {
@@ -55,12 +57,29 @@
@ManagedProperty(value = "#{model.employees}")
private List<Employee> employees;
private List<List<Employee>> lists;
+ private UICollapsibleSubTable binding;
// true = model, false = empty table
private boolean state;
// facets
private Map<String, String> facets = new HashMap<String, String>();
+ // sorting
+ private ColumnSortingMap sorting = new ColumnSortingMap() {
+ private static final long serialVersionUID = 1L;
+
+ protected UIDataTableBase getBinding() {
+ return binding;
+ }
+
+ protected Attributes getAttributes() {
+ return attributes;
+ }
+ };
+
+ // filtering
+ private Map<String, Object> filtering = new HashMap<String, Object>();
+
/**
* Initializes the managed bean.
*/
@@ -68,15 +87,15 @@
public void init() {
logger = LoggerFactory.getLogger(getClass());
logger.debug("initializing bean " + getClass().getName());
-
+
attributes = Attributes.getComponentAttributesFromFacesConfig(UICollapsibleSubTable.class, getClass());
- attributes.setAttribute("expandMode", "client");
attributes.setAttribute("expanded", true);
attributes.setAttribute("rendered", true);
attributes.setAttribute("rows", 5);
// TODO these attributes have to be tested in another way
+ attributes.remove("selection");
attributes.remove("filterVar");
attributes.remove("keepSaved");
attributes.remove("iterationStatusVar");
@@ -139,5 +158,20 @@
public Map<String, String> getFacets() {
return facets;
}
-
+
+ public UICollapsibleSubTable getBinding() {
+ return binding;
+ }
+
+ public void setBinding(UICollapsibleSubTable binding) {
+ this.binding = binding;
+ }
+
+ public ColumnSortingMap getSorting() {
+ return sorting;
+ }
+
+ public Map<String, Object> getFiltering() {
+ return filtering;
+ }
}
Modified: modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichTooltipBean.java
===================================================================
--- modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichTooltipBean.java 2011-01-11 12:21:10 UTC (rev 20948)
+++ modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichTooltipBean.java 2011-01-11 16:13:37 UTC (rev 20949)
@@ -67,20 +67,16 @@
attributes.setAttribute("followMouse", true);
attributes.setAttribute("disabled", false);
attributes.setAttribute("layout", "inline");
- attributes.setAttribute("direction", "bottomRight");
attributes.setAttribute("mode", "client");
attributes.setAttribute("showEvent", "mouseenter");
attributes.setAttribute("hideEvent", "mouseleave");
attributes.setAttribute("target", "form:panel");
- // intentionally hidden attributes
- attributes.remove("bypassUpdates");
+ // attributes that needs to be tested in other way
attributes.remove("converter");
- attributes.remove("data");
- attributes.remove("execute");
- attributes.remove("limitToList");
+
+ // intentionally hidden attributes
attributes.remove("localValue");
- attributes.remove("render");
attributes.remove("value");
}
Added: modules/tests/metamer/trunk/application/src/main/resources/org/richfaces/tests/metamer/bean/RichCollapsibleSubTableBean.properties
===================================================================
--- modules/tests/metamer/trunk/application/src/main/resources/org/richfaces/tests/metamer/bean/RichCollapsibleSubTableBean.properties (rev 0)
+++ modules/tests/metamer/trunk/application/src/main/resources/org/richfaces/tests/metamer/bean/RichCollapsibleSubTableBean.properties 2011-01-11 16:13:37 UTC (rev 20949)
@@ -0,0 +1,6 @@
+attr.expandMode.server=server
+attr.expandMode.ajax=ajax
+attr.expandMode.client=client
+attr.expandMode.null=
+attr.sortMode.single=single
+attr.sortMode.multi=multi
\ No newline at end of file
Modified: modules/tests/metamer/trunk/application/src/main/resources/org/richfaces/tests/metamer/bean/RichTooltipBean.properties
===================================================================
--- modules/tests/metamer/trunk/application/src/main/resources/org/richfaces/tests/metamer/bean/RichTooltipBean.properties 2011-01-11 12:21:10 UTC (rev 20948)
+++ modules/tests/metamer/trunk/application/src/main/resources/org/richfaces/tests/metamer/bean/RichTooltipBean.properties 2011-01-11 16:13:37 UTC (rev 20949)
@@ -1,9 +1,22 @@
attr.layout.inline=inline
attr.layout.block=block
-attr.direction.topRight=topRight
+attr.direction.auto=auto
attr.direction.topLeft=topLeft
+attr.direction.bottomLeft=bottomLeft
attr.direction.bottomRight=bottomRight
-attr.direction.bottomLeft=bottomLeft
-attr.direction.auto=auto
+attr.direction.autoLeft=autoLeft
+attr.direction.autoRight=autoRight
+attr.direction.topAuto=topAuto
+attr.direction.bottomAuto=bottomAuto
+attr.direction.null=
attr.mode.client=client
-attr.mode.ajax=ajax
\ No newline at end of file
+attr.mode.ajax=ajax
+attr.jointPoint.auto=auto
+attr.jointPoint.topLeft=topLeft
+attr.jointPoint.bottomLeft=bottomLeft
+attr.jointPoint.bottomRight=bottomRight
+attr.jointPoint.autoLeft=autoLeft
+attr.jointPoint.autoRight=autoRight
+attr.jointPoint.topAuto=topAuto
+attr.jointPoint.bottomAuto=bottomAuto
+attr.jointPoint.null=
\ No newline at end of file
Modified: modules/tests/metamer/trunk/application/src/main/webapp/components/richCollapsibleSubTable/filtering.xhtml
===================================================================
--- modules/tests/metamer/trunk/application/src/main/webapp/components/richCollapsibleSubTable/filtering.xhtml 2011-01-11 12:21:10 UTC (rev 20948)
+++ modules/tests/metamer/trunk/application/src/main/webapp/components/richCollapsibleSubTable/filtering.xhtml 2011-01-11 16:13:37 UTC (rev 20949)
@@ -2,7 +2,8 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:h="http://java.sun.com/jsf/html" xmlns:f="http://java.sun.com/jsf/core"
xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:metamer="http://java.sun.com/jsf/composite/metamer"
- xmlns:rich="http://richfaces.org/rich" xmlns:a4j="http://richfaces.org/a4j">
+ xmlns:rich="http://richfaces.org/rich" xmlns:a4j="http://richfaces.org/a4j"
+ xmlns:fn="http://java.sun.com/jsp/jstl/functions">
<!--
JBoss, Home of Professional Open Source
@@ -55,9 +56,21 @@
</rich:column>
<rich:column id="columnHeaderName" breakRowBefore="true">
<h:outputText id="columnHeaderNameText" value="Name" />
+ <br/>
+ <h:outputText id="columnHeaderNameType" value="(expression contains ignore case)" />
+ <br/>
+ <h:inputText id="columnHeaderNameInput" value="#{richSubTableBean.filtering['name']}">
+ <a4j:ajax render="commonGrid" event="change"/>
+ </h:inputText>
</rich:column>
<rich:column id="columnHeaderTitle">
<h:outputText id="columnHeaderTitleText" value="Title" />
+ <br/>
+ <h:outputText id="columnHeaderTitleType" value="(expression equals)" />
+ <br/>
+ <h:inputText id="columnHeaderTitleInput" value="#{richSubTableBean.filtering['title']}">
+ <a4j:ajax render="commonGrid" event="change"/>
+ </h:inputText>
</rich:column>
<rich:column id="columnHeaderBirthdate">
<h:outputText id="columnHeaderBirthdateText" value="Birthdate" />
@@ -102,18 +115,10 @@
value="#{richSubTableBean.state ? list : null}"
var="item">
- <f:facet name="header">
- header facet
- </f:facet>
-
- <f:facet name="noData">
- no data facet
- </f:facet>
-
- <rich:column id="columnName">
+ <rich:column id="columnName" filterExpression="#{fn:containsIgnoreCase(item.name, richSubTableBean.filtering['name'])}">
<h:outputText id="name" value="#{item.name}" />
</rich:column>
- <rich:column id="columnTitle">
+ <rich:column id="columnTitle" filterExpression="#{richSubTableBean.filtering['title'] == null || richSubTableBean.filtering['title'] == '' || item.title == richSubTableBean.filtering['title']}">
<h:outputText id="title" value="#{item.title}" />
</rich:column>
<rich:column id="columnBirthdate">
@@ -122,10 +127,6 @@
</h:outputText>
</rich:column>
- <f:facet name="footer">
- footer facet
- </f:facet>
-
</rich:collapsibleSubTable>
</rich:dataTable>
Modified: modules/tests/metamer/trunk/application/src/main/webapp/components/richCollapsibleSubTable/list.xhtml
===================================================================
--- modules/tests/metamer/trunk/application/src/main/webapp/components/richCollapsibleSubTable/list.xhtml 2011-01-11 12:21:10 UTC (rev 20948)
+++ modules/tests/metamer/trunk/application/src/main/webapp/components/richCollapsibleSubTable/list.xhtml 2011-01-11 16:13:37 UTC (rev 20949)
@@ -52,10 +52,6 @@
Page that contains a table with two <b>rich:collapsibleSubTable</b>s (with model containing employees) and input boxes for all its attributes.
<span style="color: red">TODO will be used with various types of input and command components as soon as available</span>
</metamer:testPageLink>
-
- <metamer:testPageLink id="sorting-using-component-control" outcome="sorting-using-component-control" value="Table Sorting - Component Control">
- <b>rich:collapsibleSubTable</b> (with model containing employees) sortable by <b>rich:componentControl</b>.
- </metamer:testPageLink>
<metamer:testPageLink id="sorting-using-column" outcome="sorting-using-column" value="Table Sorting - Column based">
<b>rich:collapsibleSubTable</b> (with model containing employees) with custom sorting by <b>rich:column</b>'s attribute @sortBy, @sortOrder.
Modified: modules/tests/metamer/trunk/application/src/main/webapp/components/richCollapsibleSubTable/sorting-using-column.xhtml
===================================================================
--- modules/tests/metamer/trunk/application/src/main/webapp/components/richCollapsibleSubTable/sorting-using-column.xhtml 2011-01-11 12:21:10 UTC (rev 20948)
+++ modules/tests/metamer/trunk/application/src/main/webapp/components/richCollapsibleSubTable/sorting-using-column.xhtml 2011-01-11 16:13:37 UTC (rev 20949)
@@ -54,13 +54,13 @@
<h:outputText id="columnHeaderEmployeesText" value="Employees" />
</rich:column>
<rich:column id="columnHeaderName" breakRowBefore="true">
- <h:outputText id="columnHeaderNameText" value="Name" />
+ <a4j:commandLink id="sortByName" value="Name" render="richDataTable" action="#{richSubTableBean.sorting['columnName'].reverseOrder}" />
</rich:column>
<rich:column id="columnHeaderTitle">
- <h:outputText id="columnHeaderTitleText" value="Title" />
+ <a4j:commandLink id="sortByTitle" value="Title" render="richDataTable" action="#{richSubTableBean.sorting['columnTitle'].reverseOrder}" />
</rich:column>
<rich:column id="columnHeaderBirthdate">
- <h:outputText id="columnHeaderBirthdateText" value="Birthdate" />
+ <a4j:commandLink id="sortByBirthdate" value="Birthdate" render="richDataTable" action="#{richSubTableBean.sorting['columnBirthdate'].reverseOrder}" />
</rich:column>
</rich:columnGroup>
</f:facet>
@@ -71,6 +71,7 @@
</rich:column>
<rich:collapsibleSubTable id="richSubTable"
+ binding="#{richSubTableBean.binding}"
breakBefore="#{richSubTableBean.attributes['breakBefore'].value}"
expandMode="#{richSubTableBean.attributes['expandMode'].value}"
expanded="#{richSubTableBean.attributes['expanded'].value}"
@@ -102,30 +103,18 @@
value="#{richSubTableBean.state ? list : null}"
var="item">
- <f:facet name="header">
- header facet
- </f:facet>
-
- <f:facet name="noData">
- no data facet
- </f:facet>
-
- <rich:column id="columnName">
+ <rich:column id="columnName" sortBy="#{item.name}" sortOrder="#{richSubTableBean.sorting['columnName'].order}">
<h:outputText id="name" value="#{item.name}" />
</rich:column>
- <rich:column id="columnTitle">
+ <rich:column id="columnTitle" sortBy="#{item.title}" sortOrder="#{richSubTableBean.sorting['columnTitle'].order}">
<h:outputText id="title" value="#{item.title}" />
</rich:column>
- <rich:column id="columnBirthdate">
+ <rich:column id="columnBirthdate" sortBy="#{item.birthdate}" sortOrder="#{richSubTableBean.sorting['columnBirthdate'].order}">
<h:outputText id="birthdate" value="#{item.birthdate}">
<f:convertDateTime pattern="d MMM yyyy"/>
</h:outputText>
</rich:column>
-
- <f:facet name="footer">
- footer facet
- </f:facet>
-
+
</rich:collapsibleSubTable>
</rich:dataTable>
Deleted: modules/tests/metamer/trunk/application/src/main/webapp/components/richCollapsibleSubTable/sorting-using-component-control.xhtml
===================================================================
--- modules/tests/metamer/trunk/application/src/main/webapp/components/richCollapsibleSubTable/sorting-using-component-control.xhtml 2011-01-11 12:21:10 UTC (rev 20948)
+++ modules/tests/metamer/trunk/application/src/main/webapp/components/richCollapsibleSubTable/sorting-using-component-control.xhtml 2011-01-11 16:13:37 UTC (rev 20949)
@@ -1,143 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" ?>
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xmlns:h="http://java.sun.com/jsf/html" xmlns:f="http://java.sun.com/jsf/core"
- xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:metamer="http://java.sun.com/jsf/composite/metamer"
- xmlns:rich="http://richfaces.org/rich" xmlns:a4j="http://richfaces.org/a4j">
-
- <!--
-JBoss, Home of Professional Open Source
-Copyright 2010, Red Hat, Inc. and individual contributors
-by the @authors tag. See the copyright.txt in the distribution for a
-full listing of individual contributors.
-
-This is free software; you can redistribute it and/or modify it
-under the terms of the GNU Lesser General Public License as
-published by the Free Software Foundation; either version 2.1 of
-the License, or (at your option) any later version.
-
-This software is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-Lesser General Public License for more details.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this software; if not, write to the Free
-Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-02110-1301 USA, or see the FSF site: http://www.fsf.org.
- -->
-
- <ui:composition template="/templates/template.xhtml">
-
- <ui:define name="head">
- <f:metadata>
- <f:viewParam name="templates" value="#{templateBean.templates}">
- <f:converter converterId="templatesListConverter" />
- </f:viewParam>
- </f:metadata>
- </ui:define>
-
- <ui:define name="outOfTemplateBefore">
- <br/>
- <h:outputText value="Show data in table: " />
- <h:selectBooleanCheckbox id="noDataCheckbox" value="#{richSubTableBean.state}">
- <a4j:ajax render="richDataTable"/>
- </h:selectBooleanCheckbox>
- <br/><br/>
- </ui:define>
-
- <ui:define name="component">
-
- <rich:dataTable id="richDataTable" value="#{richSubTableBean.lists}" var="list">
- <f:facet name="header">
- <rich:columnGroup id="columnGroup">
- <rich:column id="columnHeaderEmployees" colspan="3">
- <h:outputText id="columnHeaderEmployeesText" value="Employees" />
- </rich:column>
- <rich:column id="columnHeaderName" breakRowBefore="true">
- <h:commandLink id="sortNames" value="Name">
- <rich:componentControl event="click" target="richSubTable" operation="sort">
- <f:param value="columnName" />
- </rich:componentControl>
- </h:commandLink>
- </rich:column>
- <rich:column id="columnHeaderTitle">
- <h:outputText id="columnHeaderTitleText" value="Title" />
- </rich:column>
- <rich:column id="columnHeaderBirthdate">
- <h:outputText id="columnHeaderBirthdateText" value="Birthdate" />
- </rich:column>
- </rich:columnGroup>
- </f:facet>
-
- <rich:column id="columnSubTable" colspan="3">
- <rich:collapsibleSubTableToggler id="subTableTC" for="richSubTable"/>
- <h:outputText value="#{list[0].sex == 'MALE' ? 'Men' : 'Women'}" />
- </rich:column>
-
- <rich:collapsibleSubTable id="richSubTable"
- breakBefore="#{richSubTableBean.attributes['breakBefore'].value}"
- expandMode="#{richSubTableBean.attributes['expandMode'].value}"
- expanded="#{richSubTableBean.attributes['expanded'].value}"
- filterVar="#{richSubTableBean.attributes['filterVar'].value}"
- filteringListeners="#{richSubTableBean.attributes['filteringListeners'].value}"
- first="#{richSubTableBean.attributes['first'].value}"
- footer="#{richSubTableBean.attributes['footer'].value}"
- header="#{richSubTableBean.attributes['header'].value}"
- iterationState="#{richSubTableBean.attributes['iterationState'].value}"
- iterationStatusVar="#{richSubTableBean.attributes['iterationStatusVar'].value}"
- keepSaved="#{richSubTableBean.attributes['keepSaved'].value}"
- noData="#{richSubTableBean.attributes['noData'].value}"
- noDataLabel="#{richSubTableBean.attributes['noDataLabel'].value}"
- relativeRowIndex="#{richSubTableBean.attributes['relativeRowIndex'].value}"
- rendered="#{richSubTableBean.attributes['rendered'].value}"
- rowAvailable="#{richSubTableBean.attributes['rowAvailable'].value}"
- rowCount="#{richSubTableBean.attributes['rowCount'].value}"
- rowData="#{richSubTableBean.attributes['rowData'].value}"
- rowIndex="#{richSubTableBean.attributes['rowIndex'].value}"
- rowKey="#{richSubTableBean.attributes['rowKey'].value}"
- rowKeyConverter="#{richSubTableBean.attributes['rowKeyConverter'].value}"
- rows="#{richSubTableBean.attributes['rows'].value}"
- selection="#{richSubTableBean.attributes['selection'].value}"
- sortExpression="#{richSubTableBean.attributes['sortExpression'].value}"
- sortMode="#{richSubTableBean.attributes['sortMode'].value}"
- sortPriority="#{richSubTableBean.attributes['sortPriority'].value}"
- sortingListeners="#{richSubTableBean.attributes['sortingListeners'].value}"
- toggleListeners="#{richSubTableBean.attributes['toggleListeners'].value}"
- value="#{richSubTableBean.state ? list : null}"
- var="item">
-
- <f:facet name="header">
- header facet
- </f:facet>
-
- <f:facet name="noData">
- no data facet
- </f:facet>
-
- <rich:column id="columnName">
- <h:outputText id="name" value="#{item.name}" />
- </rich:column>
- <rich:column id="columnTitle">
- <h:outputText id="title" value="#{item.title}" />
- </rich:column>
- <rich:column id="columnBirthdate">
- <h:outputText id="birthdate" value="#{item.birthdate}">
- <f:convertDateTime pattern="d MMM yyyy"/>
- </h:outputText>
- </rich:column>
-
- <f:facet name="footer">
- footer facet
- </f:facet>
-
- </rich:collapsibleSubTable>
- </rich:dataTable>
-
- </ui:define>
-
- <ui:define name="outOfTemplateAfter">
- <metamer:attributes value="#{richSubTableBean.attributes}" id="attributes" />
- </ui:define>
-
- </ui:composition>
-</html>
\ No newline at end of file
13 years, 11 months
JBoss Rich Faces SVN: r20948 - in trunk/ui/iteration/ui/src: main/templates and 1 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: abelevich
Date: 2011-01-11 07:21:10 -0500 (Tue, 11 Jan 2011)
New Revision: 20948
Modified:
trunk/ui/iteration/ui/src/main/resources/META-INF/resources/org.richfaces/datascroller.ecss
trunk/ui/iteration/ui/src/main/resources/META-INF/resources/org.richfaces/datascroller.js
trunk/ui/iteration/ui/src/main/templates/datascroller.template.xml
trunk/ui/iteration/ui/src/test/java/org/richfaces/renderkit/DataScrollerRenderTest.java
Log:
RF-8922: Following classes were added: rf-ds-btn-prev, rf-ds-btn-next, rf-ds-btn-first, rf-ds-btn-last, rf-ds-btn-fastfwd, rf-ds-btn-fastrwd
Modified: trunk/ui/iteration/ui/src/main/resources/META-INF/resources/org.richfaces/datascroller.ecss
===================================================================
--- trunk/ui/iteration/ui/src/main/resources/META-INF/resources/org.richfaces/datascroller.ecss 2011-01-11 12:07:52 UTC (rev 20947)
+++ trunk/ui/iteration/ui/src/main/resources/META-INF/resources/org.richfaces/datascroller.ecss 2011-01-11 12:21:10 UTC (rev 20948)
@@ -50,11 +50,11 @@
font-weight: normal;
}
-.rf-ds-lft {
+.rf-ds-btn-first, .rf-ds-btn-fastrwd, .rf-ds-btn-prev {
margin-right: 1px;
}
-.rf-ds-rgh {
+.rf-ds-btn-next, .rf-ds-btn-fastfwd, .rf-ds-btn-last {
margin-left: 1px;
}
Modified: trunk/ui/iteration/ui/src/main/resources/META-INF/resources/org.richfaces/datascroller.js
===================================================================
--- trunk/ui/iteration/ui/src/main/resources/META-INF/resources/org.richfaces/datascroller.js 2011-01-11 12:07:52 UTC (rev 20947)
+++ trunk/ui/iteration/ui/src/main/resources/META-INF/resources/org.richfaces/datascroller.js 2011-01-11 12:21:10 UTC (rev 20948)
@@ -1,169 +1,146 @@
(function ($, richfaces) {
-
+
richfaces.ui = richfaces.ui || {};
-
- var initButtons = function(buttons, css, component) {
- var id;
- var fn = function(e) {
- e.data.fn.call(e.data.component, e);
- }
-
- var data = {};
- data.component = component;
+ var initButtons = function(buttons, css, component) {
+ var id;
- for(id in buttons) {
- var element = $(document.getElementById(id));
-
- data.id = id;
- data.page = buttons[id];
- data.element = element;
- data.fn = component.processClick;
+ var fn = function(e) {
+ e.data.fn.call(e.data.component, e);
+ }
- element.bind('click', copy(data), fn);
-
- if(css) {
- data.fn = component.processStyles;
- data.css = css.mousedown;
- element.bind('mousedown', copy(data), fn);
-
- data.css = css.mouseup;
- element.bind('mouseup', copy(data), fn);
-
- data.css = css.mouseout;
- element.bind('mouseout', copy(data), fn);
-
- data.css = css.mouseover;
- element.bind('mouseover', copy(data), fn);
- }
- }
- };
-
- var copy = function(data) {
- var key;
- var eventData = {};
-
- for (key in data) {
- eventData[key] = data[key];
- }
-
- return eventData;
- };
-
- richfaces.ui.DataScroller = function(id, submit, options) {
-
- $super.constructor.call(this, id);
-
- this.attachToDom();
-
- this.options = options;
+ var data = {};
+ data.component = component;
+
+ for (id in buttons) {
+ var element = $(document.getElementById(id));
+
+ data.id = id;
+ data.page = buttons[id];
+ data.element = element;
+ data.fn = component.processClick;
+
+ element.bind('click', copy(data), fn);
+ }
+ };
+
+ var copy = function(data) {
+ var key;
+ var eventData = {};
+
+ for (key in data) {
+ eventData[key] = data[key];
+ }
+
+ return eventData;
+ };
+
+ richfaces.ui.DataScroller = function(id, submit, options) {
+
+ $super.constructor.call(this, id);
+
+ var dataScrollerElement = this.attachToDom();
+
+ this.options = options;
this.currentPage = options.currentPage;
- var buttons = options.buttons;
+ var buttons = options.buttons;
var digitals = options.digitals;
-
- if (submit && typeof submit == 'function') {
- RichFaces.Event.bindById(id, this.getScrollEventName(), submit);
- }
-
+
+ if (submit && typeof submit == 'function') {
+ RichFaces.Event.bindById(id, this.getScrollEventName(), submit);
+ }
+
var css = {};
-
- if(buttons) {
- var leftButtons = buttons.left;
- css.mouseover = "rf-ds-btn rf-ds-lft";
- css.mouseup = "rf-ds-btn rf-ds-lft";
- css.mouseout = "rf-ds-btn rf-ds-lft";
- css.mousedown = "rf-ds-btn rf-ds-lft rf-ds-hov";
- initButtons(leftButtons,css, this);
-
- var rightButtons = buttons.right;
- css.mouseover = "rf-ds-btn rf-ds-rgh";
- css.mouseup = "rf-ds-btn rf-ds-rgh";
- css.mouseout = "rf-ds-btn rf-ds-rgh";
- css.mousedown = "rf-ds-btn rf-ds-rgh rf-ds-hov";
- initButtons(rightButtons,css, this);
+
+ if (buttons) {
+
+ $(dataScrollerElement).delegate('.rf-ds-btn', 'mouseover mouseup mouseout mousedown', function(event) {
+ if (event.type == 'mousedown') {
+ $(this).addClass('rf-ds-hov');
+ } else {
+ $(this).removeClass('rf-ds-hov');
+ }
+ });
+
+ initButtons(buttons.left, css, this);
+ initButtons(buttons.right, css, this);
}
-
- if(digitals) {
- css.mouseover= "rf-ds-nmb-btn rf-ds-hov";
- css.mouseup= "rf-ds-nmb-btn rf-ds-hov";
- css.mouseout = "rf-ds-nmb-btn";
- css.mousedown="rf-ds-nmb-btn rf-ds-press";
- initButtons(digitals, css,this);
+
+ if (digitals) {
+
+ $(dataScrollerElement).delegate('.rf-ds-nmb-btn', 'mouseover mouseup mouseout mousedown', function(event) {
+ if (event.type == 'mouseover' || event.type == 'mouseup') {
+ $(this).addClass('rf-ds-hov');
+ } else if (event.type == 'mouseout') {
+ $(this).removeClass('rf-ds-hov');
+ } else if (event.type == 'mousedown') {
+ $(this).toggleClass('rf-ds-press');
+ }
+ });
+
+ initButtons(digitals, css, this);
}
};
-
- richfaces.BaseComponent.extend(richfaces.ui.DataScroller);
- var $super = richfaces.ui.DataScroller.$super;
-
+
+ richfaces.BaseComponent.extend(richfaces.ui.DataScroller);
+ var $super = richfaces.ui.DataScroller.$super;
+
$.extend(richfaces.ui.DataScroller.prototype, (function (options) {
-
- var scrollEventName = "rich:datascroller:onscroll";
-
+
+ var scrollEventName = "rich:datascroller:onscroll";
+
return {
-
- name: "RichFaces.ui.DataScroller",
- processClick: function(event) {
- var data = event.data;
- if(data) {
- var page = data.page;
- if(page) {
- this.switchToPage(page);
- }
- }
- },
-
- processStyles: function(event) {
- var data = event.data;
-
- if(data && (data.page != this.currentPage)) {
- var element = data.element;
- var css = data.css;
-
- if(element && css) {
- element.attr('class', css);
- }
- }
- },
-
- switchToPage: function(page) {
- if (typeof page != 'undefined' && page != null) {
- RichFaces.Event.fireById(this.id, this.getScrollEventName(), {'page' : page});
- }
- },
-
- fastForward: function() {
- this.switchToPage("fastforward");
- },
-
- fastRewind: function() {
- this.switchToPage("fastrewind");
- },
-
- next: function() {
- this.switchToPage("next");
- },
-
- previous: function() {
- this.switchToPage("previous");
- },
-
- first: function() {
- this.switchToPage("first");
- },
-
- last: function() {
- this.switchToPage("last");
- },
-
- getScrollEventName: function() {
- return scrollEventName;
- },
- destroy: function() {
- $super.destroy.call(this);
- }
- }
-
+ name: "RichFaces.ui.DataScroller",
+
+ processClick: function(event) {
+ var data = event.data;
+ if (data) {
+ var page = data.page;
+ if (page) {
+ this.switchToPage(page);
+ }
+ }
+ },
+
+ switchToPage: function(page) {
+ if (typeof page != 'undefined' && page != null) {
+ RichFaces.Event.fireById(this.id, this.getScrollEventName(), {'page' : page});
+ }
+ },
+
+ fastForward: function() {
+ this.switchToPage("fastforward");
+ },
+
+ fastRewind: function() {
+ this.switchToPage("fastrewind");
+ },
+
+ next: function() {
+ this.switchToPage("next");
+ },
+
+ previous: function() {
+ this.switchToPage("previous");
+ },
+
+ first: function() {
+ this.switchToPage("first");
+ },
+
+ last: function() {
+ this.switchToPage("last");
+ },
+
+ getScrollEventName: function() {
+ return scrollEventName;
+ },
+ destroy: function() {
+ $super.destroy.call(this);
+ }
+ }
+
})());
})(jQuery, window.RichFaces);
\ No newline at end of file
Modified: trunk/ui/iteration/ui/src/main/templates/datascroller.template.xml
===================================================================
--- trunk/ui/iteration/ui/src/main/templates/datascroller.template.xml 2011-01-11 12:07:52 UTC (rev 20947)
+++ trunk/ui/iteration/ui/src/main/templates/datascroller.template.xml 2011-01-11 12:21:10 UTC (rev 20948)
@@ -44,8 +44,8 @@
<c:if test="#{controlsState.firstRendered}">
<cdk:object type="boolean" name="isEnabled" value="#{controlsState.firstEnabled}"/>
<cdk:object type="UIComponent" name="facet" value="#{component.getFacet('first')}"/>
- <cdk:object type="String" name="enabledStyles" value="rf-ds-btn rf-ds-lft"/>
- <cdk:object type="String" name="disabledStyles" value="rf-ds-btn rf-ds-lft rf-ds-dis"/>
+ <cdk:object type="String" name="enabledStyles" value="rf-ds-btn rf-ds-btn-first"/>
+ <cdk:object type="String" name="disabledStyles" value="rf-ds-btn rf-ds-btn-first rf-ds-dis"/>
<cdk:object type="String" name="id" value="#{clientId}_ds_f"/>
<cdk:object type="String" name="defaultText" value="««««"/>
<xi:include xpointer="xpointer(/*)" href="buttons.template.include" />
@@ -54,8 +54,8 @@
<c:if test="#{controlsState.fastRewindRendered}">
<cdk:object type="boolean" name="isEnabled" value="#{controlsState.fastRewindEnabled}"/>
<cdk:object type="UIComponent" name="facet" value="#{component.getFacet('fastRewind')}"/>
- <cdk:object type="java.lang.String" name="enabledStyles" value="rf-ds-btn rf-ds-lft"/>
- <cdk:object type="java.lang.String" name="disabledStyles" value="rf-ds-btn rf-ds-lft rf-ds-dis"/>
+ <cdk:object type="java.lang.String" name="enabledStyles" value="rf-ds-btn rf-ds-btn-fastrwd"/>
+ <cdk:object type="java.lang.String" name="disabledStyles" value="rf-ds-btn rf-ds-btn-fastrwd rf-ds-dis"/>
<cdk:object type="java.lang.String" name="id" value="#{clientId}_ds_fr"/>
<cdk:object type="java.lang.String" name="defaultText" value="««"/>
<xi:include xpointer="xpointer(/*)" href="buttons.template.include" />
@@ -64,8 +64,8 @@
<c:if test="#{controlsState.previousRendered}">
<cdk:object name="isEnabled" value="#{controlsState.previousEnabled}"/>
<cdk:object name="facet" value="#{component.getFacet('previous')}"/>
- <cdk:object type="java.lang.String" name="enabledStyles" value="rf-ds-btn rf-ds-lft"/>
- <cdk:object type="java.lang.String" name="disabledStyles" value="rf-ds-btn rf-ds-lft rf-ds-dis"/>
+ <cdk:object type="java.lang.String" name="enabledStyles" value="rf-ds-btn rf-ds-btn-prev"/>
+ <cdk:object type="java.lang.String" name="disabledStyles" value="rf-ds-btn rf-ds-btn-prev rf-ds-dis"/>
<cdk:object name="id" value="#{clientId}_ds_prev"/>
<cdk:object name="defaultText" value="«"/>
<xi:include xpointer="xpointer(/*)" href="buttons.template.include" />
@@ -76,8 +76,8 @@
<c:if test="#{controlsState.nextRendered}">
<cdk:object name="isEnabled" value="#{controlsState.nextEnabled}"/>
<cdk:object name="facet" value="#{component.getFacet('next')}"/>
- <cdk:object type="java.lang.String" name="enabledStyles" value="rf-ds-btn rf-ds-rgh"/>
- <cdk:object type="java.lang.String" name="disabledStyles" value="rf-ds-btn rf-ds-rgh rf-ds-dis"/>
+ <cdk:object type="java.lang.String" name="enabledStyles" value="rf-ds-btn rf-ds-btn-next"/>
+ <cdk:object type="java.lang.String" name="disabledStyles" value="rf-ds-btn rf-ds-btn-next rf-ds-dis"/>
<cdk:object name="id" value="#{clientId}_ds_next"/>
<cdk:object name="defaultText" value="»"/>
<xi:include xpointer="xpointer(/*)" href="buttons.template.include" />
@@ -86,8 +86,8 @@
<c:if test="#{controlsState.fastForwardRendered}">
<cdk:object name="isEnabled" value="#{controlsState.fastForwardEnabled}"/>
<cdk:object name="facet" value="#{component.getFacet('fastForward')}"/>
- <cdk:object type="java.lang.String" name="enabledStyles" value="rf-ds-btn rf-ds-rgh"/>
- <cdk:object type="java.lang.String" name="disabledStyles" value="rf-ds-btn rf-ds-rgh rf-ds-dis"/>
+ <cdk:object type="java.lang.String" name="enabledStyles" value="rf-ds-btn rf-ds-btn-fastfwd"/>
+ <cdk:object type="java.lang.String" name="disabledStyles" value="rf-ds-btn rf-ds-btn-fastfwd rf-ds-dis"/>
<cdk:object name="id" value="#{clientId}_ds_ff"/>
<cdk:object name="defaultText" value="»»"/>
<xi:include xpointer="xpointer(/*)" href="buttons.template.include" />
@@ -96,8 +96,8 @@
<c:if test="#{controlsState.lastRendered}">
<cdk:object name="isEnabled" value="#{controlsState.lastEnabled}"/>
<cdk:object name="facet" value="#{component.getFacet('last')}"/>
- <cdk:object type="java.lang.String" name="enabledStyles" value="rf-ds-btn rf-ds-rgh"/>
- <cdk:object type="java.lang.String" name="disabledStyles" value="rf-ds-btn rf-ds-rgh rf-ds-dis"/>
+ <cdk:object type="java.lang.String" name="enabledStyles" value="rf-ds-btn rf-ds-btn-last"/>
+ <cdk:object type="java.lang.String" name="disabledStyles" value="rf-ds-btn rf-ds-btn-last rf-ds-dis"/>
<cdk:object name="id" value="#{clientId}_ds_l"/>
<cdk:object name="defaultText" value="»»»»"/>
<xi:include xpointer="xpointer(/*)" href="buttons.template.include" />
Modified: trunk/ui/iteration/ui/src/test/java/org/richfaces/renderkit/DataScrollerRenderTest.java
===================================================================
--- trunk/ui/iteration/ui/src/test/java/org/richfaces/renderkit/DataScrollerRenderTest.java 2011-01-11 12:07:52 UTC (rev 20947)
+++ trunk/ui/iteration/ui/src/test/java/org/richfaces/renderkit/DataScrollerRenderTest.java 2011-01-11 12:21:10 UTC (rev 20948)
@@ -49,15 +49,15 @@
// first/fastRewind/previous buttons with arrows
HtmlElement first = getFirstButton(page, scrollerId);
assertEquals("span", first.getNodeName());
- assertEquals("rf-ds-btn rf-ds-lft rf-ds-dis", first.getAttribute(HtmlConstants.CLASS_ATTRIBUTE).trim());
+ assertEquals("rf-ds-btn rf-ds-btn-first rf-ds-dis", first.getAttribute(HtmlConstants.CLASS_ATTRIBUTE).trim());
HtmlElement fastRewind = getFastRewindButton(page, scrollerId);
assertEquals("span", fastRewind.getNodeName());
- assertEquals("rf-ds-btn rf-ds-lft rf-ds-dis", fastRewind.getAttribute(HtmlConstants.CLASS_ATTRIBUTE).trim());
+ assertEquals("rf-ds-btn rf-ds-btn-fastrwd rf-ds-dis", fastRewind.getAttribute(HtmlConstants.CLASS_ATTRIBUTE).trim());
HtmlElement previous = getPreviousButton(page, scrollerId);
assertEquals("span", previous.getNodeName());
- assertEquals("rf-ds-btn rf-ds-lft rf-ds-dis", previous.getAttribute(HtmlConstants.CLASS_ATTRIBUTE).trim());
+ assertEquals("rf-ds-btn rf-ds-btn-prev rf-ds-dis", previous.getAttribute(HtmlConstants.CLASS_ATTRIBUTE).trim());
// currently selected digital button
HtmlElement dc1 = getDigitalButton(page, scrollerId, 1);
@@ -88,17 +88,17 @@
// next/fastForward/last buttons with arrows
HtmlElement next = getNextButton(page, scrollerId);
assertEquals("a", next.getNodeName());
- assertEquals("rf-ds-btn rf-ds-rgh", next.getAttribute(HtmlConstants.CLASS_ATTRIBUTE).trim());
+ assertEquals("rf-ds-btn rf-ds-btn-next", next.getAttribute(HtmlConstants.CLASS_ATTRIBUTE).trim());
assertEquals("javascript:void(0);", next.getAttribute(HtmlConstants.HREF_ATTR));
HtmlElement fastForward = getFastForwardButton(page, scrollerId);
assertEquals("a", fastForward.getNodeName());
- assertEquals("rf-ds-btn rf-ds-rgh", fastForward.getAttribute(HtmlConstants.CLASS_ATTRIBUTE).trim());
+ assertEquals("rf-ds-btn rf-ds-btn-fastfwd", fastForward.getAttribute(HtmlConstants.CLASS_ATTRIBUTE).trim());
assertEquals("javascript:void(0);", fastForward.getAttribute(HtmlConstants.HREF_ATTR));
HtmlElement last = getLastButton(page, scrollerId);
assertEquals("a", last.getNodeName());
- assertEquals("rf-ds-btn rf-ds-rgh", last.getAttribute(HtmlConstants.CLASS_ATTRIBUTE).trim());
+ assertEquals("rf-ds-btn rf-ds-btn-last", last.getAttribute(HtmlConstants.CLASS_ATTRIBUTE).trim());
assertEquals("javascript:void(0);", last.getAttribute(HtmlConstants.HREF_ATTR));
}
@@ -437,26 +437,26 @@
//check right buttons
assertEquals("a", fastForward.getNodeName());
- assertEquals("rf-ds-btn rf-ds-rgh", fastForward.getAttribute(HtmlConstants.CLASS_ATTRIBUTE).trim());
+ assertEquals("rf-ds-btn rf-ds-btn-fastfwd", fastForward.getAttribute(HtmlConstants.CLASS_ATTRIBUTE).trim());
assertEquals("a", last.getNodeName());
- assertEquals("rf-ds-btn rf-ds-rgh", last.getAttribute(HtmlConstants.CLASS_ATTRIBUTE).trim());
+ assertEquals("rf-ds-btn rf-ds-btn-last", last.getAttribute(HtmlConstants.CLASS_ATTRIBUTE).trim());
assertEquals("a", next.getNodeName());
- assertEquals("rf-ds-btn rf-ds-rgh", next.getAttribute(HtmlConstants.CLASS_ATTRIBUTE).trim());
+ assertEquals("rf-ds-btn rf-ds-btn-next", next.getAttribute(HtmlConstants.CLASS_ATTRIBUTE).trim());
fastForward = getFastForwardButton(page, secondScrollerId);
- last = getFastForwardButton(page, secondScrollerId);
+ last = getLastButton(page, secondScrollerId);
next = getNextButton(page, secondScrollerId);
assertEquals("a", fastForward.getNodeName());
- assertEquals("rf-ds-btn rf-ds-rgh", fastForward.getAttribute(HtmlConstants.CLASS_ATTRIBUTE).trim());
+ assertEquals("rf-ds-btn rf-ds-btn-fastfwd", fastForward.getAttribute(HtmlConstants.CLASS_ATTRIBUTE).trim());
assertEquals("a", last.getNodeName());
- assertEquals("rf-ds-btn rf-ds-rgh", last.getAttribute(HtmlConstants.CLASS_ATTRIBUTE).trim());
+ assertEquals("rf-ds-btn rf-ds-btn-last", last.getAttribute(HtmlConstants.CLASS_ATTRIBUTE).trim());
assertEquals("a", next.getNodeName());
- assertEquals("rf-ds-btn rf-ds-rgh", next.getAttribute(HtmlConstants.CLASS_ATTRIBUTE).trim());
+ assertEquals("rf-ds-btn rf-ds-btn-next", next.getAttribute(HtmlConstants.CLASS_ATTRIBUTE).trim());
//check if left buttons is disabled
HtmlElement fastRewind = getFastRewindButton(page, firstScrollerId);
@@ -464,26 +464,26 @@
HtmlElement previous = getPreviousButton(page, firstScrollerId);
assertEquals("span", fastRewind.getNodeName());
- assertEquals("rf-ds-btn rf-ds-lft rf-ds-dis", fastRewind.getAttribute(HtmlConstants.CLASS_ATTRIBUTE).trim());
+ assertEquals("rf-ds-btn rf-ds-btn-fastrwd rf-ds-dis", fastRewind.getAttribute(HtmlConstants.CLASS_ATTRIBUTE).trim());
assertEquals("span", first.getNodeName());
- assertEquals("rf-ds-btn rf-ds-lft rf-ds-dis", first.getAttribute(HtmlConstants.CLASS_ATTRIBUTE).trim());
+ assertEquals("rf-ds-btn rf-ds-btn-first rf-ds-dis", first.getAttribute(HtmlConstants.CLASS_ATTRIBUTE).trim());
assertEquals("span", previous.getNodeName());
- assertEquals("rf-ds-btn rf-ds-lft rf-ds-dis", previous.getAttribute(HtmlConstants.CLASS_ATTRIBUTE).trim());
+ assertEquals("rf-ds-btn rf-ds-btn-prev rf-ds-dis", previous.getAttribute(HtmlConstants.CLASS_ATTRIBUTE).trim());
fastRewind = getFastRewindButton(page, secondScrollerId);
first = getFirstButton(page, secondScrollerId);
next = getNextButton(page, secondScrollerId);
assertEquals("span", fastRewind.getNodeName());
- assertEquals("rf-ds-btn rf-ds-lft rf-ds-dis", fastRewind.getAttribute(HtmlConstants.CLASS_ATTRIBUTE).trim());
+ assertEquals("rf-ds-btn rf-ds-btn-fastrwd rf-ds-dis", fastRewind.getAttribute(HtmlConstants.CLASS_ATTRIBUTE).trim());
assertEquals("span", first.getNodeName());
- assertEquals("rf-ds-btn rf-ds-lft rf-ds-dis", first.getAttribute(HtmlConstants.CLASS_ATTRIBUTE).trim());
+ assertEquals("rf-ds-btn rf-ds-btn-first rf-ds-dis", first.getAttribute(HtmlConstants.CLASS_ATTRIBUTE).trim());
assertEquals("span", previous.getNodeName());
- assertEquals("rf-ds-btn rf-ds-lft rf-ds-dis", previous.getAttribute(HtmlConstants.CLASS_ATTRIBUTE).trim());
+ assertEquals("rf-ds-btn rf-ds-btn-prev rf-ds-dis", previous.getAttribute(HtmlConstants.CLASS_ATTRIBUTE).trim());
}
private void checkLastPageButtons(HtmlPage page, String firstScrollerId, String secondScrollerId) throws Exception {
@@ -493,13 +493,13 @@
HtmlElement next = getNextButton(page, firstScrollerId);
assertEquals("span", fastForward.getNodeName());
- assertEquals("rf-ds-btn rf-ds-rgh rf-ds-dis", fastForward.getAttribute(HtmlConstants.CLASS_ATTRIBUTE).trim());
+ assertEquals("rf-ds-btn rf-ds-btn-fastfwd rf-ds-dis", fastForward.getAttribute(HtmlConstants.CLASS_ATTRIBUTE).trim());
assertEquals("span", last.getNodeName());
- assertEquals("rf-ds-btn rf-ds-rgh rf-ds-dis", last.getAttribute(HtmlConstants.CLASS_ATTRIBUTE).trim());
+ assertEquals("rf-ds-btn rf-ds-btn-last rf-ds-dis", last.getAttribute(HtmlConstants.CLASS_ATTRIBUTE).trim());
assertEquals("span", next.getNodeName());
- assertEquals("rf-ds-btn rf-ds-rgh rf-ds-dis", next.getAttribute(HtmlConstants.CLASS_ATTRIBUTE).trim());
+ assertEquals("rf-ds-btn rf-ds-btn-next rf-ds-dis", next.getAttribute(HtmlConstants.CLASS_ATTRIBUTE).trim());
fastForward = getFastForwardButton(page, secondScrollerId);
@@ -507,13 +507,13 @@
next = getNextButton(page, secondScrollerId);
assertEquals("span", fastForward.getNodeName());
- assertEquals("rf-ds-btn rf-ds-rgh rf-ds-dis", fastForward.getAttribute(HtmlConstants.CLASS_ATTRIBUTE).trim());
+ assertEquals("rf-ds-btn rf-ds-btn-fastfwd rf-ds-dis", fastForward.getAttribute(HtmlConstants.CLASS_ATTRIBUTE).trim());
assertEquals("span", last.getNodeName());
- assertEquals("rf-ds-btn rf-ds-rgh rf-ds-dis", last.getAttribute(HtmlConstants.CLASS_ATTRIBUTE).trim());
+ assertEquals("rf-ds-btn rf-ds-btn-fastfwd rf-ds-dis", last.getAttribute(HtmlConstants.CLASS_ATTRIBUTE).trim());
assertEquals("span", next.getNodeName());
- assertEquals("rf-ds-btn rf-ds-rgh rf-ds-dis", next.getAttribute(HtmlConstants.CLASS_ATTRIBUTE).trim());
+ assertEquals("rf-ds-btn rf-ds-btn-next rf-ds-dis", next.getAttribute(HtmlConstants.CLASS_ATTRIBUTE).trim());
//check if left buttons is enabled
HtmlElement fastRewind = getFastRewindButton(page, firstScrollerId);
@@ -521,26 +521,26 @@
HtmlElement previous = getPreviousButton(page, firstScrollerId);
assertEquals("a", fastRewind.getNodeName());
- assertEquals("rf-ds-btn rf-ds-lft", fastRewind.getAttribute(HtmlConstants.CLASS_ATTRIBUTE).trim());
+ assertEquals("rf-ds-btn rf-ds-btn-fastrwd", fastRewind.getAttribute(HtmlConstants.CLASS_ATTRIBUTE).trim());
assertEquals("a", first.getNodeName());
- assertEquals("rf-ds-btn rf-ds-lft", first.getAttribute(HtmlConstants.CLASS_ATTRIBUTE).trim());
+ assertEquals("rf-ds-btn rf-ds-btn-first", first.getAttribute(HtmlConstants.CLASS_ATTRIBUTE).trim());
assertEquals("a", previous.getNodeName());
- assertEquals("rf-ds-btn rf-ds-lft", previous.getAttribute(HtmlConstants.CLASS_ATTRIBUTE).trim());
+ assertEquals("rf-ds-btn rf-ds-btn-prev", previous.getAttribute(HtmlConstants.CLASS_ATTRIBUTE).trim());
fastRewind = getFastRewindButton(page, secondScrollerId);
first = getFirstButton(page, secondScrollerId);
previous = getPreviousButton(page, secondScrollerId);
assertEquals("a", fastRewind.getNodeName());
- assertEquals("rf-ds-btn rf-ds-lft", fastRewind.getAttribute(HtmlConstants.CLASS_ATTRIBUTE).trim());
+ assertEquals("rf-ds-btn rf-ds-btn-fastrwd", fastRewind.getAttribute(HtmlConstants.CLASS_ATTRIBUTE).trim());
assertEquals("a", first.getNodeName());
- assertEquals("rf-ds-btn rf-ds-lft", first.getAttribute(HtmlConstants.CLASS_ATTRIBUTE).trim());
+ assertEquals("rf-ds-btn rf-ds-btn-first", first.getAttribute(HtmlConstants.CLASS_ATTRIBUTE).trim());
assertEquals("a", previous.getNodeName());
- assertEquals("rf-ds-btn rf-ds-lft", previous.getAttribute(HtmlConstants.CLASS_ATTRIBUTE).trim());
+ assertEquals("rf-ds-btn rf-ds-btn-prev", previous.getAttribute(HtmlConstants.CLASS_ATTRIBUTE).trim());
}
private String getCurrentPageContent(HtmlPage page, int i) throws Exception {
13 years, 11 months
JBoss Rich Faces SVN: r20947 - modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richTogglePanelItem.
by richfaces-svn-commits@lists.jboss.org
Author: ppitonak(a)redhat.com
Date: 2011-01-11 07:07:52 -0500 (Tue, 11 Jan 2011)
New Revision: 20947
Modified:
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richTogglePanelItem/TestRichTogglePanelItem.java
Log:
* testRendered for rich:togglePanelItem fixed
Modified: modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richTogglePanelItem/TestRichTogglePanelItem.java
===================================================================
--- modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richTogglePanelItem/TestRichTogglePanelItem.java 2011-01-11 11:48:38 UTC (rev 20946)
+++ modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richTogglePanelItem/TestRichTogglePanelItem.java 2011-01-11 12:07:52 UTC (rev 20947)
@@ -1,6 +1,6 @@
/*******************************************************************************
* JBoss, Home of Professional Open Source
- * Copyright 2010, Red Hat, Inc. and individual contributors
+ * Copyright 2010-2011, Red Hat, Inc. and individual contributors
* by the @authors tag. See the copyright.txt in the distribution for a
* full listing of individual contributors.
*
@@ -173,10 +173,12 @@
selenium.waitForPageToLoad();
assertFalse(selenium.isElementPresent(item1), "Tab should not be rendered when rendered=false.");
- selenium.click(link2);
- waitGui.failWith("Item 2 was not displayed.").until(isDisplayed.locator(item2));
- selenium.click(link3);
- waitGui.failWith("Item 3 was not displayed.").until(isDisplayed.locator(item3));
+ assertTrue(selenium.isDisplayed(item2), "Item 2 should be displayed when item 1 is not rendered.");
+
+ String timeValue = selenium.getText(time);
+ guardXhr(selenium).click(link3);
+ waitGui.failWith("Page was not updated").waitForChange(timeValue, retrieveText.locator(time));
+ assertTrue(selenium.isDisplayed(item3), "Item 3 was not displayed.");
}
@Test
13 years, 11 months
JBoss Rich Faces SVN: r20946 - modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/model/drag.
by richfaces-svn-commits@lists.jboss.org
Author: ppitonak(a)redhat.com
Date: 2011-01-11 06:48:38 -0500 (Tue, 11 Jan 2011)
New Revision: 20946
Modified:
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/model/drag/DragValue.java
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/model/drag/DropValue.java
Log:
* beans made serializable because of MyFaces (RF-10127)
Modified: modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/model/drag/DragValue.java
===================================================================
--- modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/model/drag/DragValue.java 2011-01-11 11:40:53 UTC (rev 20945)
+++ modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/model/drag/DragValue.java 2011-01-11 11:48:38 UTC (rev 20946)
@@ -1,6 +1,6 @@
/*******************************************************************************
* JBoss, Home of Professional Open Source
- * Copyright 2010, Red Hat, Inc. and individual contributors
+ * Copyright 2010-2011, Red Hat, Inc. and individual contributors
* by the @authors tag. See the copyright.txt in the distribution for a
* full listing of individual contributors.
*
@@ -21,11 +21,15 @@
*******************************************************************************/
package org.richfaces.tests.metamer.model.drag;
+import java.io.Serializable;
+
/**
* @author <a href="mailto:lfryc@redhat.com">Lukas Fryc</a>
* @version $Revision$
*/
-public class DragValue {
+public class DragValue implements Serializable {
+
+ private static final long serialVersionUID = -1L;
int number;
public DragValue(int number) {
@@ -36,4 +40,4 @@
public String toString() {
return "DragValue [number=" + number + "]";
}
-}
\ No newline at end of file
+}
Property changes on: modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/model/drag/DragValue.java
___________________________________________________________________
Name: svn:keywords
+ Revision
Modified: modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/model/drag/DropValue.java
===================================================================
--- modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/model/drag/DropValue.java 2011-01-11 11:40:53 UTC (rev 20945)
+++ modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/model/drag/DropValue.java 2011-01-11 11:48:38 UTC (rev 20946)
@@ -1,6 +1,6 @@
/*******************************************************************************
* JBoss, Home of Professional Open Source
- * Copyright 2010, Red Hat, Inc. and individual contributors
+ * Copyright 2010-2011, Red Hat, Inc. and individual contributors
* by the @authors tag. See the copyright.txt in the distribution for a
* full listing of individual contributors.
*
@@ -21,11 +21,15 @@
*******************************************************************************/
package org.richfaces.tests.metamer.model.drag;
+import java.io.Serializable;
+
/**
* @author <a href="mailto:lfryc@redhat.com">Lukas Fryc</a>
* @version $Revision$
*/
-public class DropValue {
+public class DropValue implements Serializable {
+
+ private static final long serialVersionUID = -1L;
int number;
public DropValue(int number) {
Property changes on: modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/model/drag/DropValue.java
___________________________________________________________________
Name: svn:keywords
+ Revision
13 years, 11 months
JBoss Rich Faces SVN: r20945 - modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/a4jOutputPanel.
by richfaces-svn-commits@lists.jboss.org
Author: ppitonak(a)redhat.com
Date: 2011-01-11 06:40:53 -0500 (Tue, 11 Jan 2011)
New Revision: 20945
Modified:
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/a4jOutputPanel/TestA4JOutputPanel.java
Log:
* part of testLayout commented out because not implemented
Modified: modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/a4jOutputPanel/TestA4JOutputPanel.java
===================================================================
--- modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/a4jOutputPanel/TestA4JOutputPanel.java 2011-01-11 11:36:37 UTC (rev 20944)
+++ modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/a4jOutputPanel/TestA4JOutputPanel.java 2011-01-11 11:40:53 UTC (rev 20945)
@@ -152,10 +152,11 @@
assertTrue(selenium.isElementPresent(outputDiv), "Div should be rendered when block is set.");
assertFalse(selenium.isElementPresent(outputSpan), "Div should be rendered when block is set.");
- selenium.click(optionNone);
- selenium.waitForPageToLoad(TIMEOUT);
- assertFalse(selenium.isElementPresent(outputDiv), "Span should be rendered when none is set.");
- assertTrue(selenium.isElementPresent(outputSpan), "Span should be rendered when none is set.");
+ // TODO uncomment as soon as implemented https://issues.jboss.org/browse/RF-7819
+ // selenium.click(optionNone);
+ // selenium.waitForPageToLoad(TIMEOUT);
+ // assertFalse(selenium.isElementPresent(outputDiv), "Span should be rendered when none is set.");
+ // assertTrue(selenium.isElementPresent(outputSpan), "Span should be rendered when none is set.");
}
@Test
13 years, 11 months
JBoss Rich Faces SVN: r20944 - in modules/tests/metamer/trunk/application/src/main: webapp/components and 3 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: lfryc(a)redhat.com
Date: 2011-01-11 06:36:37 -0500 (Tue, 11 Jan 2011)
New Revision: 20944
Added:
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichPanelMenuGroupBean.java
modules/tests/metamer/trunk/application/src/main/webapp/components/richPanelMenuGroup/
modules/tests/metamer/trunk/application/src/main/webapp/components/richPanelMenuGroup/list.xhtml
modules/tests/metamer/trunk/application/src/main/webapp/components/richPanelMenuGroup/simple.xhtml
Modified:
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichBean.java
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichPanelMenuItemBean.java
modules/tests/metamer/trunk/application/src/main/webapp/components/richPanelMenu/simple.xhtml
modules/tests/metamer/trunk/application/src/main/webapp/components/richPanelMenuItem/simple.xhtml
Log:
rich:panelMenu - panelMenuGroup - added initial sample (RFPL-1045)
Modified: modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichBean.java
===================================================================
--- modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichBean.java 2011-01-11 11:35:42 UTC (rev 20943)
+++ modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichBean.java 2011-01-11 11:36:37 UTC (rev 20944)
@@ -146,6 +146,7 @@
components.put("richMenuSeparator", "Rich Menu Separator");
components.put("richPanel", "Rich Panel");
components.put("richPanelMenu", "Rich Panel Menu");
+ components.put("richPanelMenuGroup", "Rich Panel Menu Group");
components.put("richPanelMenuItem", "Rich Panel Menu Item");
components.put("richPopupPanel", "Rich Popup Panel");
components.put("richProgressBar", "Rich Progress Bar");
Copied: modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichPanelMenuGroupBean.java (from rev 20943, modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichPanelMenuItemBean.java)
===================================================================
--- modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichPanelMenuGroupBean.java (rev 0)
+++ modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichPanelMenuGroupBean.java 2011-01-11 11:36:37 UTC (rev 20944)
@@ -0,0 +1,85 @@
+/*******************************************************************************
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010, Red Hat, Inc. and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ *******************************************************************************/
+package org.richfaces.tests.metamer.bean;
+
+import java.io.Serializable;
+
+import javax.annotation.PostConstruct;
+import javax.faces.bean.ManagedBean;
+import javax.faces.bean.ViewScoped;
+
+import org.richfaces.component.html.HtmlPanelMenuGroup;
+import org.richfaces.tests.metamer.Attributes;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * Managed bean for rich:panelMenu.
+ *
+ * @author <a href="mailto:ppitonak@redhat.com">Pavol Pitonak</a>
+ * @version $Revision$
+ */
+@ManagedBean(name = "richPanelMenuGroupBean")
+@ViewScoped
+public class RichPanelMenuGroupBean implements Serializable {
+
+ private static final long serialVersionUID = -1L;
+ private static Logger logger;
+ private Attributes attributes;
+
+ /**
+ * Initializes the managed bean.
+ */
+ @PostConstruct
+ public void init() {
+ logger = LoggerFactory.getLogger(getClass());
+ logger.debug("initializing bean " + getClass().getName());
+
+ attributes = Attributes.getComponentAttributesFromClass(HtmlPanelMenuGroup.class, getClass());
+
+ attributes.setAttribute("rendered", true);
+
+ // already defined in source directly
+ attributes.remove("name");
+ attributes.remove("label");
+
+ // attributes should be hidden
+ attributes.remove("panelMenu");
+ attributes.remove("parentItem");
+ attributes.remove("topItem");
+ attributes.remove("submittedExpanded");
+ attributes.remove("value");
+ }
+
+ public Attributes getAttributes() {
+ return attributes;
+ }
+
+ public void setAttributes(Attributes attributes) {
+ this.attributes = attributes;
+ }
+
+ public void changeExpandListener(Object event) {
+ // TODO ajax or server expansion doesn't work yet
+ throw new UnsupportedOperationException("needs to be implemented in Metamer");
+ }
+}
Modified: modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichPanelMenuItemBean.java
===================================================================
--- modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichPanelMenuItemBean.java 2011-01-11 11:35:42 UTC (rev 20943)
+++ modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichPanelMenuItemBean.java 2011-01-11 11:36:37 UTC (rev 20944)
@@ -61,6 +61,12 @@
// already defined in source directly
attributes.remove("name");
attributes.remove("label");
+
+ // attributes should be hidden
+ attributes.remove("panelMenu");
+ attributes.remove("parentItem");
+ attributes.remove("topItem");
+ attributes.remove("value");
}
public Attributes getAttributes() {
Modified: modules/tests/metamer/trunk/application/src/main/webapp/components/richPanelMenu/simple.xhtml
===================================================================
--- modules/tests/metamer/trunk/application/src/main/webapp/components/richPanelMenu/simple.xhtml 2011-01-11 11:35:42 UTC (rev 20943)
+++ modules/tests/metamer/trunk/application/src/main/webapp/components/richPanelMenu/simple.xhtml 2011-01-11 11:36:37 UTC (rev 20944)
@@ -43,6 +43,8 @@
<rich:panelMenu id="panelMenu"
action="#{richBean.dummyAction}"
actionListener="#{richBean.dummyActionListener}"
+ itemChangeListener="#{richPanelMenuBean.itemChangeListener}"
+
activeItem="#{richPanelMenuBean.attributes['activeItem'].value}"
bubbleSelection="#{richPanelMenuBean.attributes['bubbleSelection'].value}"
bypassUpdates="#{richPanelMenuBean.attributes['bypassUpdates'].value}"
@@ -62,7 +64,6 @@
groupExpandIconRight="#{richPanelMenuBean.attributes['groupExpandIconRight'].value}"
groupMode="#{richPanelMenuBean.attributes['groupMode'].value}"
immediate="#{richPanelMenuBean.attributes['immediate'].value}"
- itemChangeListener="#{richPanelMenuBean.itemChangeListener}"
itemClass="#{richPanelMenuBean.attributes['topItemClass'].value}"
itemDisableClass="#{richPanelMenuBean.attributes['topItemDisableClass'].value}"
itemDisableIconLeft="#{richPanelMenuBean.attributes['topItemDisableIconLeft'].value}"
Added: modules/tests/metamer/trunk/application/src/main/webapp/components/richPanelMenuGroup/list.xhtml
===================================================================
--- modules/tests/metamer/trunk/application/src/main/webapp/components/richPanelMenuGroup/list.xhtml (rev 0)
+++ modules/tests/metamer/trunk/application/src/main/webapp/components/richPanelMenuGroup/list.xhtml 2011-01-11 11:36:37 UTC (rev 20944)
@@ -0,0 +1,42 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xmlns:ui="http://java.sun.com/jsf/facelets"
+ xmlns:metamer="http://java.sun.com/jsf/composite/metamer">
+
+ <!--
+JBoss, Home of Professional Open Source
+Copyright 2010, Red Hat, Inc. and individual contributors
+by the @authors tag. See the copyright.txt in the distribution for a
+full listing of individual contributors.
+
+This is free software; you can redistribute it and/or modify it
+under the terms of the GNU Lesser General Public License as
+published by the Free Software Foundation; either version 2.1 of
+the License, or (at your option) any later version.
+
+This software is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this software; if not, write to the Free
+Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ -->
+
+ <ui:composition template="/templates/list.xhtml">
+
+ <ui:define name="pageTitle">Rich Panel Menu Group</ui:define>
+
+ <ui:define name="links">
+
+ <metamer:testPageLink id="simple" outcome="simple" value="Simple">
+ Simple page containing <b>rich:panelMenuGroup</b> inside <b>rich:panelMenu</b> and input boxes for all its attributes.
+ </metamer:testPageLink>
+
+ </ui:define>
+
+ </ui:composition>
+
+</html>
Added: modules/tests/metamer/trunk/application/src/main/webapp/components/richPanelMenuGroup/simple.xhtml
===================================================================
--- modules/tests/metamer/trunk/application/src/main/webapp/components/richPanelMenuGroup/simple.xhtml (rev 0)
+++ modules/tests/metamer/trunk/application/src/main/webapp/components/richPanelMenuGroup/simple.xhtml 2011-01-11 11:36:37 UTC (rev 20944)
@@ -0,0 +1,135 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xmlns:h="http://java.sun.com/jsf/html" xmlns:f="http://java.sun.com/jsf/core"
+ xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:metamer="http://java.sun.com/jsf/composite/metamer"
+ xmlns:rich="http://richfaces.org/rich" xmlns:a4j="http://richfaces.org/a4j">
+
+ <!--
+JBoss, Home of Professional Open Source
+Copyright 2010, Red Hat, Inc. and individual contributors
+by the @authors tag. See the copyright.txt in the distribution for a
+full listing of individual contributors.
+
+This is free software; you can redistribute it and/or modify it
+under the terms of the GNU Lesser General Public License as
+published by the Free Software Foundation; either version 2.1 of
+the License, or (at your option) any later version.
+
+This software is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this software; if not, write to the Free
+Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ -->
+
+ <ui:composition template="/templates/template.xhtml">
+ <ui:define name="head">
+ <f:metadata>
+ <f:viewParam name="templates" value="#{templateBean.templates}">
+ <f:converter converterId="templatesListConverter" />
+ </f:viewParam>
+ </f:metadata>
+ </ui:define>
+
+ <ui:define name="outOfTemplateBefore">
+ </ui:define>
+
+ <ui:define name="component">
+
+ <rich:panelMenu id="panelMenu" style="width: 250px; "
+ action="#{richBean.dummyAction}"
+ actionListener="#{richBean.dummyActionListener}"
+ activeItem="#{richPanelMenuBean.attributes['activeItem'].value}"
+ itemChangeListener="#{richPanelMenuBean.itemChangeListener}">
+
+ <rich:panelMenuGroup id="group1" name="group1" label="Group 1">
+ <rich:panelMenuItem id="item11" name="item11" label="Item 1.1"/>
+ <rich:panelMenuItem id="item12" name="item12" label="Item 1.2" />
+ <rich:panelMenuItem id="item13" name="item13" label="Item 1.3"/>
+ </rich:panelMenuGroup>
+
+ <rich:panelMenuGroup id="group2" name="group2" label="Group 2 (influenced by attributes)"
+ action="#{richBean.dummyAction}"
+ actionListener="#{richBean.dummyActionListener}"
+ changeExpandListener="#{richPanelMenuGroupBean.changeExpandListener}"
+
+ bubbleSelection="#{richPanelMenuGroupBean.attributes['bubbleSelection'].value}"
+ bypassUpdates="#{richPanelMenuGroupBean.attributes['bypassUpdates'].value}"
+ collapseEvent="#{richPanelMenuGroupBean.attributes['collapseEvent'].value}"
+ data="#{richPanelMenuGroupBean.attributes['data'].value}"
+ disabled="#{richPanelMenuGroupBean.attributes['disabled'].value}"
+ disabledClass="#{richPanelMenuGroupBean.attributes['disabledClass'].value}"
+ execute="#{richPanelMenuGroupBean.attributes['execute'].value}"
+ expandEvent="#{richPanelMenuGroupBean.attributes['expandEvent'].value}"
+ expandSingle="#{richPanelMenuGroupBean.attributes['expandSingle'].value}"
+ expanded="#{richPanelMenuGroupBean.attributes['expanded'].value}"
+ hoverClass="#{richPanelMenuGroupBean.attributes['hoverClass'].value}"
+ iconLeftClass="#{richPanelMenuGroupBean.attributes['iconLeftClass'].value}"
+ iconLeftCollapsed="#{richPanelMenuGroupBean.attributes['iconLeftCollapsed'].value}"
+ iconLeftDisabled="#{richPanelMenuGroupBean.attributes['iconLeftDisabled'].value}"
+ iconLeftExpanded="#{richPanelMenuGroupBean.attributes['iconLeftExpanded'].value}"
+ iconRightClass="#{richPanelMenuGroupBean.attributes['iconRightClass'].value}"
+ iconRightCollapsed="#{richPanelMenuGroupBean.attributes['iconRightCollapsed'].value}"
+ iconRightDisabled="#{richPanelMenuGroupBean.attributes['iconRightDisabled'].value}"
+ iconRightExpanded="#{richPanelMenuGroupBean.attributes['iconRightExpanded'].value}"
+ immediate="#{richPanelMenuGroupBean.attributes['immediate'].value}"
+ limitRender="#{richPanelMenuGroupBean.attributes['limitRender'].value}"
+ mode="#{richPanelMenuGroupBean.attributes['mode'].value}"
+ onbeforecollapse="#{richPanelMenuGroupBean.attributes['onbeforecollapse'].value}"
+ onbeforedomupdate="#{richPanelMenuGroupBean.attributes['onbeforedomupdate'].value}"
+ onbeforeexpand="#{richPanelMenuGroupBean.attributes['onbeforeexpand'].value}"
+ onbeforeselect="#{richPanelMenuGroupBean.attributes['onbeforeselect'].value}"
+ onbeforeswitch="#{richPanelMenuGroupBean.attributes['onbeforeswitch'].value}"
+ onclick="#{richPanelMenuGroupBean.attributes['onclick'].value}"
+ oncollapse="#{richPanelMenuGroupBean.attributes['oncollapse'].value}"
+ oncomplete="#{richPanelMenuGroupBean.attributes['oncomplete'].value}"
+ ondblclick="#{richPanelMenuGroupBean.attributes['ondblclick'].value}"
+ onexpand="#{richPanelMenuGroupBean.attributes['onexpand'].value}"
+ onmousedown="#{richPanelMenuGroupBean.attributes['onmousedown'].value}"
+ onmousemove="#{richPanelMenuGroupBean.attributes['onmousemove'].value}"
+ onmouseout="#{richPanelMenuGroupBean.attributes['onmouseout'].value}"
+ onmouseover="#{richPanelMenuGroupBean.attributes['onmouseover'].value}"
+ onmouseup="#{richPanelMenuGroupBean.attributes['onmouseup'].value}"
+ onselect="#{richPanelMenuGroupBean.attributes['onselect'].value}"
+ onswitch="#{richPanelMenuGroupBean.attributes['onswitch'].value}"
+ onunselect="#{richPanelMenuGroupBean.attributes['onunselect'].value}"
+ render="#{richPanelMenuGroupBean.attributes['render'].value}"
+ rendered="#{richPanelMenuGroupBean.attributes['rendered'].value}"
+ status="#{richPanelMenuGroupBean.attributes['status'].value}"
+ style="#{richPanelMenuGroupBean.attributes['style'].value}"
+ styleClass="#{richPanelMenuGroupBean.attributes['styleClass'].value}"
+ >
+ <rich:panelMenuItem id="item21" name="item21" label="Item 2.1"/>
+ <rich:panelMenuItem id="item22" name="item22" label="Item 2.2" />
+ <rich:panelMenuItem id="item23" name="item23" label="Item 2.3"/>
+ </rich:panelMenuGroup>
+
+ <rich:panelMenuGroup id="group3" name="group3" label="Group 3">
+ <rich:panelMenuItem id="item31" name="item31" label="Item 3.1"/>
+ <rich:panelMenuItem id="item32" name="item32" label="Item 3.2" />
+ <rich:panelMenuItem id="item33" name="item33" label="Item 3.3"/>
+ </rich:panelMenuGroup>
+ </rich:panelMenu>
+
+ <br/><br/>
+
+ <fieldset>
+ <legend>selected item</legend>
+
+ <a4j:outputPanel id="selectedPanel" ajaxRendered="true">
+ <h:outputText id="current" value="#{richPanelMenuBean.attributes['activeItem'].value}" />
+ </a4j:outputPanel>
+ </fieldset>
+
+ </ui:define>
+
+ <ui:define name="outOfTemplateAfter">
+ <metamer:attributes value="#{richPanelMenuGroupBean.attributes}" id="attributes" render="log"/>
+ </ui:define>
+
+ </ui:composition>
+</html>
\ No newline at end of file
Modified: modules/tests/metamer/trunk/application/src/main/webapp/components/richPanelMenuItem/simple.xhtml
===================================================================
--- modules/tests/metamer/trunk/application/src/main/webapp/components/richPanelMenuItem/simple.xhtml 2011-01-11 11:35:42 UTC (rev 20943)
+++ modules/tests/metamer/trunk/application/src/main/webapp/components/richPanelMenuItem/simple.xhtml 2011-01-11 11:36:37 UTC (rev 20944)
@@ -46,7 +46,7 @@
activeItem="#{richPanelMenuBean.attributes['activeItem'].value}"
itemChangeListener="#{richPanelMenuBean.itemChangeListener}">
- <rich:panelMenuGroup id="group1" name="group1" label="Group 1">
+ <rich:panelMenuGroup id="group1" name="group1" label="Group 1" expanded="true">
<rich:panelMenuItem id="item11" name="item11" label="Item 1.1"/>
<rich:panelMenuItem id="item12" name="item12" label="Item 1.2 (influenced by attributes)"
action="#{richBean.dummyAction}"
13 years, 11 months