[richfaces-svn-commits] JBoss Rich Faces SVN: r18687 - in branches/RF-9023: archetypes/richfaces-archetype-simpleapp/src/main/resources/archetype-resources/src/main/java/org/richfaces and 19 other directories.

richfaces-svn-commits at lists.jboss.org richfaces-svn-commits at lists.jboss.org
Mon Aug 16 20:07:07 EDT 2010


Author: jbalunas at redhat.com
Date: 2010-08-16 20:07:05 -0400 (Mon, 16 Aug 2010)
New Revision: 18687

Added:
   branches/RF-9023/archetypes/richfaces-archetype-simpleapp/src/main/resources/archetype-resources/src/main/java/org/richfaces/RichBean.java
   branches/RF-9023/core/impl/src/test/resources/META-INF/resources/
   branches/RF-9023/core/impl/src/test/resources/META-INF/resources/org.richfaces.resource.test/
   branches/RF-9023/core/impl/src/test/resources/META-INF/resources/org.richfaces.resource.test/libraryResource.js
   branches/RF-9023/examples/output-demo/src/main/webapp/qunit/accordionHeaders.xhtml
   branches/RF-9023/examples/output-demo/src/main/webapp/resources/tests/richfaces-accordion-headers-qunit.js
Removed:
   branches/RF-9023/archetypes/richfaces-archetype-simpleapp/src/main/resources/archetype-resources/src/main/java/org/richfaces/TogglePanelBean.java
   branches/RF-9023/archetypes/richfaces-archetype-simpleapp/src/main/resources/archetype-resources/src/main/webapp/examples/
   branches/RF-9023/core/impl/src/test/resources/META-INF/resources/org.richfaces.resource.test/
   branches/RF-9023/core/impl/src/test/resources/META-INF/resources/org.richfaces.resource.test/libraryResource.js
   branches/RF-9023/core/impl/src/test/resources/resources/org.richfaces.resource.test/
Modified:
   branches/RF-9023/
   branches/RF-9023/archetypes/richfaces-archetype-simpleapp/src/main/resources/archetype-resources/src/main/webapp/WEB-INF/faces-config.xml
   branches/RF-9023/archetypes/richfaces-archetype-simpleapp/src/main/resources/archetype-resources/src/main/webapp/index.xhtml
   branches/RF-9023/archetypes/richfaces-archetype-simpleapp/src/main/resources/archetype-resources/src/main/webapp/templates/template.xhtml
   branches/RF-9023/cdk/plugins/annotations/pom.xml
   branches/RF-9023/examples/misc-demo/src/main/java/org/richfaces/demo/JQueryBean.java
   branches/RF-9023/examples/misc-demo/src/main/webapp/pages/jquery.xhtml
   branches/RF-9023/examples/output-demo/src/main/webapp/WEB-INF/faces-config.xml
   branches/RF-9023/examples/output-demo/src/main/webapp/qunit/accordion.xhtml
   branches/RF-9023/examples/output-demo/src/main/webapp/templates/template.xhtml
   branches/RF-9023/ui/dist/richfaces-components-ui/pom.xml
   branches/RF-9023/ui/misc/ui/src/main/java/org/richfaces/renderkit/JQueryRendererBase.java
   branches/RF-9023/ui/misc/ui/src/main/resources/META-INF/resources/org.richfaces/jquery.component.js
   branches/RF-9023/ui/misc/ui/src/main/templates/jquery.template.xml
   branches/RF-9023/ui/output/ui/src/main/java/org/richfaces/renderkit/html/AccordionItemRenderer.java
Log:
Merged revisions 18670,18673,18675-18678 via svnmerge from 
https://svn.jboss.org/repos/richfaces/trunk

.......
  r18670 | Alex.Kolonitsky | 2010-08-16 11:48:02 -0400 (Mon, 16 Aug 2010) | 1 line
  
  RF-8790
.......
  r18673 | Alex.Kolonitsky | 2010-08-16 13:23:23 -0400 (Mon, 16 Aug 2010) | 1 line
  
  RF-8947 RichFaces SimpleApp Archetype is out of sync with project
