You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by st...@apache.org on 2010/12/18 00:57:12 UTC
svn commit: r1050536 - in /myfaces/current20/test-webapp/webapp/src/main:
java/org/apache/myfaces/viewparam/ webapp/
Author: struberg
Date: Fri Dec 17 23:57:12 2010
New Revision: 1050536
URL: http://svn.apache.org/viewvc?rev=1050536&view=rev
Log:
MYFACES-3002 with ui:composition the viewParams are still gone...
Added:
myfaces/current20/test-webapp/webapp/src/main/java/org/apache/myfaces/viewparam/RequestViewParamBean2.java
myfaces/current20/test-webapp/webapp/src/main/webapp/viewparamLayout.xhtml
Modified:
myfaces/current20/test-webapp/webapp/src/main/java/org/apache/myfaces/viewparam/RequestViewParamBean.java
myfaces/current20/test-webapp/webapp/src/main/webapp/viewparam.xhtml
myfaces/current20/test-webapp/webapp/src/main/webapp/viewparam2.xhtml
Modified: myfaces/current20/test-webapp/webapp/src/main/java/org/apache/myfaces/viewparam/RequestViewParamBean.java
URL: http://svn.apache.org/viewvc/myfaces/current20/test-webapp/webapp/src/main/java/org/apache/myfaces/viewparam/RequestViewParamBean.java?rev=1050536&r1=1050535&r2=1050536&view=diff
==============================================================================
--- myfaces/current20/test-webapp/webapp/src/main/java/org/apache/myfaces/viewparam/RequestViewParamBean.java (original)
+++ myfaces/current20/test-webapp/webapp/src/main/java/org/apache/myfaces/viewparam/RequestViewParamBean.java Fri Dec 17 23:57:12 2010
@@ -19,7 +19,7 @@
package org.apache.myfaces.viewparam;
import javax.faces.bean.ManagedBean;
-import javax.faces.bean.RequestScoped;
+import javax.faces.bean.ViewScoped;
import java.io.Serializable;
/**
@@ -28,7 +28,7 @@ import java.io.Serializable;
* @author Jakob Korherr
*/
@ManagedBean
-@RequestScoped
+@ViewScoped
public class RequestViewParamBean implements Serializable
{
Added: myfaces/current20/test-webapp/webapp/src/main/java/org/apache/myfaces/viewparam/RequestViewParamBean2.java
URL: http://svn.apache.org/viewvc/myfaces/current20/test-webapp/webapp/src/main/java/org/apache/myfaces/viewparam/RequestViewParamBean2.java?rev=1050536&view=auto
==============================================================================
--- myfaces/current20/test-webapp/webapp/src/main/java/org/apache/myfaces/viewparam/RequestViewParamBean2.java (added)
+++ myfaces/current20/test-webapp/webapp/src/main/java/org/apache/myfaces/viewparam/RequestViewParamBean2.java Fri Dec 17 23:57:12 2010
@@ -0,0 +1,57 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.myfaces.viewparam;
+
+import javax.faces.bean.ManagedBean;
+import javax.faces.bean.ViewScoped;
+import java.io.Serializable;
+
+/**
+ * Managed bean for viewparam.xhtml
+ *
+ * @author Mark Struberg
+ */
+@ManagedBean
+@ViewScoped
+public class RequestViewParamBean2 implements Serializable
+{
+
+ private String input;
+
+ public String getInput()
+ {
+ return input;
+ }
+
+ public void setInput(String input)
+ {
+ this.input = input;
+ }
+
+ public void doSomething()
+ {
+ System.out.println("Doing something...");
+ }
+
+ public String doRedirectBack()
+ {
+ return "viewparam.xhtml?faces-redirect=true&includeViewParams=true";
+ }
+
+}
Modified: myfaces/current20/test-webapp/webapp/src/main/webapp/viewparam.xhtml
URL: http://svn.apache.org/viewvc/myfaces/current20/test-webapp/webapp/src/main/webapp/viewparam.xhtml?rev=1050536&r1=1050535&r2=1050536&view=diff
==============================================================================
--- myfaces/current20/test-webapp/webapp/src/main/webapp/viewparam.xhtml (original)
+++ myfaces/current20/test-webapp/webapp/src/main/webapp/viewparam.xhtml Fri Dec 17 23:57:12 2010
@@ -22,16 +22,20 @@
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 template="viewparamLayout.xhtml">
-<f:metadata>
- <f:viewParam name="input" value="#{requestViewParamBean.input}" />
- <f:event type="preRenderView" listener="#{requestViewParamBean.doSomething}"/>
-</f:metadata>
+<ui:define name="metadata">
+ <f:metadata>
+ <f:viewParam name="input" value="#{requestViewParamBean.input}" />
+ <f:event type="preRenderView" listener="#{requestViewParamBean.doSomething}"/>
+ </f:metadata>
+</ui:define>
-<h:head>
+<ui:define name="title">
<title>f:viewParam example for MYFACES-3002</title>
-</h:head>
-<h:body>
+</ui:define>
+
+<ui:define name="content">
<h1>f:viewParam example for MYFACES-3002</h1>
<p>
@@ -54,11 +58,12 @@
<h:commandButton value="Postback Redirect to Page 2 with f:param"
action="#{requestViewParamBean.doRedirectPage2}">
- <f:param name="input" value="fparamvalue" />
+ <f:param name="input" value="hasiputz" />
</h:commandButton>
</h:form>
<ui:debug />
-</h:body>
+</ui:define>
+</ui:composition>
</html>
Modified: myfaces/current20/test-webapp/webapp/src/main/webapp/viewparam2.xhtml
URL: http://svn.apache.org/viewvc/myfaces/current20/test-webapp/webapp/src/main/webapp/viewparam2.xhtml?rev=1050536&r1=1050535&r2=1050536&view=diff
==============================================================================
--- myfaces/current20/test-webapp/webapp/src/main/webapp/viewparam2.xhtml (original)
+++ myfaces/current20/test-webapp/webapp/src/main/webapp/viewparam2.xhtml Fri Dec 17 23:57:12 2010
@@ -24,7 +24,7 @@
xmlns:ui="http://java.sun.com/jsf/facelets">
<f:metadata>
- <f:viewParam name="input" value="#{requestViewParamBean.input}" />
+ <f:viewParam name="input" value="#{requestViewParamBean2.input}" />
</f:metadata>
<h:head>
@@ -40,12 +40,14 @@
<h:form>
<h:messages id="messages" />
- <h:outputText id="output" value="Viewparam: input=#{requestViewParamBean.input}" />
+ <h:outputText id="output" value="Viewparam: input=#{requestViewParamBean2.input}" />
<br />
<br />
<h:commandButton value="Postback" />
+ <h:commandButton value="back action" action="#{requestViewParamBean2.doRedirectBack}" />
+
<h:button value="back" outcome="viewparam.xhtml?input=abc" />
</h:form>
Added: myfaces/current20/test-webapp/webapp/src/main/webapp/viewparamLayout.xhtml
URL: http://svn.apache.org/viewvc/myfaces/current20/test-webapp/webapp/src/main/webapp/viewparamLayout.xhtml?rev=1050536&view=auto
==============================================================================
--- myfaces/current20/test-webapp/webapp/src/main/webapp/viewparamLayout.xhtml (added)
+++ myfaces/current20/test-webapp/webapp/src/main/webapp/viewparamLayout.xhtml Fri Dec 17 23:57:12 2010
@@ -0,0 +1,35 @@
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+ *
+ http://www.apache.org/licenses/LICENSE-2.0
+ *
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+-->
+<!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">
+
+<h:head>
+ <ui:insert name="title"/>
+</h:head>
+<h:body>
+ <f:view>
+ <ui:insert name="metadata"/>
+ <ui:insert name="content"/>
+ </f:view>
+</h:body>
+</html>