Author: alexsmirnov
Date: 2007-06-29 19:59:08 -0400 (Fri, 29 Jun 2007)
New Revision: 1426
Added:
branches/refactor1/samples/useCases/src/main/java/org/ajax4jsf/EnclosedData.java
branches/refactor1/samples/useCases/src/main/webapp/META-INF/
branches/refactor1/samples/useCases/src/main/webapp/META-INF/MANIFEST.MF
Modified:
branches/refactor1/samples/useCases/src/main/java/org/ajax4jsf/RepeatData.java
branches/refactor1/samples/useCases/src/main/webapp/WEB-INF/faces-config.xml
branches/refactor1/samples/useCases/src/main/webapp/WEB-INF/web.xml
branches/refactor1/samples/useCases/src/main/webapp/pages/repeat.jsp
branches/refactor1/samples/useCases/src/main/webapp/pages/repeat.xhtml
branches/refactor1/ui/core/src/main/java/org/ajax4jsf/renderkit/html/RepeatRenderer.java
Log:
continue refactoring.
Added: branches/refactor1/samples/useCases/src/main/java/org/ajax4jsf/EnclosedData.java
===================================================================
--- branches/refactor1/samples/useCases/src/main/java/org/ajax4jsf/EnclosedData.java
(rev 0)
+++
branches/refactor1/samples/useCases/src/main/java/org/ajax4jsf/EnclosedData.java 2007-06-29
23:59:08 UTC (rev 1426)
@@ -0,0 +1,42 @@
+/**
+ *
+ */
+package org.ajax4jsf;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * @author asmirnov
+ *
+ */
+public class EnclosedData {
+
+ private List<RepeatData> repeatData;
+
+ public EnclosedData() {
+ repeatData = new ArrayList<RepeatData>();
+ for(int i=0;i<5;i++){
+ RepeatData data = new RepeatData();
+ data.setText("Top row "+i);
+ repeatData.add(data);
+ }
+ }
+
+ /**
+ * @return the repeatData
+ */
+ public List<RepeatData> getRepeatData() {
+ return repeatData;
+ }
+
+ /**
+ * @param repeatData the repeatData to set
+ */
+ public void setRepeatData(List<RepeatData> repeatData) {
+ this.repeatData = repeatData;
+ }
+
+
+
+}
Modified: branches/refactor1/samples/useCases/src/main/java/org/ajax4jsf/RepeatData.java
===================================================================
---
branches/refactor1/samples/useCases/src/main/java/org/ajax4jsf/RepeatData.java 2007-06-29
22:14:47 UTC (rev 1425)
+++
branches/refactor1/samples/useCases/src/main/java/org/ajax4jsf/RepeatData.java 2007-06-29
23:59:08 UTC (rev 1426)
@@ -14,7 +14,23 @@
private List data;
- public RepeatData() {
+ private String text;
+
+ /**
+ * @return the text
+ */
+ public String getText() {
+ return text;
+ }
+
+ /**
+ * @param text the text to set
+ */
+ public void setText(String text) {
+ this.text = text;
+ }
+
+ public RepeatData() {
data = new ArrayList(10);
for(int i=0;i<10;i++){
Bean bean = new Bean();
Added: branches/refactor1/samples/useCases/src/main/webapp/META-INF/MANIFEST.MF
===================================================================
--- branches/refactor1/samples/useCases/src/main/webapp/META-INF/MANIFEST.MF
(rev 0)
+++ branches/refactor1/samples/useCases/src/main/webapp/META-INF/MANIFEST.MF 2007-06-29
23:59:08 UTC (rev 1426)
@@ -0,0 +1,2 @@
+Manifest-Version: 1.0
+
Modified: branches/refactor1/samples/useCases/src/main/webapp/WEB-INF/faces-config.xml
===================================================================
---
branches/refactor1/samples/useCases/src/main/webapp/WEB-INF/faces-config.xml 2007-06-29
22:14:47 UTC (rev 1425)
+++
branches/refactor1/samples/useCases/src/main/webapp/WEB-INF/faces-config.xml 2007-06-29
23:59:08 UTC (rev 1426)
@@ -18,6 +18,11 @@
<managed-bean-scope>session</managed-bean-scope>
</managed-bean>
<managed-bean>
+ <managed-bean-name>enclosedData</managed-bean-name>
+ <managed-bean-class>org.ajax4jsf.EnclosedData</managed-bean-class>
+ <managed-bean-scope>session</managed-bean-scope>
+ </managed-bean>
+ <managed-bean>
<managed-bean-name>a4jTestBean</managed-bean-name>
<managed-bean-class>org.ajax4jsf.A4jTestBean</managed-bean-class>
<managed-bean-scope>request</managed-bean-scope>
Modified: branches/refactor1/samples/useCases/src/main/webapp/WEB-INF/web.xml
===================================================================
--- branches/refactor1/samples/useCases/src/main/webapp/WEB-INF/web.xml 2007-06-29
22:14:47 UTC (rev 1425)
+++ branches/refactor1/samples/useCases/src/main/webapp/WEB-INF/web.xml 2007-06-29
23:59:08 UTC (rev 1426)
@@ -43,19 +43,19 @@
</filter>
<filter-mapping>
<filter-name>ajax4jsf</filter-name>
- <servlet-name>Faces Servlet</servlet-name>
- <dispatcher>REQUEST</dispatcher>
- <dispatcher>FORWARD</dispatcher>
+ <servlet-name>Faces Servlet</servlet-name>
+ <dispatcher>REQUEST</dispatcher>
+ <dispatcher>FORWARD</dispatcher>
<dispatcher>INCLUDE</dispatcher>
</filter-mapping>
<servlet>
<servlet-name>Faces Servlet</servlet-name>
<servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
<load-on-startup>1</load-on-startup>
- </servlet>
- <servlet-mapping>
- <servlet-name>Faces Servlet</servlet-name>
- <url-pattern>/faces/*</url-pattern>
+ </servlet>
+ <servlet-mapping>
+ <servlet-name>Faces Servlet</servlet-name>
+ <url-pattern>/faces/*</url-pattern>
</servlet-mapping>
<login-config>
<auth-method>BASIC</auth-method>
Modified: branches/refactor1/samples/useCases/src/main/webapp/pages/repeat.jsp
===================================================================
--- branches/refactor1/samples/useCases/src/main/webapp/pages/repeat.jsp 2007-06-29
22:14:47 UTC (rev 1425)
+++ branches/refactor1/samples/useCases/src/main/webapp/pages/repeat.jsp 2007-06-29
23:59:08 UTC (rev 1426)
@@ -12,6 +12,7 @@
<h:selectBooleanCheckbox selected="true" />
<h:inputText value="Text"></h:inputText>
<h:inputText value="#{row.text}"></h:inputText>
+ <h:outputText value="#{row.text}"/>
<h:outputText escape="false" value="<br>"
></h:outputText>
</a4j:repeat>
</h:form>
Modified: branches/refactor1/samples/useCases/src/main/webapp/pages/repeat.xhtml
===================================================================
--- branches/refactor1/samples/useCases/src/main/webapp/pages/repeat.xhtml 2007-06-29
22:14:47 UTC (rev 1425)
+++ branches/refactor1/samples/useCases/src/main/webapp/pages/repeat.xhtml 2007-06-29
23:59:08 UTC (rev 1426)
@@ -1,26 +1,45 @@
<!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:a4j="http://richfaces.org/ajax"
-
xmlns:h="http://java.sun.com/jsf/html"
-
xmlns:f="http://java.sun.com/jsf/core">
- <head>
- <title>Repeater with input components</title>
- </head>
- <body>
- <f:view>
- <h:form>
+
xmlns:a4j="http://richfaces.org/ajax"
+
xmlns:h="http://java.sun.com/jsf/html"
+
xmlns:f="http://java.sun.com/jsf/core">
+<head>
+<title>Repeater with input components</title>
+</head>
+<body>
+<f:view>
+ <h:form>
<h:panelGroup id="repeat">
- <a4j:repeat value="#{repeatData.data}" var="row">
- <h:selectBooleanCheckbox selected="true" />
- <h:inputText value="Text"></h:inputText>
- <h:inputText value="#{row.text}"></h:inputText>
- <h:outputText escape="false" value="<br />"
></h:outputText>
- </a4j:repeat>
+ <a4j:repeat value="#{repeatData.data}" var="row"
id="r">
+ <h:selectBooleanCheckbox selected="true" />
+ <h:inputText value="Text"></h:inputText>
+ <h:inputText value="#{row.text}"></h:inputText>
+ <h:outputText id="text"
value="#{row.text}"></h:outputText>
+ <a4j:commandButton value="Up"
reRender="text"></a4j:commandButton>
+ <br />
+ </a4j:repeat>
</h:panelGroup>
- <h:commandButton action="#{bean.ok}"
value="Ok"></h:commandButton>
- <a4j:commandButton action="#{bean.ok}" value="Ok
ajax" reRender="repeat"></a4j:commandButton>
-
- </h:form>
- </f:view>
- </body>
-</html>
+ <h:commandButton action="#{bean.ok}"
value="Ok"></h:commandButton>
+ <a4j:commandButton action="#{bean.ok}" value="Ok ajax"
+ reRender="repeat"></a4j:commandButton>
+ <br />
+ <ol>
+ <a4j:repeat value="#{enclosedData.repeatData}" var="row"
id="r0">
+ <li><h:inputText value="#{row.text}"></h:inputText>
<h:outputText
+ id="text0" value="#{row.text}"></h:outputText>
<a4j:commandButton
+ value="Up" reRender="text0"></a4j:commandButton>
+ <ol>
+ <a4j:repeat value="#{row.data}" var="row1"
id="r1">
+ <li><h:inputText value="#{row1.text}"></h:inputText>
<h:outputText
+ id="text1" value="#{row1.text}"></h:outputText>
<a4j:commandButton
+ value="Up"
reRender="text1"></a4j:commandButton></li>
+ </a4j:repeat>
+ </ol>
+ </li>
+ </a4j:repeat>
+ </ol>
+ </h:form>
+ <a4j:log hotkey="M" />
+</f:view>
+</body>
+</html>
Modified:
branches/refactor1/ui/core/src/main/java/org/ajax4jsf/renderkit/html/RepeatRenderer.java
===================================================================
---
branches/refactor1/ui/core/src/main/java/org/ajax4jsf/renderkit/html/RepeatRenderer.java 2007-06-29
22:14:47 UTC (rev 1425)
+++
branches/refactor1/ui/core/src/main/java/org/ajax4jsf/renderkit/html/RepeatRenderer.java 2007-06-29
23:59:08 UTC (rev 1426)
@@ -29,13 +29,14 @@
import org.ajax4jsf.ajax.repeat.DataVisitor;
import org.ajax4jsf.ajax.repeat.UIRepeat;
+import org.ajax4jsf.framework.renderer.AjaxChildrenRenderer;
import org.ajax4jsf.framework.renderer.RendererBase;
/**
* @author shura
*
*/
-public class RepeatRenderer extends RendererBase {
+public class RepeatRenderer extends AjaxChildrenRenderer {
public void encodeChildren(FacesContext context, UIComponent component)
throws IOException {