.......
  r18675 | nbelaevski | 2010-08-16 14:18:03 -0400 (Mon, 16 Aug 2010) | 1 line
  
  https://jira.jboss.org/browse/RF-8993
.......
  r18676 | nbelaevski | 2010-08-16 14:18:29 -0400 (Mon, 16 Aug 2010) | 1 line
  
  https://jira.jboss.org/browse/RF-8993
.......
  r18677 | nbelaevski | 2010-08-16 14:50:41 -0400 (Mon, 16 Aug 2010) | 1 line
  
  Fixed unit test failure under MyFaces
.......
  r18678 | nbelaevski | 2010-08-16 15:35:17 -0400 (Mon, 16 Aug 2010) | 1 line
  
  Added missing 'provided' scope for CDK/annotations
.......



Property changes on: branches/RF-9023
___________________________________________________________________
Name: svnmerge-integrated
   - /trunk:1-18667 /branches/RF-9040_build_updated_m2:1-18626
   + /branches/RF-9040_build_updated_m2:1-18626 /trunk:1-18685

Copied: branches/RF-9023/archetypes/richfaces-archetype-simpleapp/src/main/resources/archetype-resources/src/main/java/org/richfaces/RichBean.java (from rev 18678, trunk/archetypes/richfaces-archetype-simpleapp/src/main/resources/archetype-resources/src/main/java/org/richfaces/RichBean.java)
===================================================================
--- branches/RF-9023/archetypes/richfaces-archetype-simpleapp/src/main/resources/archetype-resources/src/main/java/org/richfaces/RichBean.java	                        (rev 0)
+++ branches/RF-9023/archetypes/richfaces-archetype-simpleapp/src/main/resources/archetype-resources/src/main/java/org/richfaces/RichBean.java	2010-08-17 00:07:05 UTC (rev 18687)
@@ -0,0 +1,27 @@
+package org.richfaces;
+
+import org.slf4j.LoggerFactory;
+import org.slf4j.Logger;
+
+import java.io.Serializable;
+
+public class RichBean implements Serializable {
+
+    private static final long serialVersionUID = -2403138958014741653L;
+    private Logger logger;
+    private String name;
+
+    public RichBean() {
+        logger = LoggerFactory.getLogger(RichBean.class);
+        logger.info("post construct: initialize");
+        name = "John";
+    }
+
+    public String getName() {
+        return name;
+    }
+
+    public void setName(String name) {
+        this.name = name;
+    }
+}

Deleted: branches/RF-9023/archetypes/richfaces-archetype-simpleapp/src/main/resources/archetype-resources/src/main/java/org/richfaces/TogglePanelBean.java
===================================================================
--- branches/RF-9023/archetypes/richfaces-archetype-simpleapp/src/main/resources/archetype-resources/src/main/java/org/richfaces/TogglePanelBean.java	2010-08-16 23:48:07 UTC (rev 18686)
+++ branches/RF-9023/archetypes/richfaces-archetype-simpleapp/src/main/resources/archetype-resources/src/main/java/org/richfaces/TogglePanelBean.java	2010-08-17 00:07:05 UTC (rev 18687)
@@ -1,32 +0,0 @@
-package org.richfaces;
-
-import org.slf4j.LoggerFactory;
-import org.slf4j.Logger;
-
-import java.io.Serializable;
-
-public class TogglePanelBean implements Serializable {
-
-    private static final long serialVersionUID = -2403138958014741653L;
-    
-    private static final Logger LOGGER = LoggerFactory.getLogger(TogglePanelBean.class);
-    
-    private String name;
-
-    public TogglePanelBean() {
-        LOGGER.info("post construct: initialize");
-        name = "John";
-    }
-
-    public String getName() {
-        return name;
-    }
-
-    public void setName(String name) {
-        this.name = name;
-    }
-
-    public void itemChangeActionListener() {
-        LOGGER.info("TogglePanelBean.itemChangeActionListener");
-    }
-}

