Author: Alex.Kolonitsky
Date: 2010-11-02 15:20:52 -0400 (Tue, 02 Nov 2010)
New Revision: 19901
Added:
trunk/examples/output-demo/src/main/java/org/richfaces/TemplateBean.java
trunk/examples/output-demo/src/main/webapp/examples/accordion/RF-9364.xhtml
Modified:
trunk/examples/output-demo/src/main/webapp/WEB-INF/faces-config.xml
trunk/examples/output-demo/src/main/webapp/examples/accordion.xhtml
trunk/examples/output-demo/src/main/webapp/examples/togglePanel-client.xhtml
trunk/examples/output-demo/src/main/webapp/templates/template.xhtml
trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/TogglePanel.js
Log:
RF-9364 Accordion: server switch type doesn't work inside iteration components
Added: trunk/examples/output-demo/src/main/java/org/richfaces/TemplateBean.java
===================================================================
--- trunk/examples/output-demo/src/main/java/org/richfaces/TemplateBean.java
(rev 0)
+++ trunk/examples/output-demo/src/main/java/org/richfaces/TemplateBean.java 2010-11-02
19:20:52 UTC (rev 19901)
@@ -0,0 +1,63 @@
+/**
+ * License Agreement.
+ *
+ * Rich Faces - Natural Ajax for Java Server Faces (JSF)
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library 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 library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+package org.richfaces;
+
+import javax.annotation.PostConstruct;
+import javax.faces.bean.ManagedBean;
+import javax.faces.bean.SessionScoped;
+import java.io.Serializable;
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * @author akolonitsky
+ * @since Nov 2, 2010
+ */
+@ManagedBean
+@SessionScoped
+public class TemplateBean implements Serializable {
+
+ private static final long serialVersionUID = 5078700314562231363L;
+ private List<String> dataTableModel = new ArrayList<String>();
+ private boolean renderForm;
+
+ @PostConstruct
+ public void init() {
+ dataTableModel.add("row 1");
+ dataTableModel.add("row 2");
+ dataTableModel.add("row 3");
+ dataTableModel.add("row 4");
+ }
+
+ public List<String> getDataTableModel() {
+ return dataTableModel;
+ }
+
+ public boolean isRenderForm() {
+ return renderForm;
+ }
+
+ public void setRenderForm(boolean renderForm) {
+ this.renderForm = renderForm;
+ }
+
+}
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-11-02
18:58:49 UTC (rev 19900)
+++ trunk/examples/output-demo/src/main/webapp/WEB-INF/faces-config.xml 2010-11-02
19:20:52 UTC (rev 19901)
@@ -58,6 +58,10 @@
<to-view-id>/examples/accordion.xhtml</to-view-id>
</navigation-case>
<navigation-case>
+ <from-outcome>RF-9364</from-outcome>
+ <to-view-id>/examples/accordion/RF-9364.xhtml</to-view-id>
+ </navigation-case>
+ <navigation-case>
<from-outcome>qunit/accordion</from-outcome>
<to-view-id>/qunit/accordion.xhtml</to-view-id>
</navigation-case>
Added: trunk/examples/output-demo/src/main/webapp/examples/accordion/RF-9364.xhtml
===================================================================
--- trunk/examples/output-demo/src/main/webapp/examples/accordion/RF-9364.xhtml
(rev 0)
+++ trunk/examples/output-demo/src/main/webapp/examples/accordion/RF-9364.xhtml 2010-11-02
19:20:52 UTC (rev 19901)
@@ -0,0 +1,39 @@
+<!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="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;">
+ <h:dataTable value="#{templateBean.dataTableModel}"
var="item" id="containerHDataTable1" >
+ <h:column>
+ <f:facet name="header">
+ <h:outputText value="JSF Data Table"/>
+ </f:facet>
+ <h:panelGroup columns="1" rendered="#{item ==
'row 1'}">
+ <pn:accordion width="500px" height="300px"
switchType="server">
+ <pn:accordionItem
+ header="label 1">Content will be here.
Content will be here. Content will be here. Content will be here. Content will be here.
Content will be here. Content will be here. Content will be here. Content will be here.
Content will be here. Content will be here. Content will be here. Content will be here.
Content will be here. Content will be here. Content will be here. Content will be here.
Content will be here. Content will be here. Content will be here. Content will be here.
Content will be here. Content will be here. Content will be here. Content will be here.
Content will be here. Content will be here. Content will be here. Content will be here.
Content will be here. Content will be here. Content will be here. Content will be here.
Content will be here.</pn:accordionItem>
+ <pn:accordionItem header="label 2">content
2</pn:accordionItem>
+ <pn:accordionItem header="label 3">content
3</pn:accordionItem>
+ </pn:accordion>
+ </h:panelGroup>
+ <h:outputText value="#{item}" rendered="#{item !=
'row 1'}"/>
+ </h:column>
+ </h:dataTable>
+ </h:form>
+ </ui:define>
+</ui:composition>
+</body>
+</html>
+
Modified: trunk/examples/output-demo/src/main/webapp/examples/accordion.xhtml
===================================================================
--- trunk/examples/output-demo/src/main/webapp/examples/accordion.xhtml 2010-11-02
18:58:49 UTC (rev 19900)
+++ trunk/examples/output-demo/src/main/webapp/examples/accordion.xhtml 2010-11-02
19:20:52 UTC (rev 19901)
@@ -15,11 +15,13 @@
<p>Page</p>
<h:form id="f" style="border:blue solid thin;">
- <pn:accordion width="500px" height="300px">
- <pn:accordionItem header="label 1">Content will be here.
Content will be here. Content will be here. Content will be here. Content will be here.
Content will be here. Content will be here. Content will be here. Content will be here.
Content will be here. Content will be here. Content will be here. Content will be here.
Content will be here. Content will be here. Content will be here. Content will be here.
Content will be here. Content will be here. Content will be here. Content will be here.
Content will be here. Content will be here. Content will be here. Content will be here.
Content will be here. Content will be here. Content will be here. Content will be here.
Content will be here. Content will be here. Content will be here. Content will be here.
Content will be here.</pn:accordionItem>
- <pn:accordionItem header="label 2">content
2</pn:accordionItem>
- <pn:accordionItem header="label 3">content
3</pn:accordionItem>
- </pn:accordion>
+ <h:panelGroup>
+ <pn:accordion width="500px" height="300px">
+ <pn:accordionItem header="label 1">Content will be
here. Content will be here. Content will be here. Content will be here. Content will be
here. Content will be here. Content will be here. Content will be here. Content will be
here. Content will be here. Content will be here. Content will be here. Content will be
here. Content will be here. Content will be here. Content will be here. Content will be
here. Content will be here. Content will be here. Content will be here. Content will be
here. Content will be here. Content will be here. Content will be here. Content will be
here. Content will be here. Content will be here. Content will be here. Content will be
here. Content will be here. Content will be here. Content will be here. Content will be
here. Content will be here.</pn:accordionItem>
+ <pn:accordionItem header="label 2">content
2</pn:accordionItem>
+ <pn:accordionItem header="label 3">content
3</pn:accordionItem>
+ </pn:accordion>
+ </h:panelGroup>
</h:form>
</ui:define>
</ui:composition>
Modified: trunk/examples/output-demo/src/main/webapp/examples/togglePanel-client.xhtml
===================================================================
---
trunk/examples/output-demo/src/main/webapp/examples/togglePanel-client.xhtml 2010-11-02
18:58:49 UTC (rev 19900)
+++
trunk/examples/output-demo/src/main/webapp/examples/togglePanel-client.xhtml 2010-11-02
19:20:52 UTC (rev 19901)
@@ -13,7 +13,7 @@
<ui:define name="body">
<h:form id="f">
- <pn:togglePanel id="panel" switchType="client"
lang="en">
+ <pn:togglePanel id="panel" switchType="null"
lang="en">
<pn:togglePanelItem name="name1">hello
name1</pn:togglePanelItem>
<pn:togglePanelItem name="name2">hello
name2</pn:togglePanelItem>
<pn:togglePanelItem name="name3">hello
name3</pn:togglePanelItem>
Modified: trunk/examples/output-demo/src/main/webapp/templates/template.xhtml
===================================================================
--- trunk/examples/output-demo/src/main/webapp/templates/template.xhtml 2010-11-02
18:58:49 UTC (rev 19900)
+++ trunk/examples/output-demo/src/main/webapp/templates/template.xhtml 2010-11-02
19:20:52 UTC (rev 19901)
@@ -67,12 +67,20 @@
<ul>
<li><h:commandLink value="accordion"
action="accordion" /></li>
</ul>
+ </li>
+ <li>
<p>QUnit</p>
<ul>
<li><h:commandLink value="accordion"
action="qunit/accordion" /></li>
<li><h:commandLink
value="accordionHeaders" action="qunit/accordionHeaders"
/></li>
</ul>
</li>
+ <li>
+ <p>Bugs</p>
+ <ul>
+ <li><h:commandLink value="RF-9364"
action="RF-9364" /></li>
+ </ul>
+ </li>
</ul>
<p>Collapsible Panel</p>
Modified:
trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/TogglePanel.js
===================================================================
---
trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/TogglePanel.js 2010-11-02
18:58:49 UTC (rev 19900)
+++
trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/TogglePanel.js 2010-11-02
19:20:52 UTC (rev 19901)
@@ -120,7 +120,7 @@
* @private
* */
__getParentForm : function () {
- return $(rf.getDomElement(this.comp.id)).parent('form');
+ return $(rf.getDomElement(this.comp.id)).parents('form:first');
},
/**