JBoss Rich Faces SVN: r18670 - in trunk: examples/output-demo/src/main/webapp/qunit and 3 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: Alex.Kolonitsky
Date: 2010-08-16 11:48:02 -0400 (Mon, 16 Aug 2010)
New Revision: 18670
Added:
trunk/examples/output-demo/src/main/webapp/qunit/accordionHeaders.xhtml
trunk/examples/output-demo/src/main/webapp/resources/tests/richfaces-accordion-headers-qunit.js
Modified:
trunk/examples/output-demo/src/main/webapp/WEB-INF/faces-config.xml
trunk/examples/output-demo/src/main/webapp/qunit/accordion.xhtml
trunk/examples/output-demo/src/main/webapp/templates/template.xhtml
trunk/ui/output/ui/src/main/java/org/richfaces/renderkit/html/AccordionItemRenderer.java
Log:
RF-8790
Modified: trunk/examples/output-demo/src/main/webapp/WEB-INF/faces-config.xml
===================================================================
--- trunk/examples/output-demo/src/main/webapp/WEB-INF/faces-config.xml 2010-08-16 15:47:11 UTC (rev 18669)
+++ trunk/examples/output-demo/src/main/webapp/WEB-INF/faces-config.xml 2010-08-16 15:48:02 UTC (rev 18670)
@@ -48,5 +48,9 @@
<from-outcome>qunit/accordion</from-outcome>
<to-view-id>/qunit/accordion.xhtml</to-view-id>
</navigation-case>
+ <navigation-case>
+ <from-outcome>qunit/accordionHeaders</from-outcome>
+ <to-view-id>/qunit/accordionHeaders.xhtml</to-view-id>
+ </navigation-case>
</navigation-rule>
</faces-config>
Modified: trunk/examples/output-demo/src/main/webapp/qunit/accordion.xhtml
===================================================================
--- trunk/examples/output-demo/src/main/webapp/qunit/accordion.xhtml 2010-08-16 15:47:11 UTC (rev 18669)
+++ trunk/examples/output-demo/src/main/webapp/qunit/accordion.xhtml 2010-08-16 15:48:02 UTC (rev 18670)
@@ -12,15 +12,6 @@
<h:outputScript name="qunit/qunit.js" />
<h:outputScript name="qunit/richfaces-qunit.js" />
- <!--<h:outputScript name="richfaces-event.js" />-->
- <!--<h:outputScript name="richfaces-base-component.js" />-->
- <!--<h:outputScript name="richfaces.js" />-->
- <!--<h:outputScript name="TogglePanel.js" />-->
- <!--<h:outputScript name="TogglePanelItem.js" />-->
- <!--<h:outputScript name="TogglePanelTitledItem.js" />-->
- <!--<h:outputScript name="AccordionItem.js" />-->
- <!--<h:outputScript name="Accordion.js" />-->
-
<h:outputStylesheet name="qunit/qunit.css" />
</ui:define>
@@ -31,50 +22,13 @@
<p>Page</p>
<h:form id="f" style="border:blue solid thin;">
- <pn:accordion id="panel" style="padding: 0px; height: 400px; width: 500px;" switchType="ajax">
+ <pn:accordion id="panel">
<pn:accordionItem header="label 1">content 1</pn:accordionItem>
<pn:accordionItem header="label 2">content 2</pn:accordionItem>
<pn:accordionItem header="label 3">content 3</pn:accordionItem>
</pn:accordion>
</h:form>
-<!-- <h:form id="f" style="border:blue solid thin;">
- <div id="f:panel" style="padding: 0px; height: 400px; width: 500px;" class="rich-panelbar rich-panelbar-b">
- <input type="hidden" id="f:panel-value" />
- <div id="f:name1" class="rich-panelbar rich-panelbar-interior ">
- <div id="f:name1-header" class="rich-panelbar-header">label 1</div>
- <div id="f:name1-content" style="display: block; width: 100%; overflow: auto;"
- class="rich-panelbar-content-exterior">
- content 1
- </div>
- </div>
- <div id="f:name2" class="rich-panelbar rich-panelbar-interior ">
- <div id="f:name2-header" class="rich-panelbar-header">label 2</div>
- <div id="f:name2-content" style="display: none; width: 100%; overflow: auto;"
- class="rich-panelbar-content-exterior">
- content 2
- </div>
- </div>
- <div id="f:name3" class="rich-panelbar rich-panelbar-interior ">
- <div id="f:name3-header" class="rich-panelbar-header ">label 3</div>
- <div id="f:name3-content" style="display: none; width: 100%; overflow: auto;"
- class="rich-panelbar-content-exterior">
- content 3
- </div>
- </div>
- <script type="text/javascript">
- new RichFaces.ui.Accordion("f:panel",{
- "items":[
- new RichFaces.ui.AccordionItem("f:name1",{"togglePanelId":"f:panel","switchMode":"client","name":"name1"} ),
- new RichFaces.ui.AccordionItem("f:name2",{"togglePanelId":"f:panel","switchMode":"client","name":"name2"} ),
- new RichFaces.ui.AccordionItem("f:name3",{"togglePanelId":"f:panel","switchMode":"client","name":"name3"} )] ,
- "ajax":{"status":"null","incId":"1"} ,
- "activeItem":"name1",
- "isKeepHeight": false} )
- </script>
- </div>
- </h:form>-->
-
<p>Result</p>
<div>
<ol id="qunit-tests"></ol>
Added: trunk/examples/output-demo/src/main/webapp/qunit/accordionHeaders.xhtml
===================================================================
--- trunk/examples/output-demo/src/main/webapp/qunit/accordionHeaders.xhtml (rev 0)
+++ trunk/examples/output-demo/src/main/webapp/qunit/accordionHeaders.xhtml 2010-08-16 15:48:02 UTC (rev 18670)
@@ -0,0 +1,58 @@
+<!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:pn="http://richfaces.org/output">
+
+<body>
+<ui:composition template="/templates/template.xhtml">
+
+ <ui:define name="scripts">
+ <h:outputScript name="qunit/qunit.js" />
+ <h:outputScript name="qunit/richfaces-qunit.js" />
+
+ <h:outputStylesheet name="qunit/qunit.css" />
+ </ui:define>
+
+ <ui:define name="title">Accordion Example</ui:define>
+ <ui:define name="body_head">Accordion Example</ui:define>
+
+ <ui:define name="body">
+ <p>Page</p>
+
+ <h:form id="f" style="border:blue solid thin;">
+ <pn:accordion id="panel" style="padding: 0px; height: 400px; width: 500px;" switchType="client">
+ <pn:accordionItem header="label 1">
+ <f:facet name="headerInactive">headerInactive 1</f:facet>
+ <f:facet name="headerActive">headerActive 1</f:facet>
+ <f:facet name="headerDisable">headerDisable 1</f:facet>
+ content 1
+ </pn:accordionItem>
+ <pn:accordionItem header="label 2" disabled="true">
+ <f:facet name="headerInactive">headerInactive 2</f:facet>
+ <f:facet name="headerActive">headerActive 2</f:facet>
+ <f:facet name="headerDisable">headerDisable 2</f:facet>
+ content 2
+ </pn:accordionItem>
+ <pn:accordionItem header="label 3">
+ <f:facet name="headerInactive">headerInactive 3</f:facet>
+ <f:facet name="headerActive">headerActive 3</f:facet>
+ <f:facet name="headerDisable">headerDisable 3</f:facet>
+ content 3
+ </pn:accordionItem>
+ </pn:accordion>
+ </h:form>
+
+ <p>Result</p>
+ <div>
+ <ol id="qunit-tests"></ol>
+
+ <div id="testDiv" style="margin-top:10px; border:1px solid #a0a0a0">Main Test Div</div>
+ </div>
+ <h:outputScript name="tests/richfaces-accordion-headers-qunit.js" />
+ </ui:define>
+</ui:composition>
+</body>
+</html>
+
Added: trunk/examples/output-demo/src/main/webapp/resources/tests/richfaces-accordion-headers-qunit.js
===================================================================
--- trunk/examples/output-demo/src/main/webapp/resources/tests/richfaces-accordion-headers-qunit.js (rev 0)
+++ trunk/examples/output-demo/src/main/webapp/resources/tests/richfaces-accordion-headers-qunit.js 2010-08-16 15:48:02 UTC (rev 18670)
@@ -0,0 +1,64 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright ${year}, Red Hat, Inc. and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+
+RichFaces.QUnit.run(function() {
+ module("richfaces-accordion");
+
+ var ACCORDION_ID = "f:panel";
+
+ test("RichFaces.ui.Accordion change headers", function () {
+ var c = RichFaces.$(ACCORDION_ID);
+
+ ok(c instanceof RichFaces.ui.Accordion, "inctance of RichFaces.ui.Accordion");
+ equals(c.id, ACCORDION_ID, "id");
+
+ equals(c.getItems().length, 3, "getItems().length");
+
+ var items = c.getItems();
+ ok( items[0].__header("active" ).is(":visible"), "1 item: active visible");
+ ok(!items[0].__header("inactive").is(":visible"), "1 item: inactive unvisible");
+ ok(!items[0].__header("disable" ).is(":visible"), "1 item: disabled unvisible");
+
+ ok(!items[1].__header("active" ).is(":visible"), "2 item: active unvisible");
+ ok(!items[1].__header("inactive").is(":visible"), "2 item: inactive unvisible");
+ ok( items[1].__header("disable" ).is(":visible"), "2 item: disabled visible");
+
+ ok(!items[2].__header("active" ).is(":visible"), "3 item: active unvisible");
+ ok( items[2].__header("inactive").is(":visible"), "3 item: inactive visible");
+ ok(!items[2].__header("disable" ).is(":visible"), "3 item: disabled unvisible");
+
+ c.switchToItem(items[2].getName());
+ ok(!items[0].__header("active" ).is(":visible"), "1 item: active unvisible");
+ ok( items[0].__header("inactive").is(":visible"), "1 item: inactive visible");
+ ok(!items[0].__header("disable" ).is(":visible"), "1 item: disabled unvisible");
+
+ ok(!items[1].__header("active" ).is(":visible"), "2 item: active unvisible");
+ ok(!items[1].__header("inactive").is(":visible"), "2 item: inactive unvisible");
+ ok( items[1].__header("disable" ).is(":visible"), "2 item: disabled visible");
+
+ ok( items[2].__header("active" ).is(":visible"), "3 item: active visible");
+ ok(!items[2].__header("inactive").is(":visible"), "3 item: inactive unvisible");
+ ok(!items[2].__header("disable" ).is(":visible"), "3 item: disabled unvisible");
+
+ c.switchToItem(items[0].getName());
+ });
+});
Modified: trunk/examples/output-demo/src/main/webapp/templates/template.xhtml
===================================================================
--- trunk/examples/output-demo/src/main/webapp/templates/template.xhtml 2010-08-16 15:47:11 UTC (rev 18669)
+++ trunk/examples/output-demo/src/main/webapp/templates/template.xhtml 2010-08-16 15:48:02 UTC (rev 18670)
@@ -52,6 +52,7 @@
<li><h:commandLink value="togglePanel" action="qunit/togglePanel" /></li>
<li><h:commandLink value="togglePanelItem" action="qunit/togglePanelItem" /></li>
<li><h:commandLink value="accordion" action="qunit/accordion" /></li>
+ <li><h:commandLink value="accordionHeaders" action="qunit/accordionHeaders" /></li>
</ul>
</h:form>
</td>
Modified: trunk/ui/output/ui/src/main/java/org/richfaces/renderkit/html/AccordionItemRenderer.java
===================================================================
--- trunk/ui/output/ui/src/main/java/org/richfaces/renderkit/html/AccordionItemRenderer.java 2010-08-16 15:47:11 UTC (rev 18669)
+++ trunk/ui/output/ui/src/main/java/org/richfaces/renderkit/html/AccordionItemRenderer.java 2010-08-16 15:48:02 UTC (rev 18670)
@@ -138,7 +138,7 @@
writer.writeAttribute("class", "rf-aci-h-" + state + " " + attributeAsString(component, name), name);
- UIComponent headerFacet = component.getFacet("header");
+ UIComponent headerFacet = component.getFacet("header" + capitalize(state));
if (headerFacet != null && headerFacet.isRendered()) {
headerFacet.encodeAll(facesContext);
} else {
15 years, 9 months
JBoss Rich Faces SVN: r18669 - branches.
by richfaces-svn-commits@lists.jboss.org
Author: jbalunas(a)redhat.com
Date: 2010-08-16 11:47:11 -0400 (Mon, 16 Aug 2010)
New Revision: 18669
Removed:
branches/RF-9040_build_updated_m2/
Log:
RF-9040 development branch now closed
15 years, 9 months
JBoss Rich Faces SVN: r18668 - branches.
by richfaces-svn-commits@lists.jboss.org
Author: jbalunas(a)redhat.com
Date: 2010-08-16 11:46:18 -0400 (Mon, 16 Aug 2010)
New Revision: 18668
Added:
branches/RF-9023/
Log:
RF-9023 creation of dev branch
Copied: branches/RF-9023 (from rev 18667, trunk)
15 years, 9 months
JBoss Rich Faces SVN: r18667 - trunk/ui/iteration/ui/src/main/java/org/richfaces/renderkit.
by richfaces-svn-commits@lists.jboss.org
Author: abelevich
Date: 2010-08-16 10:30:58 -0400 (Mon, 16 Aug 2010)
New Revision: 18667
Modified:
trunk/ui/iteration/ui/src/main/java/org/richfaces/renderkit/DataTableRenderer.java
trunk/ui/iteration/ui/src/main/java/org/richfaces/renderkit/SubTableRenderer.java
trunk/ui/iteration/ui/src/main/java/org/richfaces/renderkit/SubTableToggleControlRendererBase.java
Log:
fix resource dependency
Modified: trunk/ui/iteration/ui/src/main/java/org/richfaces/renderkit/DataTableRenderer.java
===================================================================
--- trunk/ui/iteration/ui/src/main/java/org/richfaces/renderkit/DataTableRenderer.java 2010-08-16 14:27:55 UTC (rev 18666)
+++ trunk/ui/iteration/ui/src/main/java/org/richfaces/renderkit/DataTableRenderer.java 2010-08-16 14:30:58 UTC (rev 18667)
@@ -51,6 +51,8 @@
@JsfRenderer(type = "org.richfaces.DataTableRenderer", family = AbstractDataTable.COMPONENT_FAMILY)
@ResourceDependencies({
+ @ResourceDependency(name = "jquery.js"),
+ @ResourceDependency(name = "richfaces.js"),
@ResourceDependency(name = "richfaces-base-component.js"),
@ResourceDependency(library="org.richfaces", name = "datatable.js"),
@ResourceDependency(library="org.richfaces", name = "datatable.ecss")
Modified: trunk/ui/iteration/ui/src/main/java/org/richfaces/renderkit/SubTableRenderer.java
===================================================================
--- trunk/ui/iteration/ui/src/main/java/org/richfaces/renderkit/SubTableRenderer.java 2010-08-16 14:27:55 UTC (rev 18666)
+++ trunk/ui/iteration/ui/src/main/java/org/richfaces/renderkit/SubTableRenderer.java 2010-08-16 14:30:58 UTC (rev 18667)
@@ -28,6 +28,7 @@
import java.util.Iterator;
import java.util.Map;
+import javax.faces.application.ResourceDependencies;
import javax.faces.application.ResourceDependency;
import javax.faces.component.UIColumn;
import javax.faces.component.UIComponent;
@@ -51,7 +52,11 @@
*/
@JsfRenderer(type = "org.richfaces.SubTableRenderer", family = AbstractSubTable.COMPONENT_FAMILY)
-@ResourceDependency(library="org.richfaces", name = "subtable.js")
+@ResourceDependencies({
+ @ResourceDependency(name = "jquery.js"),
+ @ResourceDependency(name = "richfaces.js"),
+ @ResourceDependency(library="org.richfaces", name = "subtable.js")
+})
public class SubTableRenderer extends AbstractTableRenderer {
public static final String TB_ROW = ":c";
Modified: trunk/ui/iteration/ui/src/main/java/org/richfaces/renderkit/SubTableToggleControlRendererBase.java
===================================================================
--- trunk/ui/iteration/ui/src/main/java/org/richfaces/renderkit/SubTableToggleControlRendererBase.java 2010-08-16 14:27:55 UTC (rev 18666)
+++ trunk/ui/iteration/ui/src/main/java/org/richfaces/renderkit/SubTableToggleControlRendererBase.java 2010-08-16 14:30:58 UTC (rev 18667)
@@ -43,8 +43,11 @@
*/
-@ResourceDependencies({@ResourceDependency(library = "javax.faces", name = "jsf.js"),
- @ResourceDependency(name = "richfaces.js"), @ResourceDependency(name = "subtable-toggler.js")})
+@ResourceDependencies(
+ {@ResourceDependency(library = "javax.faces", name = "jsf.js"),
+ @ResourceDependency(name = "richfaces.js"),
+ @ResourceDependency(name = "subtable-toggler.js")
+})
public class SubTableToggleControlRendererBase extends RendererBase {
private static final String DISPLAY_NONE = "display: none;";
15 years, 9 months
JBoss Rich Faces SVN: r18666 - in trunk/examples/richfaces-showcase/src/main: webapp/richfaces and 8 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: ilya_shaikovsky
Date: 2010-08-16 10:27:55 -0400 (Mon, 16 Aug 2010)
New Revision: 18666
Added:
trunk/examples/richfaces-showcase/src/main/webapp/richfaces/accordion/
trunk/examples/richfaces-showcase/src/main/webapp/richfaces/accordion/samples/
trunk/examples/richfaces-showcase/src/main/webapp/richfaces/accordion/samples/simple-sample.xhtml
trunk/examples/richfaces-showcase/src/main/webapp/richfaces/accordion/simple.xhtml
trunk/examples/richfaces-showcase/src/main/webapp/richfaces/autocomplete/
trunk/examples/richfaces-showcase/src/main/webapp/richfaces/autocomplete/samples/
trunk/examples/richfaces-showcase/src/main/webapp/richfaces/autocomplete/samples/simpleAjax-sample.xhtml
trunk/examples/richfaces-showcase/src/main/webapp/richfaces/autocomplete/samples/simpleClient-sample.xhtml
trunk/examples/richfaces-showcase/src/main/webapp/richfaces/autocomplete/simpleAjax.xhtml
trunk/examples/richfaces-showcase/src/main/webapp/richfaces/autocomplete/simpleClient.xhtml
trunk/examples/richfaces-showcase/src/main/webapp/richfaces/inplaceInput/
trunk/examples/richfaces-showcase/src/main/webapp/richfaces/inplaceInput/inplaceInput.xhtml
trunk/examples/richfaces-showcase/src/main/webapp/richfaces/inplaceInput/samples/
trunk/examples/richfaces-showcase/src/main/webapp/richfaces/inplaceInput/samples/inplaceInput-sample.xhtml
trunk/examples/richfaces-showcase/src/main/webapp/richfaces/inputNumberSlider/
trunk/examples/richfaces-showcase/src/main/webapp/richfaces/inputNumberSlider/samples/
trunk/examples/richfaces-showcase/src/main/webapp/richfaces/inputNumberSlider/samples/sliders-sample.xhtml
trunk/examples/richfaces-showcase/src/main/webapp/richfaces/inputNumberSlider/sliders.xhtml
Modified:
trunk/examples/richfaces-showcase/src/main/resources/org/richfaces/demo/data/common/navigation.xml
Log:
https://jira.jboss.org/browse/RF-8794
https://jira.jboss.org/browse/RF-9066
https://jira.jboss.org/browse/RF-9067
Modified: trunk/examples/richfaces-showcase/src/main/resources/org/richfaces/demo/data/common/navigation.xml
===================================================================
--- trunk/examples/richfaces-showcase/src/main/resources/org/richfaces/demo/data/common/navigation.xml 2010-08-16 14:13:20 UTC (rev 18665)
+++ trunk/examples/richfaces-showcase/src/main/resources/org/richfaces/demo/data/common/navigation.xml 2010-08-16 14:27:55 UTC (rev 18666)
@@ -286,7 +286,7 @@
</demo>
</demos>
</group>
- <group>
+ <group new="true">
<name>Output/Panels</name>
<demos>
<demo>
@@ -300,7 +300,7 @@
<sample>
<id>lookCustomization</id>
<name>Look and feel customization</name>
- </sample>
+ </sample>
</samples>
</demo>
<demo>
@@ -312,6 +312,16 @@
<name>Simple Toggle Panel</name>
</sample>
</samples>
+ </demo>
+ <demo>
+ <id>accordion</id>
+ <name>rich:accordion</name>
+ <samples>
+ <sample>
+ <id>simple</id>
+ <name>Simple Accordion</name>
+ </sample>
+ </samples>
</demo>
<demo>
<id>popup</id>
@@ -324,12 +334,50 @@
<sample>
<id>modalPopup</id>
<name>Modal panel example</name>
- </sample>
+ </sample>
</samples>
</demo>
</demos>
</group>
-
+ <group new="true">
+ <name>Inputs and Selects</name>
+ <demos>
+ <!-- demo>
+ <id>autocomplete</id>
+ <name>rich:autocomplete</name>
+ <samples>
+ <sample>
+ <id>simpleClient</id>
+ <name>Client side autocomplete</name>
+ </sample>
+ <sample>
+ <id>simpleAjax</id>
+ <name>Ajax autocomplete</name>
+ </sample>
+ </samples>
+ </demo-->
+ <demo>
+ <id>inputNumberSlider</id>
+ <name>rich:inputNumberSlider</name>
+ <samples>
+ <sample>
+ <id>sliders</id>
+ <name>Different Sliders samples</name>
+ </sample>
+ </samples>
+ </demo>
+ <demo>
+ <id>inplaceInput</id>
+ <name>rich:inplaceInput</name>
+ <samples>
+ <sample>
+ <id>inplaceInput</id>
+ <name>Inplace Inputs samples</name>
+ </sample>
+ </samples>
+ </demo>
+ </demos>
+ </group>
<group>
<name>Misc Components/Features</name>
<demos>
@@ -372,7 +420,7 @@
<name>jQuery usage</name>
</sample>
</samples>
- </demo>
+ </demo>
</demos>
</group>
</root>
Added: trunk/examples/richfaces-showcase/src/main/webapp/richfaces/accordion/samples/simple-sample.xhtml
===================================================================
--- trunk/examples/richfaces-showcase/src/main/webapp/richfaces/accordion/samples/simple-sample.xhtml (rev 0)
+++ trunk/examples/richfaces-showcase/src/main/webapp/richfaces/accordion/samples/simple-sample.xhtml 2010-08-16 14:27:55 UTC (rev 18666)
@@ -0,0 +1,18 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<ui:composition 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:a4j="http://richfaces.org/a4j"
+ xmlns:rich="http://richfaces.org/rich">
+ <h:form>
+ <rich:accordion>
+ <rich:accordionItem header="First Item">
+ <h:outputText value="hello from 1" />
+ </rich:accordionItem>
+ <rich:accordionItem header="Second Item">
+ <h:outputText value="hello from 2" />
+ </rich:accordionItem>
+ </rich:accordion>
+ </h:form>
+</ui:composition>
\ No newline at end of file
Added: trunk/examples/richfaces-showcase/src/main/webapp/richfaces/accordion/simple.xhtml
===================================================================
--- trunk/examples/richfaces-showcase/src/main/webapp/richfaces/accordion/simple.xhtml (rev 0)
+++ trunk/examples/richfaces-showcase/src/main/webapp/richfaces/accordion/simple.xhtml 2010-08-16 14:27:55 UTC (rev 18666)
@@ -0,0 +1,25 @@
+<!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">
+
+<ui:composition>
+ <p>The Accordion (panelBar from 3.3.x) is a set of panels when one panel is expanded,
+ but other ones are collapsed. </p>
+ <p>
+ Additionally to previous 3.3.x functionality - accordion in 4.x was finally added with
+ different modes functionality. So as all the switchable panels it could be used with next modes -
+ "client", "ajax" and "server".
+ </p>
+ <p>The following demo shows the simple example of usage for the Accordion in client mode.</p>
+ <ui:include src="#{demoNavigator.sampleIncludeURI}" />
+ <ui:include src="/templates/includes/source-view.xhtml">
+ <ui:param name="src" value="#{demoNavigator.sampleIncludeURI}" />
+ <ui:param name="sourceType" value="xhtml" />
+ <ui:param name="openLabel" value="View Source" />
+ <ui:param name="hideLabel" value="Hide Source" />
+ </ui:include>
+</ui:composition>
+
+</html>
\ No newline at end of file
Added: trunk/examples/richfaces-showcase/src/main/webapp/richfaces/autocomplete/samples/simpleAjax-sample.xhtml
===================================================================
--- trunk/examples/richfaces-showcase/src/main/webapp/richfaces/autocomplete/samples/simpleAjax-sample.xhtml (rev 0)
+++ trunk/examples/richfaces-showcase/src/main/webapp/richfaces/autocomplete/samples/simpleAjax-sample.xhtml 2010-08-16 14:27:55 UTC (rev 18666)
@@ -0,0 +1,25 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<ui:composition 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:a4j="http://richfaces.org/a4j"
+ xmlns:rich="http://richfaces.org/rich">
+ <style>
+.outhello {
+ font-weight: bold;
+}
+</style>
+ <h:form>
+ <h:panelGrid columns="3">
+ <h:outputText value="Name:" />
+ <h:inputText value="#{userBean.name}" />
+ <a4j:commandButton value="Say Hello" render="out" execute="@form" />
+ </h:panelGrid>
+ </h:form>
+ <br />
+ <a4j:outputPanel id="out">
+ <h:outputText value="Hello #{userBean.name} !"
+ rendered="#{not empty userBean.name}" styleClass="outhello" />
+ </a4j:outputPanel>
+</ui:composition>
\ No newline at end of file
Added: trunk/examples/richfaces-showcase/src/main/webapp/richfaces/autocomplete/samples/simpleClient-sample.xhtml
===================================================================
--- trunk/examples/richfaces-showcase/src/main/webapp/richfaces/autocomplete/samples/simpleClient-sample.xhtml (rev 0)
+++ trunk/examples/richfaces-showcase/src/main/webapp/richfaces/autocomplete/samples/simpleClient-sample.xhtml 2010-08-16 14:27:55 UTC (rev 18666)
@@ -0,0 +1,11 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<ui:composition 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:a4j="http://richfaces.org/a4j"
+ xmlns:rich="http://richfaces.org/rich">
+
+<rich:autocomplete autocompleteList="#{autocompleteBean.clientList}"/>
+
+</ui:composition>
\ No newline at end of file
Added: trunk/examples/richfaces-showcase/src/main/webapp/richfaces/autocomplete/simpleAjax.xhtml
===================================================================
--- trunk/examples/richfaces-showcase/src/main/webapp/richfaces/autocomplete/simpleAjax.xhtml (rev 0)
+++ trunk/examples/richfaces-showcase/src/main/webapp/richfaces/autocomplete/simpleAjax.xhtml 2010-08-16 14:27:55 UTC (rev 18666)
@@ -0,0 +1,26 @@
+<!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">
+
+<ui:composition>
+ <p>Autocomplete component - simple Input component which provides suggestions during input.</p>
+ <p>Could works using three modes:
+ <ul>
+ <li>Client - preloads data to the client side and makes suggestions according to entered prefix on the client</li>
+ <li>Ajax - fetches the data on every input change using ajax requests</li>
+ <li>Cached Ajax - loads data via ajax to make suggestions when the prefix length satisfies minchars attribute. Then all the suggestions done at client side except the case when initial prefix changed or token entered. Then loads data again.</li>
+ </ul>
+ </p>
+ <p>There you could see simple client side autocomplete:</p>
+ <ui:include src="#{demoNavigator.sampleIncludeURI}" />
+ <ui:include src="/templates/includes/source-view.xhtml">
+ <ui:param name="src" value="#{demoNavigator.sampleIncludeURI}" />
+ <ui:param name="sourceType" value="xhtml" />
+ <ui:param name="openLabel" value="View Source" />
+ <ui:param name="hideLabel" value="Hide Source" />
+ </ui:include>
+</ui:composition>
+
+</html>
\ No newline at end of file
Added: trunk/examples/richfaces-showcase/src/main/webapp/richfaces/autocomplete/simpleClient.xhtml
===================================================================
--- trunk/examples/richfaces-showcase/src/main/webapp/richfaces/autocomplete/simpleClient.xhtml (rev 0)
+++ trunk/examples/richfaces-showcase/src/main/webapp/richfaces/autocomplete/simpleClient.xhtml 2010-08-16 14:27:55 UTC (rev 18666)
@@ -0,0 +1,26 @@
+<!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">
+
+<ui:composition>
+ <p>Autocomplete component - simple Input component which provides suggestions during input.</p>
+ <p>Could works using three modes:
+ <ul>
+ <li>Client - preloads data to the client side and makes suggestions according to entered prefix on the client</li>
+ <li>Ajax - fetches the data on every input change using ajax requests</li>
+ <li>Cached Ajax - loads data via ajax to make suggestions when the prefix length satisfies minchars attribute. Then all the suggestions done at client side except the case when initial prefix changed or token entered. Then loads data again.</li>
+ </ul>
+ </p>
+ <p>There you could see simple client side autocomplete:</p>
+ <ui:include src="#{demoNavigator.sampleIncludeURI}" />
+ <ui:include src="/templates/includes/source-view.xhtml">
+ <ui:param name="src" value="#{demoNavigator.sampleIncludeURI}" />
+ <ui:param name="sourceType" value="xhtml" />
+ <ui:param name="openLabel" value="View Source" />
+ <ui:param name="hideLabel" value="Hide Source" />
+ </ui:include>
+</ui:composition>
+
+</html>
\ No newline at end of file
Added: trunk/examples/richfaces-showcase/src/main/webapp/richfaces/inplaceInput/inplaceInput.xhtml
===================================================================
--- trunk/examples/richfaces-showcase/src/main/webapp/richfaces/inplaceInput/inplaceInput.xhtml (rev 0)
+++ trunk/examples/richfaces-showcase/src/main/webapp/richfaces/inplaceInput/inplaceInput.xhtml 2010-08-16 14:27:55 UTC (rev 18666)
@@ -0,0 +1,20 @@
+<!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">
+
+<ui:composition>
+ <p>InplaceInput is a simple input component which displays the current value as outputText and switches to inputText based representation after a defined event to allow editing this value.
+You could use simplest examples below. For the first demo, just click on a label to edit the value and click somewhere outside the component to store this value(Or just press ENTER button).</p>
+
+ <ui:include src="#{demoNavigator.sampleIncludeURI}" />
+ <ui:include src="/templates/includes/source-view.xhtml">
+ <ui:param name="src" value="#{demoNavigator.sampleIncludeURI}" />
+ <ui:param name="sourceType" value="xhtml" />
+ <ui:param name="openLabel" value="View Source" />
+ <ui:param name="hideLabel" value="Hide Source" />
+ </ui:include>
+</ui:composition>
+
+</html>
\ No newline at end of file
Added: trunk/examples/richfaces-showcase/src/main/webapp/richfaces/inplaceInput/samples/inplaceInput-sample.xhtml
===================================================================
--- trunk/examples/richfaces-showcase/src/main/webapp/richfaces/inplaceInput/samples/inplaceInput-sample.xhtml (rev 0)
+++ trunk/examples/richfaces-showcase/src/main/webapp/richfaces/inplaceInput/samples/inplaceInput-sample.xhtml 2010-08-16 14:27:55 UTC (rev 18666)
@@ -0,0 +1,19 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<ui:composition 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:a4j="http://richfaces.org/a4j"
+ xmlns:rich="http://richfaces.org/rich">
+ <rich:panel style="width:220px;">
+ <f:facet name="header">
+ <h:outputText value="Person Info"></h:outputText>
+ </f:facet>
+ <h:panelGrid columns="2">
+ <h:outputText value="Name: " />
+ <rich:inplaceInput value="click to enter your name" />
+ <h:outputText value="Email:" />
+ <rich:inplaceInput value="click to enter your email" />
+ </h:panelGrid>
+ </rich:panel>
+</ui:composition>
\ No newline at end of file
Added: trunk/examples/richfaces-showcase/src/main/webapp/richfaces/inputNumberSlider/samples/sliders-sample.xhtml
===================================================================
--- trunk/examples/richfaces-showcase/src/main/webapp/richfaces/inputNumberSlider/samples/sliders-sample.xhtml (rev 0)
+++ trunk/examples/richfaces-showcase/src/main/webapp/richfaces/inputNumberSlider/samples/sliders-sample.xhtml 2010-08-16 14:27:55 UTC (rev 18666)
@@ -0,0 +1,29 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<ui:composition 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:a4j="http://richfaces.org/a4j"
+ xmlns:rich="http://richfaces.org/rich">
+
+ <p>Here is an example of default inputNumberSlider:</p>
+
+ <rich:inputNumberSlider value="#{50}" />
+
+ <p>Here is "minimalistic" input:</p>
+
+ <rich:inputNumberSlider value="#{50}" showInput="false"
+ enableManualInput="false" showBoundaryValues="false"
+ showToolTip="false" />
+
+ <p>Another variation of input:</p>
+
+ <rich:inputNumberSlider value="#{500}" width="500" maxValue="#{1000}"
+ step="#{50}" showArrows="true" showToolTip="false" />
+
+ <p>The same variant but the control disabled:</p>
+
+ <rich:inputNumberSlider value="#{500}" width="500" maxValue="#{1000}"
+ step="#{50}" showArrows="true" showToolTip="false" disabled="true" />
+
+</ui:composition>
\ No newline at end of file
Added: trunk/examples/richfaces-showcase/src/main/webapp/richfaces/inputNumberSlider/sliders.xhtml
===================================================================
--- trunk/examples/richfaces-showcase/src/main/webapp/richfaces/inputNumberSlider/sliders.xhtml (rev 0)
+++ trunk/examples/richfaces-showcase/src/main/webapp/richfaces/inputNumberSlider/sliders.xhtml 2010-08-16 14:27:55 UTC (rev 18666)
@@ -0,0 +1,20 @@
+<!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">
+
+<ui:composition>
+ <p>InputNumberSlider is a highly customizable component that is used to define numeric
+ input in a given range. You can use a slider or just type some value into an input field.</p>
+
+ <ui:include src="#{demoNavigator.sampleIncludeURI}" />
+ <ui:include src="/templates/includes/source-view.xhtml">
+ <ui:param name="src" value="#{demoNavigator.sampleIncludeURI}" />
+ <ui:param name="sourceType" value="xhtml" />
+ <ui:param name="openLabel" value="View Source" />
+ <ui:param name="hideLabel" value="Hide Source" />
+ </ui:include>
+</ui:composition>
+
+</html>
\ No newline at end of file
15 years, 9 months
JBoss Rich Faces SVN: r18665 - trunk/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces.
by richfaces-svn-commits@lists.jboss.org
Author: abelevich
Date: 2010-08-16 10:13:20 -0400 (Mon, 16 Aug 2010)
New Revision: 18665
Modified:
trunk/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/inplaceInput.js
Log:
remove RichFaces.Event
Modified: trunk/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/inplaceInput.js
===================================================================
--- trunk/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/inplaceInput.js 2010-08-16 14:13:03 UTC (rev 18664)
+++ trunk/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/inplaceInput.js 2010-08-16 14:13:20 UTC (rev 18665)
@@ -15,17 +15,16 @@
this.label = $(document.getElementById(options.label));
this.initialValue = this.label.text();
- richfaces.Event.bind(this.element, this.editEvent, this.__editHandler, this);
- richfaces.Event.bind(this.input, "change", this.__saveHandler, this);
- richfaces.Event.bind(this.input, "blur", this.__saveHandler, this);
-
- /* TODO: discuss this with Pavel */
- this.__boundEditFunc = richfaces.Event.bind(this.input, "focus", this.__editHandler, this);
+ this.element.bind(this.editEvent, $.proxy(this.__editHandler, this));
+ this.input.bind("change", $.proxy(this.__saveHandler, this));
+ this.input.bind("blur", $.proxy(this.__saveHandler, this));
+ this.input.bind("focus", $.proxy(this.__editHandler, this));
+
if(this.showControls) {
this.okbtn = $(document.getElementById(options.okbtn));
this.cancelbtn = $(document.getElementById(options.cancelbtn));
- richfaces.Event.bind(this.okbtn, "mousedown", this.__saveBtnHandler, this);
- richfaces.Event.bind(this.cancelbtn, "mousedown", this.__cancelBtnHandler, this);
+ this.okbtn.bind("mousedown", $.proxy(this.__saveBtnHandler, this));
+ this.cancelbtn.bind("mousedown", $.proxy(this.__cancelBtnHandler, this));
}
};
@@ -87,14 +86,15 @@
},
__cancelBtnHandler: function(e) {
- this.cancel(); this.input.blur(); return false;
+ this.cancel();
+ this.input.blur();
+ return false;
},
__editHandler: function(e) {
- richfaces.Event.unbind(this.input, "focus", this.__boundEditFunc);
- this.__boundEditFunc = null;
+ this.input.unbind("focus", this.__editHandler);
this.edit();
- this.__boundEditFunc = richfaces.Event.bind(this.input, "focus", this.__editHandler, this);
+ this.input.bind("focus", $.proxy(this.__editHandler, this));
},
__saveHandler: function(e) {
15 years, 9 months
JBoss Rich Faces SVN: r18664 - in trunk/ui/output/ui/src/main: templates and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: amarkhel
Date: 2010-08-16 10:13:03 -0400 (Mon, 16 Aug 2010)
New Revision: 18664
Modified:
trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/popupPanel.js
trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/popupPanelBorders.js
trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/popupPanelSizer.js
trunk/ui/output/ui/src/main/templates/popupPanel.template.xml
Log:
RF-9062, RF-9006
Modified: trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/popupPanel.js
===================================================================
--- trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/popupPanel.js 2010-08-16 14:12:05 UTC (rev 18663)
+++ trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/popupPanel.js 2010-08-16 14:13:03 UTC (rev 18664)
@@ -10,11 +10,11 @@
{
if (typeof element.onselectstart!="undefined") //IE
{
- jQuery(element).bind( 'selectstart', selectionEventHandler);
+ $(richfaces.getDomElement(element)).bind( 'selectstart', selectionEventHandler);
}
else //All other (ie: Opera)
{
- jQuery(element).bind( 'mousedown', selectionEventHandler);
+ $(richfaces.getDomElement(element)).bind( 'mousedown', selectionEventHandler);
}
}
@@ -22,11 +22,11 @@
{
if (typeof element.onselectstart!="undefined") //IE
{
- jQuery(element).unbind( 'selectstart', selectionEventHandler);
+ $(richfaces.getDomElement(element)).unbind( 'selectstart', selectionEventHandler);
}
else //All other (ie: Opera)
{
- jQuery(element).unbind( 'mousedown', selectionEventHandler);
+ $(richfaces.getDomElement(element)).unbind( 'mousedown', selectionEventHandler);
}
}
@@ -35,10 +35,9 @@
$super.constructor.call(this,id);
this.markerId = id;
this.attachToDom(id);
- id = "#" + id;
this.options = options;
- this.id = $(id);
+ this.id = $(richfaces.getDomElement(id));
this.minWidth = this.getMinimumSize(this.options.minWidth);
this.minHeight = this.getMinimumSize(this.options.minHeight);
this.maxWidth = this.options.maxWidth;
@@ -47,15 +46,14 @@
this.baseZIndex = this.options.zindex ? this.options.zindex : 100;
- this.div = id;
- this.cdiv = id + "_container";
- this.contentDiv = id + "_content";
- this.shadowDiv = id + "_shadow";
- this.scrollerDiv = id + "_content_scroller"
+ this.div = $(richfaces.getDomElement(id));
+ this.cdiv = $(richfaces.getDomElement(id + "_container"));
+ this.contentDiv = $(richfaces.getDomElement(id + "_content"));
+ this.shadowDiv = $(richfaces.getDomElement(id + "_shadow"));
+ this.scrollerDiv = $(richfaces.getDomElement(id + "_content_scroller"));
this.borders = new Array();
- this.firstHref = id + "FirstHref";
- this.lastHref = id + "LastHref";
+ this.firstHref = $(richfaces.getDomElement(id + "FirstHref"));
if (this.options.resizeable) {
this.borders.push(new richfaces.ui.PopupPanel.Border(id + "ResizerN", this, "N-resize", richfaces.ui.PopupPanel.Sizer.N));
this.borders.push(new richfaces.ui.PopupPanel.Border(id + "ResizerE", this, "E-resize", richfaces.ui.PopupPanel.Sizer.E));
@@ -68,10 +66,10 @@
this.borders.push(new richfaces.ui.PopupPanel.Border(id + "ResizerSW", this, "SW-resize", richfaces.ui.PopupPanel.Sizer.SW));
}
- if (this.options.moveable && $(id + "_header")) {
+ if (this.options.moveable && richfaces.getDomElement(id + "_header")) {
this.header = new richfaces.ui.PopupPanel.Border(id + "_header", this, "move", richfaces.ui.PopupPanel.Sizer.Header);
} else{
- $(id + "_header").css('cursor', 'default');
+ $(richfaces.getDomElement(id + "_header")).css('cursor', 'default');
}
};
@@ -102,24 +100,24 @@
},
getLeft : function (){
- return $(this.cdiv).css('left');
+ return this.cdiv.css('left');
},
getTop : function (){
- return $(this.cdiv).css('top');
+ return this.cdiv.css('top');
},
getInitialSize : function(){
if(this.options.autosized){
return 15;
} else{
- return $(this.div + "_header_content").height();
+ return $(richfaces.getDomElement(this.markerId + "_header_content")).height();
}
},
getContentElement: function() {
if (!this._contentElement) {
- this._contentElement = $(this.cdiv);
+ this._contentElement = this.cdiv;
}
return this._contentElement;
@@ -149,8 +147,8 @@
this.borders = null;
if (this.domReattached) {
- var element = this.id;
- var parent = $(element).parent();
+ var element = this.div;
+ var parent = element.parent();
if (parent) {
parent.remove(element);
}
@@ -186,27 +184,27 @@
setLeft: function(pos) {
if(!isNaN(pos)){
- $(this.cdiv).css('left', pos + "px");
+ this.cdiv.css('left', pos + "px");
var depth = this.options.shadowDepth ? this.options.shadowDepth : 2;
- $(this.shadowDiv).css('left', pos + depth + "px");
+ this.shadowDiv.css('left', pos + depth + "px");
}
},
setTop: function(pos) {
if(!isNaN(pos)){
- $(this.cdiv).css('top', pos + "px");
+ this.cdiv.css('top', pos + "px");
var depth = this.options.shadowDepth ? this.options.shadowDepth : 2;
- $(this.shadowDiv).css('top', pos + depth +"px");
+ this.shadowDiv.css('top', pos + depth +"px");
}
},
show: function(event, opts) {
if(!this.shown && this.invokeEvent("beforeshow",event,null,element)) {
this.preventFocus();
- var element = this.id;
+ var element = this.div;
if (!this.domReattached) {
- this.parent = $(element).parent();
+ this.parent = element.parent();
var domElementAttachment;
if (opts) {
@@ -232,7 +230,7 @@
element.insertBefore(newParent.firstChild);
this.domReattached = true;
} else {
- $(this.parent).show();
+ this.parent.show();
}
}
@@ -279,9 +277,9 @@
if (options.width > this.maxWidth) {
options.width = this.maxWidth;
}
- $(eContentElt).css('width', options.width + (/px/.test(options.width) ? '' : 'px'));
- $(this.shadowDiv).css('width', options.width + 4 + (/px/.test(options.width) ? '' : 'px'));
- $(this.scrollerDiv).css('width', options.width + (/px/.test(options.width) ? '' : 'px'));
+ $(richfaces.getDomElement(eContentElt)).css('width', options.width + (/px/.test(options.width) ? '' : 'px'));
+ this.shadowDiv.css('width', options.width + 4 + (/px/.test(options.width) ? '' : 'px'));
+ this.scrollerDiv.css('width', options.width + (/px/.test(options.width) ? '' : 'px'));
}
@@ -293,10 +291,10 @@
if (options.height > this.maxHeight) {
options.height = this.maxHeight;
}
- $(eContentElt).css('height', options.height + (/px/.test(options.height) ? '' : 'px'));
- $(this.shadowDiv).css('height', options.height + 4 + (/px/.test(options.height) ? '' : 'px'));
- var headerHeight = $(this.div +"_header")[0] ? $(this.div +"_header")[0].clientHeight : 0;
- $(this.scrollerDiv).css('height', options.height - headerHeight + (/px/.test(options.height) ? '' : 'px'));
+ $(richfaces.getDomElement(eContentElt)).css('height', options.height + (/px/.test(options.height) ? '' : 'px'));
+ this.shadowDiv.css('height', options.height + 4 + (/px/.test(options.height) ? '' : 'px'));
+ var headerHeight = $(richfaces.getDomElement(this.div +"_header"))[0] ? $(richfaces.getDomElement(this.div +"_header"))[0].clientHeight : 0;
+ this.scrollerDiv.css('height', options.height - headerHeight + (/px/.test(options.height) ? '' : 'px'));
}
@@ -305,16 +303,16 @@
this.iframe = this.markerId + "IFrame";
$("<iframe src=\"javascript:''\" frameborder=\"0\" scrolling=\"no\" id=\"" + this.iframe + "\" " +
"class=\"rf-pp-if\" style=\"width:" +this.options.width + "px; height:" + this.options.height + "px;\">" +
- "</iframe>").insertBefore($(':first-child', $(this.cdiv))[0]);
+ "</iframe>").insertBefore($(':first-child', this.cdiv)[0]);
- eIframe = jQuery("#"+this.iframe);
+ eIframe = $(richfaces.getDomElement(this.iframe));
- $(eIframe).bind('load', this.initIframe);
+ eIframe.bind('load', this.initIframe);
this.eIframe = eIframe;
}
element.mpSet = true;
- var eDiv = $(this.div);
+ var eDiv = this.div;
if (options.left) {
var _left;
@@ -351,10 +349,10 @@
}
var opacity = options.shadowOpacity ? options.shadowOpacity : 0.1;
- $(this.shadowDiv).css('opacity', opacity);
- $(this.shadowDiv).css('filter ', 'alpha(opacity='+opacity*100 +');');
- $(element).css('visibility', '');
- $(element).css('display', 'block');
+ this.shadowDiv.css('opacity', opacity);
+ this.shadowDiv.css('filter ', 'alpha(opacity='+opacity*100 +');');
+ element.css('visibility', '');
+ element.css('display', 'block');
var event = {};
event.parameters = opts || {};
this.shown = true;
@@ -433,7 +431,7 @@
var popup = this;
if (this.firstOutside) {
- jQuery(this.firstOutside).bind("focus", {popup: popup}, this.firstOnfocus);
+ $(richfaces.getDomElement(this.firstOutside)).bind("focus", {popup: popup}, this.firstOnfocus);
}
}
},
@@ -443,7 +441,7 @@
this.processAllFocusElements(document, this.restoreTabindexes);
if (this.firstOutside) {
- jQuery(this.firstOutside).unbind("focus", this.firstOnfocus);
+ $(richfaces.getDomElement(this.firstOutside)).unbind("focus", this.firstOnfocus);
this.firstOutside = null;
}
}
@@ -465,7 +463,7 @@
this.currentMinHeight = undefined;
this.currentMinWidth = undefined;
- $(this.id).hide();
+ this.id.hide();
if (this.parent) {
if (this.domReattached) {
@@ -475,7 +473,7 @@
this.domReattached = false;
} else {
- $(this.parent).hide();
+ this.parent.hide();
}
}
@@ -498,7 +496,7 @@
},
getStyle: function(elt, name) {
- return parseInt($(elt).css(name).replace("px", ""), 10);
+ return parseInt($(richfaces.getDomElement(elt)).css(name).replace("px", ""), 10);
},
doResizeOrMove: function(diff) {
@@ -628,14 +626,16 @@
cssHash.top = newPos + 'px';
shadowHash.top = newPos + shadowDepth + "px";
}
- $(eContentElt).css(cssHashWH);
- $(this.scrollerDiv).css(scrollerHashWH);
- if(this.eIframe)$(this.eIframe).css(scrollerHashWH);
- $(this.shadowDiv).css(shadowHashWH);
+ eContentElt.css(cssHashWH);
+ this.scrollerDiv.css(scrollerHashWH);
+ if(this.eIframe){
+ this.eIframe.css(scrollerHashWH);
+ }
+ this.shadowDiv.css(shadowHashWH);
- $(eCdiv).css(cssHash);
- $(this.shadowDiv).css(shadowHash);
- //if(this.eIframe)$(this.eIframe).css(cssHash);
+ eCdiv.css(cssHash);
+ this.shadowDiv.css(shadowHash);
+
$.extend(this.userOptions, cssHash);
$.extend(this.userOptions, cssHashWH);
var w = this.width();
@@ -672,10 +672,10 @@
moveTo : function (top, left){
var shadowDepth = this.options.shadowDepth? this.options.shadowDepth: 4;
- $(this.cdiv).css('top', top);
- $(this.cdiv).css('left', left);
- $(this.shadowDiv).css('top', top + shadowDepth);
- $(this.shadowDiv).css('left', left + shadowDepth);
+ this.cdiv.css('top', top);
+ this.cdiv.css('left', left);
+ this.shadowDiv.css('top', top + shadowDepth);
+ this.shadowDiv.css('left', left + shadowDepth);
},
move : function (dx, dy){
Modified: trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/popupPanelBorders.js
===================================================================
--- trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/popupPanelBorders.js 2010-08-16 14:12:05 UTC (rev 18663)
+++ trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/popupPanelBorders.js 2010-08-16 14:13:03 UTC (rev 18664)
@@ -6,10 +6,10 @@
$super.constructor.call(this,id);
- var element = jQuery(id);
- jQuery(element).css('cursor',cursor);
+ this.element = $(richfaces.getDomElement(id));
+ this.element.css('cursor',cursor);
var border = this;
- jQuery(this.id).bind( 'mousedown', {border:border},this.startDrag);
+ this.element.bind( 'mousedown', {border:border},this.startDrag);
this.modalPanel = modalPanel;
this.sizer = sizer;
@@ -28,20 +28,21 @@
{
if (this.doingDrag)
{
- jQuery(document).unbind( 'mousemove', this.doDrag);
- jQuery(document).unbind( 'mouseup', this.endDrag);
+ $(document).unbind( 'mousemove', this.doDrag);
+ $(document).unbind( 'mouseup', this.endDrag);
}
- jQuery(this.id).unbind( 'mousedown', this.startDrag);
+ this.element.unbind( 'mousedown', this.startDrag);
+ this.element = null;
this.modalPanel=null;
},
show: function() {
- jQuery(this.id).show();
+ this.element.show();
},
hide: function() {
- jQuery(this.id).hide();
+ this.element.hide();
},
startDrag: function(event) {
@@ -50,12 +51,8 @@
border.dragX = event.clientX;
border.dragY = event.clientY;
- jQuery(document).bind( 'mousemove',{border:border}, border.doDrag);
- jQuery(document).bind( 'mouseup',{border:border}, border.endDrag);
-
- //var eCursorDiv = jQuery(border.modalPanel.cDiv);
- //jQuery(eCursorDiv).css('cursor', jQuery(border.id).css('cursor'));
- //jQuery(eCursorDiv).css('zIndex', 10);
+ $(document).bind( 'mousemove',{border:border}, border.doDrag);
+ $(document).bind( 'mouseup',{border:border}, border.endDrag);
border.modalPanel.startDrag(border);
@@ -111,7 +108,7 @@
var diff = border.sizer.prototype.doDiff(dx, dy);//TODO
var doResize;
- var element = jQuery(border.modalPanel.cdiv);
+ var element = border.modalPanel.cdiv;
if (diff.deltaWidth || diff.deltaHeight) {
doResize = border.modalPanel.invokeEvent("resize",event,null,element);
@@ -153,8 +150,8 @@
var border = event.data.border;
border.doingDrag = undefined;
- jQuery(document).unbind( 'mousemove', border.doDrag);
- jQuery(document).unbind( 'mouseup', border.endDrag);
+ $(document).unbind( 'mousemove', border.doDrag);
+ $(document).unbind( 'mouseup', border.endDrag);
border.modalPanel.endDrag(border);
@@ -165,7 +162,7 @@
},
doPosition: function() {
- this.sizer.prototype.doPosition(this.modalPanel, jQuery(this.id)); //TODO remove prototype
+ this.sizer.prototype.doPosition(this.modalPanel, this.element); //TODO remove prototype
}
}
Modified: trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/popupPanelSizer.js
===================================================================
--- trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/popupPanelSizer.js 2010-08-16 14:12:05 UTC (rev 18663)
+++ trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/popupPanelSizer.js 2010-08-16 14:13:03 UTC (rev 18664)
@@ -18,7 +18,7 @@
doSetupSize: function (modalPanel, elt) {
var width = 0;
var height = 0;
-
+ var element = $(richfaces.getDomElement(elt));
var reductionData = modalPanel.reductionData;
if (reductionData) {
@@ -34,15 +34,15 @@
if (width > 0) {
if (elt.clientWidth > width) {
if (!elt.reducedWidth) {
- elt.reducedWidth = jQuery(elt).css('width');
+ elt.reducedWidth = element.css('width');
}
- jQuery(elt).css('width', width + 'px');
+ element.css('width', width + 'px');
} else if (width < 4 && elt.reducedWidth == 4 + 'px') {
- jQuery(elt).css('width', width + 'px');
+ element.css('width', width + 'px');
}
} else {
if (elt.reducedWidth) {
- jQuery(elt).css('width', elt.reducedWidth);
+ element.css('width', elt.reducedWidth);
elt.reducedWidth = undefined;
}
}
@@ -50,24 +50,25 @@
if (height > 0) {
if (elt.clientHeight > height) {
if (!elt.reducedHeight) {
- elt.reducedHeight = jQuery(elt).css('height');
+ elt.reducedHeight = element.css('height');
}
elt.style.height = height + 'px';
} else if (height < 4 && elt.reducedHeight == 4 + 'px') {
- jQuery(elt).css('height', height + 'px');
+ element.css('height', height + 'px');
}
} else {
if (elt.reducedHeight) {
- jQuery(elt).css('height', elt.reducedHeight);
+ element.css('height', elt.reducedHeight);
elt.reducedHeight = undefined;
}
}
},
doSetupPosition: function (modalPanel, elt, left, top) {
+ var element = $(richfaces.getDomElement(elt));
if(!isNaN(left) && !isNaN(top)){
- jQuery(elt).css('left', left + 'px');
- jQuery(elt).css('top', top + 'px');
+ element.css('left', left + 'px');
+ element.css('top', top + 'px');
}
},
@@ -106,7 +107,8 @@
name: "richfaces.ui.PopupPanel.Sizer.N",
doPosition : function (popupPanel, elt) {
- jQuery(elt).css('width',popupPanel.width() + 'px');
+ var element = $(richfaces.getDomElement(elt));
+ element.css('width',popupPanel.width() + 'px');
this.doSetupPosition(popupPanel, elt, 0, 0);
},
@@ -163,7 +165,8 @@
name: "richfaces.ui.PopupPanel.Sizer.E",
doPosition : function (popupPanel, elt) {
- jQuery(elt).css('height', popupPanel.height() + 'px');
+ var element = $(richfaces.getDomElement(elt));
+ element.css('height', popupPanel.height() + 'px');
this.doSetupPosition(popupPanel, elt, popupPanel.width() - elt.clientWidth, 0);
},
@@ -202,7 +205,8 @@
name: "richfaces.ui.PopupPanel.Sizer.S",
doPosition : function (popupPanel, elt) {
- jQuery(elt).css('width', popupPanel.width() + 'px');
+ var element = $(richfaces.getDomElement(elt));
+ element.css('width', popupPanel.width() + 'px');
this.doSetupPosition(popupPanel, elt, 0, popupPanel.height() - elt.clientHeight);
},
@@ -243,7 +247,8 @@
name: "richfaces.ui.PopupPanel.Sizer.W",
doPosition : function (popupPanel, elt) {
- jQuery(elt).css('height', popupPanel.height() + 'px');
+ var element = $(richfaces.getDomElement(elt));
+ element.css('height', popupPanel.height() + 'px');
this.doSetupPosition(popupPanel, elt, 0, 0);
},
Modified: trunk/ui/output/ui/src/main/templates/popupPanel.template.xml
===================================================================
--- trunk/ui/output/ui/src/main/templates/popupPanel.template.xml 2010-08-16 14:12:05 UTC (rev 18663)
+++ trunk/ui/output/ui/src/main/templates/popupPanel.template.xml 2010-08-16 14:13:03 UTC (rev 18664)
@@ -32,7 +32,7 @@
<div id="#{clientId}_shadow" style="position: #{component.attributes['followByScroll'] ? 'fixed' : 'absolute'};" class="rf-pp-shw"/>
<div id="#{clientId}_container" style="position: #{component.attributes['followByScroll'] ? 'fixed' : 'absolute'};" cdk:passThroughWithExclusions="id style class styleClass" class="rf-pp-cr #{component.attributes['styleClass']}">
- <c:if test="(#{component.getFacet('header')!=null and component.getFacet('header').rendered})">
+ <c:if test="#{component.getFacet('header')!=null and component.getFacet('header').rendered}">
<div id="#{clientId}_header" class="rf-pp-h #{component.attributes['headerClass']}" >
<div id="#{clientId}_header_content" class="rf-pp-h-ct">
<cdk:call expression="renderHeaderFacet(facesContext, component)"/>
15 years, 9 months
JBoss Rich Faces SVN: r18663 - in trunk/ui/output/ui/src: test/java/org/richfaces/renderkit/html and 1 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: amarkhel
Date: 2010-08-16 10:12:05 -0400 (Mon, 16 Aug 2010)
New Revision: 18663
Modified:
trunk/ui/output/ui/src/main/java/org/richfaces/component/AbstractPopupPanel.java
trunk/ui/output/ui/src/test/java/org/richfaces/renderkit/html/PanelRendererTest.java
trunk/ui/output/ui/src/test/java/org/richfaces/renderkit/html/PopupRendererTest.java
trunk/ui/output/ui/src/test/resources/popupPanelTest.xhtml
Log:
RF-8948 and fix some tests
Modified: trunk/ui/output/ui/src/main/java/org/richfaces/component/AbstractPopupPanel.java
===================================================================
--- trunk/ui/output/ui/src/main/java/org/richfaces/component/AbstractPopupPanel.java 2010-08-16 14:11:11 UTC (rev 18662)
+++ trunk/ui/output/ui/src/main/java/org/richfaces/component/AbstractPopupPanel.java 2010-08-16 14:12:05 UTC (rev 18663)
@@ -24,6 +24,7 @@
import javax.faces.component.UIComponentBase;
import org.richfaces.cdk.annotations.Attribute;
+import org.richfaces.cdk.annotations.EventName;
import org.richfaces.cdk.annotations.JsfComponent;
import org.richfaces.cdk.annotations.JsfRenderer;
import org.richfaces.cdk.annotations.Tag;
@@ -33,66 +34,132 @@
* JSF component class
*
*/
-@JsfComponent(tag = @Tag(type = TagType.Facelets),
- renderer = @JsfRenderer(type = "org.richfaces.PopupPanelRenderer")
- )
+@JsfComponent(tag = @Tag(type = TagType.Facelets), renderer = @JsfRenderer(type = "org.richfaces.PopupPanelRenderer"))
public abstract class AbstractPopupPanel extends UIComponentBase {
public static final String COMPONENT_TYPE = "org.richfaces.PopupPanel";
public static final String COMPONENT_FAMILY = "org.richfaces.PopupPanel";
+
@Attribute
public abstract String getVisualOptions();
- @Attribute(defaultValue="100")
+
+ @Attribute(defaultValue = "100")
public abstract int getZIndex();
- @Attribute(defaultValue="-1")
+
+ @Attribute(defaultValue = "-1")
public abstract int getHeight();
- @Attribute(defaultValue="-1")
+
+ @Attribute(defaultValue = "-1")
public abstract int getWidth();
- @Attribute(defaultValue="-1")
+
+ @Attribute(defaultValue = "-1")
public abstract int getMinHeight();
- @Attribute(defaultValue="-1")
+
+ @Attribute(defaultValue = "-1")
public abstract int getMinWidth();
- @Attribute(defaultValue=""+Integer.MAX_VALUE)
+
+ @Attribute(defaultValue = "" + Integer.MAX_VALUE)
public abstract int getMaxHeight();
- @Attribute(defaultValue=""+Integer.MAX_VALUE)
+
+ @Attribute(defaultValue = "" + Integer.MAX_VALUE)
public abstract int getMaxWidth();
- @Attribute(defaultValue="auto")
+
+ @Attribute(defaultValue = "auto")
public abstract String getTop();
- @Attribute(defaultValue="auto")
+
+ @Attribute(defaultValue = "auto")
public abstract String getLeft();
- @Attribute(defaultValue="false")
+
+ @Attribute(defaultValue = "false")
public abstract boolean isShow();
+
public abstract void setShow(boolean show);
- @Attribute(defaultValue="true")
+
+ @Attribute(defaultValue = "true")
public abstract boolean isMoveable();
- @Attribute(defaultValue="false")
+
+ @Attribute(defaultValue = "false")
public abstract boolean isAutosized();
- @Attribute(defaultValue="true")
+
+ @Attribute(defaultValue = "true")
public abstract boolean isModal();
- @Attribute(defaultValue="false")
+
+ @Attribute(defaultValue = "false")
public abstract boolean isKeepVisualState();
- @Attribute(defaultValue="false")
+
+ @Attribute(defaultValue = "false")
public abstract boolean isOverlapEmbedObjects();
- @Attribute(defaultValue="false")
+
+ @Attribute(defaultValue = "false")
public abstract boolean isResizeable();
- @Attribute(defaultValue="false")
+
+ @Attribute(defaultValue = "false")
public abstract boolean isTrimOverlayedElements();
+
@Attribute
public abstract String getDomElementAttachment();
+
@Attribute
public abstract String getControlsClass();
+
@Attribute
public abstract String getHeader();
+
@Attribute
public abstract String getHeaderClass();
+
@Attribute
public abstract String getShadowDepth();
+
@Attribute
public abstract String getShadowOpacity();
- @Attribute(defaultValue="true")
+
+ @Attribute(defaultValue = "true")
public abstract boolean isFollowByScroll();
+ @Attribute(events = @EventName("maskclick"))
+ public abstract String getOnmaskclick();
+
+ @Attribute(events = @EventName("maskdblclick"))
+ public abstract String getOnmaskdblclick();
+
+ @Attribute(events = @EventName("maskmousedown"))
+ public abstract String getOnmaskmousedown();
+
+ @Attribute(events = @EventName("maskmouseup"))
+ public abstract String getOnmaskmouseup();
+
+ @Attribute(events = @EventName("maskmouseover"))
+ public abstract String getOnmaskmouseover();
+
+ @Attribute(events = @EventName("maskmousemove"))
+ public abstract String getOnmaskmousemove();
+
+ @Attribute(events = @EventName("maskcontextmenu"))
+ public abstract String getOnmaskcontextmenu();
+
+ @Attribute(events = @EventName("maskmouseout"))
+ public abstract String getOnmaskmouseout();
+
+ @Attribute(events = @EventName("resize"))
+ public abstract String getOnresize();
+
+ @Attribute(events = @EventName("show"))
+ public abstract String getOnshow();
+
+ @Attribute(events = @EventName("hide"))
+ public abstract String getOnhide();
+
+ @Attribute(events = @EventName("move"))
+ public abstract String getOnmove();
+
+ @Attribute(events = @EventName("beforeshow"))
+ public abstract String getOnbeforeshow();
+
+ @Attribute(events = @EventName("beforehide"))
+ public abstract String getOnbeforehide();
+
@Override
public String getFamily() {
return COMPONENT_FAMILY;
Modified: trunk/ui/output/ui/src/test/java/org/richfaces/renderkit/html/PanelRendererTest.java
===================================================================
--- trunk/ui/output/ui/src/test/java/org/richfaces/renderkit/html/PanelRendererTest.java 2010-08-16 14:11:11 UTC (rev 18662)
+++ trunk/ui/output/ui/src/test/java/org/richfaces/renderkit/html/PanelRendererTest.java 2010-08-16 14:12:05 UTC (rev 18663)
@@ -97,16 +97,16 @@
*
* @throws IOException
*/
- /*@Test
+ @Test
public final void testDoEncode() throws IOException {
HtmlPage page = environment.getPage("/panelTest.jsf");
HtmlElement panelWithFacet = page.getElementById("panelWithFacet");
- assertEquals("rf-panel panel", panelWithFacet.getAttribute("class"));
+ assertEquals("rf-p panel", panelWithFacet.getAttribute("class"));
assertEquals("Write your own custom rich components with built-in AJAX support", panelWithFacet.getElementById("panelWithFacet_header").getTextContent().trim());
assertEquals("The CDK includes", panelWithFacet.getElementById("panelWithFacet_body")
.getTextContent().trim().substring(0, 16));
HtmlElement simplePanel = page.getElementById("simplePanel");
- assertEquals("rf-panel ", simplePanel.getAttribute("class"));
+ assertEquals("rf-p ", simplePanel.getAttribute("class"));
try{
simplePanel.getElementById("simplePanel_header");
}catch(Exception e){
@@ -116,9 +116,9 @@
.getElementById("simplePanel_body")
.getTextContent().trim().substring(0, 16));
HtmlElement simplePanelBody = page.getElementById("simplePanel_body");
- assertEquals("rf-panel-body rich-laguna-panel-no-header", simplePanelBody.getAttribute("class"));
+ assertEquals("rf-p-b rich-laguna-panel-no-header", simplePanelBody.getAttribute("class"));
HtmlElement simplePanel2 = page.getElementById("simplePanelWithTextHeader");
- assertEquals("rf-panel ", simplePanel2.getAttribute("class"));
+ assertEquals("rf-p ", simplePanel2.getAttribute("class"));
assertNotNull(simplePanel2.getElementById("simplePanelWithTextHeader_header"));
assertEquals("rich-laguna-panel-no-header", simplePanel2.getElementById("simplePanelWithTextHeader_header").getTextContent().trim());
assertEquals("RichFaces is a l", simplePanel2
@@ -126,32 +126,32 @@
.getTextContent().trim().substring(0, 16));
HtmlElement nestedPanelContainer = page.getElementById("nestedPanelContainer");
- assertEquals("rf-panel ", nestedPanelContainer.getAttribute("class"));
+ assertEquals("rf-p ", nestedPanelContainer.getAttribute("class"));
assertNotNull(nestedPanelContainer.getElementById("nestedPanelContainer_header"));
assertEquals("||||", nestedPanelContainer.getElementById("nestedPanelContainer_header").getTextContent().trim());
HtmlElement nestedPanelContainerHeader = page.getElementById("nestedPanelContainer_header");
- assertEquals("rf-panel-header outpanelHeader", nestedPanelContainerHeader.getAttribute("class"));
+ assertEquals("rf-p-hr outpanelHeader", nestedPanelContainerHeader.getAttribute("class"));
assertEquals("Benefits of Usin", nestedPanelContainer
.getElementById("nestedPanelContainer_body")
.getTextContent().trim().substring(0, 16));
HtmlElement nestedPanel1 = nestedPanelContainer.getElementById("nestedPanel1");
- assertEquals("rf-panel ", nestedPanel1.getAttribute("class"));
+ assertEquals("rf-p ", nestedPanel1.getAttribute("class"));
HtmlElement nestedPanel1Body = page.getElementById("nestedPanel1_body");
- assertEquals("rf-panel-body inpanelBody", nestedPanel1Body.getAttribute("class"));
+ assertEquals("rf-p-b inpanelBody", nestedPanel1Body.getAttribute("class"));
assertNotNull(nestedPanel1.getElementById("nestedPanel1_header"));
assertEquals("For Application Developers", nestedPanel1.getElementById("nestedPanel1_header").getTextContent().trim());
assertEquals("Production quali", nestedPanel1
.getElementById("nestedPanel1_body")
.getTextContent().trim().substring(0, 16));
HtmlElement nestedPanel2 = nestedPanelContainer.getElementById("nestedPanel2");
- assertEquals("rf-panel ", nestedPanel2.getAttribute("class"));
+ assertEquals("rf-p ", nestedPanel2.getAttribute("class"));
HtmlElement nestedPanel2Body = page.getElementById("nestedPanel2_body");
- assertEquals("rf-panel-body inpanelBody", nestedPanel2Body.getAttribute("class"));
+ assertEquals("rf-p-b inpanelBody", nestedPanel2Body.getAttribute("class"));
assertNotNull(nestedPanel2.getElementById("nestedPanel2_header"));
assertEquals("For Component Developers", nestedPanel2.getElementById("nestedPanel2_header").getTextContent().trim());
assertEquals("Ajax4jsf is Open", nestedPanel2
.getElementById("nestedPanel2_body")
.getTextContent().trim().substring(0, 16));
- }*/
+ }
}
Modified: trunk/ui/output/ui/src/test/java/org/richfaces/renderkit/html/PopupRendererTest.java
===================================================================
--- trunk/ui/output/ui/src/test/java/org/richfaces/renderkit/html/PopupRendererTest.java 2010-08-16 14:11:11 UTC (rev 18662)
+++ trunk/ui/output/ui/src/test/java/org/richfaces/renderkit/html/PopupRendererTest.java 2010-08-16 14:12:05 UTC (rev 18663)
@@ -74,22 +74,6 @@
vdl.buildView(facesContext, facesContext.getViewRoot());
return facesRequest;
}
- /**
- * Test method for {@link org.richfaces.renderkit.ExtendedDataTableRenderer#getComponentClass()}.
- *
- * @throws IOException
- */
- /* @Test
- public final void testGetComponentClass() throws IOException {
- FacesRequest facesRequest = startFacesRequest();
- FacesContext facesContext = FacesContext.getCurrentInstance();
- UIPopupPanel component = (UIPopupPanel) facesContext.getViewRoot().findComponent("panel");
- PopupPanelRenderer renderer = (PopupPanelRenderer) FacesContext.getCurrentInstance()
- .getRenderKit().getRenderer(component.getFamily(), component.getRendererType());
- assertEquals(UIPopupPanel.class, renderer.getComponentClass());
- facesRequest.release();
- return ;
- }*/
/**
* Test method for
@@ -99,7 +83,6 @@
* @throws IOException
*/
@Test
- @Ignore
public final void testDoEncode() throws IOException {
HtmlPage page = environment.getPage("/popupPanelTest.jsf");
HtmlElement panelWithFacet = page.getElementById("panel");
@@ -109,29 +92,34 @@
assertEquals("rf-pp-sh", panelShade.getAttribute("class"));
assertNotNull(panelShade);
HtmlElement panelShadow = panelWithFacet.getElementById("panel_shadow");
- assertEquals("mp_shadow", panelShadow.getAttribute("class"));
+ assertEquals("rf-pp-shw", panelShadow.getAttribute("class"));
assertNotNull(panelShadow);
HtmlElement panelContainer = panelWithFacet.getElementById("panel_container");
assertNotNull(panelContainer);
- assertEquals("mp_container panelStyle", panelContainer.getAttribute("class"));
+ assertEquals("rf-pp-cr panelStyle", panelContainer.getAttribute("class"));
HtmlElement panelScroller = panelWithFacet.getElementById("panel_content_scroller");
assertNotNull(panelScroller);
- assertEquals("mp_content_scroller", panelScroller.getAttribute("class"));
+ assertEquals("rf-pp-ct-sr", panelScroller.getAttribute("class"));
HtmlElement panelContent = panelWithFacet.getElementById("panel_content");
assertNotNull(panelContent);
- assertEquals("mp_content", panelContent.getAttribute("class"));
+ assertEquals("rf-pp-ct", panelContent.getAttribute("class"));
assertEquals("The CDK includes", panelContent
.getTextContent().trim().substring(0, 16));
HtmlElement panelHeader = panelWithFacet.getElementById("panel_header");
assertNotNull(panelHeader);
- assertEquals("mp_header header", panelHeader.getAttribute("class"));
+ assertEquals("rf-pp-h header", panelHeader.getAttribute("class"));
assertEquals("cursor: move;", panelHeader.getAttribute("style"));
assertEquals("Write your own custom rich components with built-in AJAX", panelHeader.getTextContent().trim());
HtmlElement panelResizer = panelWithFacet.getElementById("panelResizerN");
assertNotNull(panelResizer);
- assertEquals("mp_handler mp_handler_top", panelResizer.getAttribute("class"));
+ assertEquals("rf-pp-hr rf-pp-hr-t", panelResizer.getAttribute("class"));
assertEquals("cursor: N-resize;", panelResizer.getAttribute("style"));
List<HtmlElement> result = page.getElementsByName("script");
+ HtmlElement button = panelWithFacet.getElementById("button");
+ button.click();
+ HtmlElement sizeButton = panelWithFacet.getElementById("size");
+ sizeButton.click();
+ String width = panelContainer.getAttribute("width");
}
}
\ No newline at end of file
Modified: trunk/ui/output/ui/src/test/resources/popupPanelTest.xhtml
===================================================================
--- trunk/ui/output/ui/src/test/resources/popupPanelTest.xhtml 2010-08-16 14:11:11 UTC (rev 18662)
+++ trunk/ui/output/ui/src/test/resources/popupPanelTest.xhtml 2010-08-16 14:12:05 UTC (rev 18663)
@@ -5,6 +5,7 @@
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:rich2="http://richfaces.org/rich"
xmlns:rich="http://richfaces.org/output">
<h:head>
@@ -12,7 +13,10 @@
</h:head>
<h:body>
- <rich:popupPanel styleClass="panelStyle" headerClass="header" controlsClass="control"
+ <h:commandButton id="button" value="Call the popup">
+ <rich2:componentControl target="panel" operation="show" />
+ </h:commandButton>
+ <rich:popupPanel resizeable="true" styleClass="panelStyle" headerClass="header" controlsClass="control"
id="panel"
@@ -35,20 +39,20 @@
<h:inputText value="aaa" />
- <a href="#"
+ <a href="#" id="size"
onclick="RichFaces.$('panel').setSize(500, 300)" tabindex="0">
setSize
</a>
- <a href="#"
+ <a href="#" id="resize"
onclick="RichFaces.$('panel').resize(20, 50)" tabindex="0">
resize
</a>
- <a href="#"
+ <a href="#" id="move"
onclick="RichFaces.$('panel').move(20, 50)" tabindex="0">
move
</a>
- <a href="#"
+ <a href="#" id="moveto"
onclick="RichFaces.$('panel').moveTo(20, 50)" tabindex="0">
moveTo
</a>
15 years, 9 months
JBoss Rich Faces SVN: r18662 - in trunk/ui/input/ui/src/main: java/org/richfaces/renderkit and 2 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: amarkhel
Date: 2010-08-16 10:11:11 -0400 (Mon, 16 Aug 2010)
New Revision: 18662
Modified:
trunk/ui/input/ui/src/main/java/org/richfaces/component/AbstractAutoComplete.java
trunk/ui/input/ui/src/main/java/org/richfaces/renderkit/AutoCompleteRendererBase.java
trunk/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/AutoComplete.ecss
trunk/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/AutoComplete.js
trunk/ui/input/ui/src/main/templates/autoComplete.template.xml
Log:
Refactor css-classes according to convention
Modified: trunk/ui/input/ui/src/main/java/org/richfaces/component/AbstractAutoComplete.java
===================================================================
--- trunk/ui/input/ui/src/main/java/org/richfaces/component/AbstractAutoComplete.java 2010-08-16 13:28:02 UTC (rev 18661)
+++ trunk/ui/input/ui/src/main/java/org/richfaces/component/AbstractAutoComplete.java 2010-08-16 14:11:11 UTC (rev 18662)
@@ -81,6 +81,9 @@
@Attribute
public abstract String getFilterFunction();
+
+ @Attribute(defaultValue = "rf-au-c")
+ public abstract String getSelectedItemClass();
@Attribute
public abstract String getMode();
Modified: trunk/ui/input/ui/src/main/java/org/richfaces/renderkit/AutoCompleteRendererBase.java
===================================================================
--- trunk/ui/input/ui/src/main/java/org/richfaces/renderkit/AutoCompleteRendererBase.java 2010-08-16 13:28:02 UTC (rev 18661)
+++ trunk/ui/input/ui/src/main/java/org/richfaces/renderkit/AutoCompleteRendererBase.java 2010-08-16 14:11:11 UTC (rev 18662)
@@ -75,7 +75,7 @@
Map<String, Object> options = new HashMap<String, Object>();
RendererUtils utils = getUtils();
utils.addToScriptHash(options, "buttonId", component.getClientId() + "Button");
- utils.addToScriptHash(options, "selectedItemClass", "cb_select");
+ utils.addToScriptHash(options, "selectedItemClass", attributes.get("selectedItemClass"));
utils.addToScriptHash(options, "minChars", attributes.get("minChars"), "1");
utils.addToScriptHash(options, "mode", attributes.get("mode"), "ajax");
utils.addToScriptHash(options, "filterFunction", attributes.get("filterFunction"));
Modified: trunk/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/AutoComplete.ecss
===================================================================
--- trunk/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/AutoComplete.ecss 2010-08-16 13:28:02 UTC (rev 18661)
+++ trunk/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/AutoComplete.ecss 2010-08-16 14:11:11 UTC (rev 18662)
@@ -1,29 +1,29 @@
-.cb_field_width {
+.rf-au-f-w{
width: 200px;
}
-.cb_list_width {
+.rf-au-l-w{
width: 200px;
}
-.cb_list_height {
+.rf-au-l-h{
max-height: 100px;
min-height: 20px;
}
-.cb_input.cb_font, .cb_option.cb_font {
+.rf-au-i.rf-au-ft, .rf-au-o.rf-au-ft{
color: '#{richSkin.generalTextColor}';
font-size: '#{richSkin.generalSizeFont}';
font-family: '#{richSkin.generalFamilyFont}';
}
-input.cb_input {
+input.rf-au-i {
border-width: 0px;
background: none;
width: 100%;
}
-.cb_field {
+.rf-au-f{
position: inline-block;
border-width: 1px;
border-style: solid;
@@ -35,7 +35,7 @@
background-color: '#{richSkin.controlBackgroundColor}';
}
-.cb_button {
+.rf-au-b{
background-image: "url(#{resource['org.richfaces.renderkit.html.images.AutoCompleteButtonGradient']})";
background-repeat: repeat-x;
background-position: top left;
@@ -52,7 +52,7 @@
padding-top: 1px
}
-.cb_button_arrow {
+.rf-au-b-a{
background-position: center;
background-repeat: no-repeat;
background-image: "url(#{resource['org.richfaces:combo_down_button.gif']})";
@@ -61,13 +61,13 @@
height: 15px;
}
-.cb_list_cord {
+.rf-au-l-c{
position: absolute;
/* TODO nick - review: font-size: 0px; */
display: none;
}
-.cb_list_decoration {
+.rf-au-l-d{
border-width: 1px;
border-style: solid;
border-color: '#{richSkin.panelBorderColor}';
@@ -75,28 +75,28 @@
background-color: '#{richSkin.tableBackgroundColor}';
}
-.cb_list_scroll {
+.rf-au-l-s{
overflow: auto;
overflow-x: hidden;
}
-.cb_option {
+.rf-au-o{
padding: 2px;
white-space: nowrap;
cursor: default;
list-style-type: none;
}
-.cb_select {
+.rf-au-s{
padding: 1px;
width: 100%;
- background-color: #DFE8F6;
+ background-color: '#{richSkin.headerBackgroundColor}';
border-width: 1px;
border-style: dotted;
border-color: '#{richSkin.generalTextColor}';
}
-.cb_shadow {
+.rf-au-shw{
border: 0px solid red;
display: inline-block;
position: absolute;
@@ -106,7 +106,7 @@
left: -7px;
}
-.cb_shadow_t {
+.rf-au-shw-t{
background-image: "url(#{resource['org.richfaces:combo_list_shadow.png']})";
background-position: top left;
position: absolute;
@@ -116,7 +116,7 @@
left: 0px
}
-.cb_shadow_l {
+.rf-au-shw-l{
background-image: "url(#{resource['org.richfaces:combo_list_shadow.png']})";
background-position: bottom left;
position: absolute;
@@ -126,7 +126,7 @@
right: 6px;
}
-.cb_shadow_r {
+.rf-au-shw-r{
background-image: "url(#{resource['org.richfaces:combo_list_shadow.png']})";
background-position: bottom right;
position: absolute;
@@ -136,7 +136,7 @@
right: 0px;
}
-.cb_shadow_b {
+.rf-au-shw-b{
background-image: "url(#{resource['org.richfaces:combo_list_shadow.png']})";
background-position: right top;
position: absolute;
@@ -146,7 +146,7 @@
right: 0px;
}
-.cb_list_ul {
+.rf-au-l-ul{
margin: 0px;
padding: 0px;
}
\ No newline at end of file
Modified: trunk/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/AutoComplete.js
===================================================================
--- trunk/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/AutoComplete.js 2010-08-16 13:28:02 UTC (rev 18661)
+++ trunk/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/AutoComplete.js 2010-08-16 14:11:11 UTC (rev 18662)
@@ -87,7 +87,7 @@
var $super = rf.ui.AutoComplete.$super;
var defaultOptions = {
- selectedItemClass:'cb_select',
+ selectedItemClass:'rf-au-s',
autoFill:true,
minChars:1,
selectFirst:true,
Modified: trunk/ui/input/ui/src/main/templates/autoComplete.template.xml
===================================================================
--- trunk/ui/input/ui/src/main/templates/autoComplete.template.xml 2010-08-16 13:28:02 UTC (rev 18661)
+++ trunk/ui/input/ui/src/main/templates/autoComplete.template.xml 2010-08-16 14:11:11 UTC (rev 18662)
@@ -15,8 +15,8 @@
<cc:implementation>
<cdk:object type="java.lang.Object" name="disabled" value="#{component.attributes['disabled']}" />
- <div id="#{clientId}" class="cb_field_width cb_field">
- <input id="#{clientId}Value" name="#{clientId}Value" type="hidden" class="cb_font cb_input" />
+ <div id="#{clientId}" class="rf-au-f-w rf-au-f">
+ <input id="#{clientId}Value" name="#{clientId}Value" type="hidden" class="rf-au-ft rf-au-i" />
<div style="position : relative; overflow : hidden; text-align : left; padding-right : 21px;">
<input onclick="#{component.attributes['onclick']}"
ondblclick="#{component.attributes['ondblclick']}"
@@ -29,16 +29,16 @@
onmouseout="#{component.attributes['onmouseout']}"
onkeyup="#{component.attributes['onkeyup']}"
onkeydown="#{component.attributes['onkeydown']}"
- onkeypress="#{component.attributes['onkeypress']}" id="#{clientId}Input" disabled="#{disabled}" name="#{clientId}" type="text" class="cb_font cb_input" />
+ onkeypress="#{component.attributes['onkeypress']}" id="#{clientId}Input" disabled="#{disabled}" name="#{clientId}" type="text" class="rf-au-ft rf-au-i" />
<c:if test="#{component.attributes['showButton']}">
<c:if test="#{component.attributes['disabled']}">
- <div id="#{clientId}Button" class="cb_button">
- <div class="cb_button_arrow"></div>
+ <div id="#{clientId}Button" class="rf-au-b">
+ <div class="rf-au-b-a"></div>
</div>
</c:if>
<c:if test="#{!component.attributes['disabled']}">
- <div id="#{clientId}Button" class="cb_button">
- <div class="cb_button_arrow"></div>
+ <div id="#{clientId}Button" class="rf-au-b">
+ <div class="rf-au-b-a"></div>
</div>
</c:if>
</c:if>
@@ -56,16 +56,16 @@
onkeyup="#{component.attributes['onlistkeyup']}"
onkeydown="#{component.attributes['onlistkeydown']}"
onkeypress="#{component.attributes['onlistkeypress']}"
- id="#{clientId}List" class="cb_list_cord">
+ id="#{clientId}List" class="rf-au-l-c">
- <div class="cb_shadow">
- <div class="cb_shadow_t"></div>
- <div class="cb_shadow_l"></div>
- <div class="cb_shadow_r"></div>
- <div class="cb_shadow_b"></div>
+ <div class="rf-au-shw">
+ <div class="rf-au-shw-t"></div>
+ <div class="rf-au-shw-l"></div>
+ <div class="rf-au-shw-r"></div>
+ <div class="rf-au-shw-b"></div>
- <div class="cb_list_decoration">
- <div class="cb_list_scroll cb_list_width cb_list_height">
+ <div class="rf-au-l-d">
+ <div class="rf-au-l-s rf-au-l-w rf-au-l-h">
<cdk:body>
<cdk:call expression="encodeItemsContainer(facesContext, component)"/>
</cdk:body>
15 years, 9 months