Modified: branches/RF-9023/archetypes/richfaces-archetype-simpleapp/src/main/resources/archetype-resources/src/main/webapp/WEB-INF/faces-config.xml
===================================================================
--- branches/RF-9023/archetypes/richfaces-archetype-simpleapp/src/main/resources/archetype-resources/src/main/webapp/WEB-INF/faces-config.xml	2010-08-16 23:48:07 UTC (rev 18686)
+++ branches/RF-9023/archetypes/richfaces-archetype-simpleapp/src/main/resources/archetype-resources/src/main/webapp/WEB-INF/faces-config.xml	2010-08-17 00:07:05 UTC (rev 18687)
@@ -3,38 +3,8 @@
     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-facesconfig_2_0.xsd">
 
     <managed-bean>
-        <managed-bean-name>togglePanelBean</managed-bean-name>
-        <managed-bean-class>org.richfaces.TogglePanelBean</managed-bean-class>
+        <managed-bean-name>richBean</managed-bean-name>
+        <managed-bean-class>org.richfaces.RichBean</managed-bean-class>
         <managed-bean-scope>view</managed-bean-scope>
     </managed-bean>
-
-    <navigation-rule>
-        <!-- Examples -->
-        <navigation-case>
-            <from-outcome>togglePanel</from-outcome>
-            <to-view-id>/examples/togglePanel.xhtml</to-view-id>
-        </navigation-case>
-        <navigation-case>
-            <from-outcome>togglePanel/server</from-outcome>
-            <to-view-id>/examples/togglePanel-server.xhtml</to-view-id>
-        </navigation-case>
-        <navigation-case>
-            <from-outcome>togglePanel/ajax</from-outcome>
-            <to-view-id>/examples/togglePanel-ajax.xhtml</to-view-id>
-        </navigation-case>
-        <navigation-case>
-            <from-outcome>togglePanel/client</from-outcome>
-            <to-view-id>/examples/togglePanel-client.xhtml</to-view-id>
-        </navigation-case>
-
-        <!-- QUnit -->
-        <navigation-case>
-            <from-outcome>qunit/togglePanel</from-outcome>
-            <to-view-id>/qunit/togglePanel.xhtml</to-view-id>
-        </navigation-case>
-        <navigation-case>
-            <from-outcome>qunit/togglePanelItem</from-outcome>
-            <to-view-id>/qunit/togglePanelItem.xhtml</to-view-id>
-        </navigation-case>
-    </navigation-rule>
 </faces-config>

Modified: branches/RF-9023/archetypes/richfaces-archetype-simpleapp/src/main/resources/archetype-resources/src/main/webapp/index.xhtml
===================================================================
--- branches/RF-9023/archetypes/richfaces-archetype-simpleapp/src/main/resources/archetype-resources/src/main/webapp/index.xhtml	2010-08-16 23:48:07 UTC (rev 18686)
+++ branches/RF-9023/archetypes/richfaces-archetype-simpleapp/src/main/resources/archetype-resources/src/main/webapp/index.xhtml	2010-08-17 00:07:05 UTC (rev 18687)
@@ -1,9 +1,9 @@
+#set( $symbol_pound = '#' )
+#set( $symbol_dollar = '$' )
+#set( $symbol_escape = '\' )
 <!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:pa="http://richfaces.org/panels">
+<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:a4j="http://richfaces.org/a4j">
 
 <body>
 <ui:composition template="/templates/template.xhtml">
@@ -11,10 +11,17 @@
     <ui:define name="title">RichFaces Sample</ui:define>
 
     <ui:define name="body">
-        look at left
+        <h:form prependId="false">
+            <h:outputLabel value="Name:" for="nameInput" />
+            <h:inputText id="nameInput" value="${symbol_pound}{richBean.name}">
+                <a4j:ajax event="keyup" render="output" />
+            </h:inputText>
+            <h:panelGroup id="output">
+                <h:outputText value="Hello ${symbol_pound}{richBean.name}!"
+                    rendered="${symbol_pound}{not empty richBean.name}" />
+            </h:panelGroup>
+        </h:form>
     </ui:define>
-
-    <div style="top: auto;"></div>
 </ui:composition>
 </body>
-</html>
+</html>
\ No newline at end of file

Modified: branches/RF-9023/archetypes/richfaces-archetype-simpleapp/src/main/resources/archetype-resources/src/main/webapp/templates/template.xhtml
===================================================================
--- branches/RF-9023/archetypes/richfaces-archetype-simpleapp/src/main/resources/archetype-resources/src/main/webapp/templates/template.xhtml	2010-08-16 23:48:07 UTC (rev 18686)
+++ branches/RF-9023/archetypes/richfaces-archetype-simpleapp/src/main/resources/archetype-resources/src/main/webapp/templates/template.xhtml	2010-08-17 00:07:05 UTC (rev 18687)
@@ -1,54 +1,16 @@
+#set( $symbol_pound = '#' ) 
+#set( $symbol_dollar = '$' ) 
+#set( $symbol_escape = '\' )
 <!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" >
+<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:a4j="http://richfaces.org/a4j">
 
 <h:head>
-    <title>
-        <ui:define name="title">Application Title</ui:define>
-    </title>
-
+    <title><ui:define name="title">Application Title</ui:define></title>
     <meta http-equiv="content-type" content="text/xhtml; charset=UTF-8" />
-
 </h:head>
 
 <h:body>
-    <ui:insert name="scripts" ></ui:insert>
-    <table width="100%">
-        <thead>
-            <tr>
-                <th width="20%" align="left">Content</th>
-                <th width="80%" align="left">
-                    <ui:insert name="body_head">Example</ui:insert>
-                </th>
-            </tr>
-        </thead>
-        <tbody>
-            <tr valign="top">
-                <td>
-                    <h:form id="nav">
-                        <p>Examples</p>
-                        <ul>
-                            <li><h:commandLink value="divPanel" action="divPanel" /></li>
-                            <li><h:commandLink value="togglePanel" action="togglePanel" /></li>
-                            <li><h:commandLink value="togglePanel Ajax" action="togglePanel/ajax" /></li>
-                            <li><h:commandLink value="togglePanel Client" action="togglePanel/client" /></li>
-                            <li><h:commandLink value="togglePanel Server" action="togglePanel/server" /></li>
-                        </ul>
-                        <p>QUnit</p>
-                        <ul>
-                            <li><h:commandLink value="togglePanel" action="qunit/togglePanel" /></li>
-                            <li><h:commandLink value="togglePanelItem" action="qunit/togglePanelItem" /></li>
-                        </ul>
-                    </h:form>
-                </td>
-                <td>
-                    <ui:insert name="body">Default content</ui:insert>
-                </td>
-            </tr>
-        </tbody>
-    </table>
-
+    <ui:insert name="body">Default content</ui:insert>
 </h:body>
 </html>

Modified: branches/RF-9023/cdk/plugins/annotations/pom.xml
===================================================================
--- branches/RF-9023/cdk/plugins/annotations/pom.xml	2010-08-16 23:48:07 UTC (rev 18686)
+++ branches/RF-9023/cdk/plugins/annotations/pom.xml	2010-08-17 00:07:05 UTC (rev 18687)
@@ -13,9 +13,10 @@
   <description>That project contains annotations for JSF classes</description>
   <name>annotations</name>
   <dependencies>
-		<dependency>
-                <groupId>com.sun.faces</groupId>
-                <artifactId>jsf-api</artifactId>
-        </dependency>
+    <dependency>
+        <groupId>com.sun.faces</groupId>
+        <artifactId>jsf-api</artifactId>
+        <scope>provided</scope>
+    </dependency>
   </dependencies>
 </project>

Copied: branches/RF-9023/core/impl/src/test/resources/META-INF/resources (from rev 18678, trunk/core/impl/src/test/resources/META-INF/resources)

Copied: branches/RF-9023/core/impl/src/test/resources/META-INF/resources/org.richfaces.resource.test (from rev 18678, trunk/core/impl/src/test/resources/META-INF/resources/org.richfaces.resource.test)

Deleted: branches/RF-9023/core/impl/src/test/resources/META-INF/resources/org.richfaces.resource.test/libraryResource.js
===================================================================
--- trunk/core/impl/src/test/resources/META-INF/resources/org.richfaces.resource.test/libraryResource.js	2010-08-16 19:35:17 UTC (rev 18678)
+++ branches/RF-9023/core/impl/src/test/resources/META-INF/resources/org.richfaces.resource.test/libraryResource.js	2010-08-17 00:07:05 UTC (rev 18687)
@@ -1 +0,0 @@
-/* that is a dependency of org.richfaces.resource.ResourceHandlerImplTest */
\ No newline at end of file

Copied: branches/RF-9023/core/impl/src/test/resources/META-INF/resources/org.richfaces.resource.test/libraryResource.js (from rev 18678, trunk/core/impl/src/test/resources/META-INF/resources/org.richfaces.resource.test/libraryResource.js)
===================================================================
--- branches/RF-9023/core/impl/src/test/resources/META-INF/resources/org.richfaces.resource.test/libraryResource.js	                        (rev 0)
+++ branches/RF-9023/core/impl/src/test/resources/META-INF/resources/org.richfaces.resource.test/libraryResource.js	2010-08-17 00:07:05 UTC (rev 18687)
@@ -0,0 +1 @@
+/* that is a dependency of org.richfaces.resource.ResourceHandlerImplTest */
\ No newline at end of file

Modified: branches/RF-9023/examples/misc-demo/src/main/java/org/richfaces/demo/JQueryBean.java
===================================================================
--- branches/RF-9023/examples/misc-demo/src/main/java/org/richfaces/demo/JQueryBean.java	2010-08-16 23:48:07 UTC (rev 18686)
+++ branches/RF-9023/examples/misc-demo/src/main/java/org/richfaces/demo/JQueryBean.java	2010-08-17 00:07:05 UTC (rev 18687)
@@ -39,9 +39,16 @@
 
     private List<String> componentsDataList;
 
+    private List<String> emphasizedElements;
+
     public JQueryBean() {
         componentsDataList = new ArrayList<String>();
         addComponent();
+        
+        emphasizedElements = new ArrayList<String>();
+        for (int i = 0; i < 4; i++) {
+            emphasizedElements.add(UUID.randomUUID().toString());
+        }
     }
 
     public List<String> getComponentsDataList() {
@@ -52,4 +59,7 @@
         componentsDataList.add(UUID.randomUUID().toString());
     }
 
+    public Object getEmphasizedElements() {
+        return emphasizedElements;
+    }
 }

Modified: branches/RF-9023/examples/misc-demo/src/main/webapp/pages/jquery.xhtml
===================================================================
--- branches/RF-9023/examples/misc-demo/src/main/webapp/pages/jquery.xhtml	2010-08-16 23:48:07 UTC (rev 18686)
+++ branches/RF-9023/examples/misc-demo/src/main/webapp/pages/jquery.xhtml	2010-08-17 00:07:05 UTC (rev 18687)
@@ -44,7 +44,15 @@
 				<f:ajax render=":liveTestGroup" />
 			</h:commandButton>
 		</h:form>
-
+		
+		<misc:jQuery name="emphasizeElement" query="siblings().css({'border-width': '0px'}).end().css({'border-width': '1px'})" />
+		
+		Click any list item to make selection (imitated by red 1px border):
+		<ul>
+			<ui:repeat value="#{jQueryBean.emphasizedElements}" var="elt">
+				<li style="border-color: red; border-style: solid; border-width: 0px;" onclick="emphasizeElement(this, {})">#{elt}</li>			
+			</ui:repeat>
+		</ul>
 	</h:body>
 </f:view>
 </html>

Modified: branches/RF-9023/examples/output-demo/src/main/webapp/WEB-INF/faces-config.xml
===================================================================
--- branches/RF-9023/examples/output-demo/src/main/webapp/WEB-INF/faces-config.xml	2010-08-16 23:48:07 UTC (rev 18686)
+++ branches/RF-9023/examples/output-demo/src/main/webapp/WEB-INF/faces-config.xml	2010-08-17 00:07:05 UTC (rev 18687)
@@ -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: branches/RF-9023/examples/output-demo/src/main/webapp/qunit/accordion.xhtml
===================================================================
--- branches/RF-9023/examples/output-demo/src/main/webapp/qunit/accordion.xhtml	2010-08-16 23:48:07 UTC (rev 18686)
+++ branches/RF-9023/examples/output-demo/src/main/webapp/qunit/accordion.xhtml	2010-08-17 00:07:05 UTC (rev 18687)
@@ -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>

Copied: branches/RF-9023/examples/output-demo/src/main/webapp/qunit/accordionHeaders.xhtml (from rev 18678, trunk/examples/output-demo/src/main/webapp/qunit/accordionHeaders.xhtml)
===================================================================
--- branches/RF-9023/examples/output-demo/src/main/webapp/qunit/accordionHeaders.xhtml	                        (rev 0)
+++ branches/RF-9023/examples/output-demo/src/main/webapp/qunit/accordionHeaders.xhtml	2010-08-17 00:07:05 UTC (rev 18687)
@@ -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>
+

Copied: branches/RF-9023/examples/output-demo/src/main/webapp/resources/tests/richfaces-accordion-headers-qunit.js (from rev 18678, trunk/examples/output-demo/src/main/webapp/resources/tests/richfaces-accordion-headers-qunit.js)
===================================================================
--- branches/RF-9023/examples/output-demo/src/main/webapp/resources/tests/richfaces-accordion-headers-qunit.js	                        (rev 0)
+++ branches/RF-9023/examples/output-demo/src/main/webapp/resources/tests/richfaces-accordion-headers-qunit.js	2010-08-17 00:07:05 UTC (rev 18687)
@@ -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: branches/RF-9023/examples/output-demo/src/main/webapp/templates/template.xhtml
===================================================================
--- branches/RF-9023/examples/output-demo/src/main/webapp/templates/template.xhtml	2010-08-16 23:48:07 UTC (rev 18686)
+++ branches/RF-9023/examples/output-demo/src/main/webapp/templates/template.xhtml	2010-08-17 00:07:05 UTC (rev 18687)
@@ -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: branches/RF-9023/ui/dist/richfaces-components-ui/pom.xml
===================================================================
--- branches/RF-9023/ui/dist/richfaces-components-ui/pom.xml	2010-08-16 23:48:07 UTC (rev 18686)
+++ branches/RF-9023/ui/dist/richfaces-components-ui/pom.xml	2010-08-17 00:07:05 UTC (rev 18687)
@@ -68,6 +68,10 @@
 
         <!-- for javadoc generation -->
         <dependency>
+            <groupId>org.richfaces.ui</groupId>
+            <artifactId>richfaces-components-api</artifactId>
+        </dependency>
+        <dependency>
             <groupId>org.richfaces.core</groupId>
             <artifactId>richfaces-core-api</artifactId>
         </dependency>

Modified: branches/RF-9023/ui/misc/ui/src/main/java/org/richfaces/renderkit/JQueryRendererBase.java
===================================================================
--- branches/RF-9023/ui/misc/ui/src/main/java/org/richfaces/renderkit/JQueryRendererBase.java	2010-08-16 23:48:07 UTC (rev 18686)
+++ branches/RF-9023/ui/misc/ui/src/main/java/org/richfaces/renderkit/JQueryRendererBase.java	2010-08-17 00:07:05 UTC (rev 18687)
@@ -34,8 +34,8 @@
 import org.ajax4jsf.javascript.ScriptUtils;
 import org.ajax4jsf.renderkit.RendererUtils;
 import org.richfaces.component.AbstractJQuery;
+import org.richfaces.component.JQueryAttachType;
 import org.richfaces.component.JQueryTiming;
-import org.richfaces.component.JQueryAttachType;
 import org.richfaces.component.util.HtmlUtil;
 
 /**

Modified: branches/RF-9023/ui/misc/ui/src/main/resources/META-INF/resources/org.richfaces/jquery.component.js
===================================================================
--- branches/RF-9023/ui/misc/ui/src/main/resources/META-INF/resources/org.richfaces/jquery.component.js	2010-08-16 23:48:07 UTC (rev 18686)
+++ branches/RF-9023/ui/misc/ui/src/main/resources/META-INF/resources/org.richfaces/jquery.component.js	2010-08-17 00:07:05 UTC (rev 18687)
@@ -4,65 +4,75 @@
 
 (function(jquery, richfaces) {
 
-	var evaluateSelector = function(selector) {
+	var evaluate = function(selector) {
 		var result = selector;
 		try {
 			result = eval(selector);
 		} catch (e) {
 			//do nothing
 		}
-		return result || "";
+		return result;
 	};
 
-	var createHandler = function(handler) {
-		if (typeof handler == 'function') {
-			return handler;
-		} else {
-			return new Function("event", handler);
+	var evaluateJQuery = function(element, selector) {
+		var result = element || evaluate(selector);
+		if (!(result instanceof jquery)) {
+			result = jquery(result || "");
 		}
+		
+		return result;
 	};
-
-	var bindFunction = function(options) {
-
-		var selector = evaluateSelector(options.selector);
-		var query = options.query;
-
-		if (options.event) {
-			var handler = createHandler(query);
-
-			if (options.attachType == 'live') {
-				jQuery(selector).live(options.event, handler);
-			} else if (options.attachType == 'one') {
-				jQuery(selector).one(options.event, handler);
+	
+	var createEventHandlerFunction = function(opts) {
+		return function() {
+			var selector = evaluateJQuery(null, opts.selector);
+			selector[opts.attachType || "bind"](opts.event, null, new Function("event", opts.query));
+		};
+	};
+	
+	var createDirectQueryFunction = function(opts) {
+		var queryFunction = new Function("options", "arguments[1]." + opts.query);
+		
+		return function() {
+			var element;
+			var options;
+			
+			if (arguments.length == 1) {
+				//function(options) { ...query()... }
+				options = arguments[0];
 			} else {
-				jQuery(selector).bind(options.event, handler);
+				//function(element, options) { ...query()... }
+				element = arguments[0];
+				options = arguments[1];
 			}
+			
+			var selector = evaluateJQuery(element, opts.selector);
+			queryFunction.call(this, options, selector);
+		};
+	};
+	
+	var createQueryFunction = function(options) {
+		if (options.event) {
+			return createEventHandlerFunction(options);
 		} else {
-			var f = new Function("__locatedObject", "__locatedObject." + query);
-			f.call(this, jQuery(selector));
-			//TODO return value?
+			return createDirectQueryFunction(options);
 		}
 	};
-
-	var bind = function(options) {
-		if (options.timing == 'immediate') {
-			bindFunction(options);
+	
+	var query = function(options) {
+		if (options.timing == 'domready') {
+			jquery(document).ready(createQueryFunction(options));
 		} else {
-			jQuery(document).ready(function() {
-				bindFunction(options);
-			});
+			createQueryFunction(options).call(this);
 		}
 	};
-
+	
 	richfaces.jQuery = {
+			
+		createFunction: createQueryFunction,	
+			
+		query: query
 
-		bind: bind,
-
-		createBinder: function(options) {
-			return function() {
-				bind(options);
-			};
-		}
 	};
 
 }(jQuery, RichFaces));

Modified: branches/RF-9023/ui/misc/ui/src/main/templates/jquery.template.xml
===================================================================
--- branches/RF-9023/ui/misc/ui/src/main/templates/jquery.template.xml	2010-08-16 23:48:07 UTC (rev 18686)
+++ branches/RF-9023/ui/misc/ui/src/main/templates/jquery.template.xml	2010-08-17 00:07:05 UTC (rev 18687)
@@ -20,10 +20,10 @@
 
 				<c:choose>
 					<c:when test="#{not empty functionName}">
-						#{functionName} = RichFaces.jQuery.createBinder(#{options});
+						#{functionName} = RichFaces.jQuery.createFunction(#{options});
 					</c:when>
 					<c:otherwise>
-						RichFaces.jQuery.bind(#{options});
+						RichFaces.jQuery.query(#{options});
 					</c:otherwise>
 				</c:choose>
 			</script>

Modified: branches/RF-9023/ui/output/ui/src/main/java/org/richfaces/renderkit/html/AccordionItemRenderer.java
===================================================================
--- branches/RF-9023/ui/output/ui/src/main/java/org/richfaces/renderkit/html/AccordionItemRenderer.java	2010-08-16 23:48:07 UTC (rev 18686)
+++ branches/RF-9023/ui/output/ui/src/main/java/org/richfaces/renderkit/html/AccordionItemRenderer.java	2010-08-17 00:07:05 UTC (rev 18687)
@@ -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 {



More information about the richfaces-svn-commits mailing list