Author: tmjee
Date: Sat Jul 15 22:24:08 2006
New Revision: 422376

URL: http://svn.apache.org/viewvc?rev=422376&view=rev
Log:
WW-1297
  - add example into showcase that causes bug WW-1297 to appear  


Added:
    
struts/struts2/trunk/apps/showcase/src/main/java/org/apache/struts2/showcase/ajax/Example4ShowPanelAction.java
   (with props)
    
struts/struts2/trunk/apps/showcase/src/main/webapp/ajax/tabbedpanel/example4.ftl
    
struts/struts2/trunk/apps/showcase/src/main/webapp/ajax/tabbedpanel/nodecorate/
    
struts/struts2/trunk/apps/showcase/src/main/webapp/ajax/tabbedpanel/nodecorate/panel1.ftl
    
struts/struts2/trunk/apps/showcase/src/main/webapp/ajax/tabbedpanel/nodecorate/panel2.ftl
    
struts/struts2/trunk/apps/showcase/src/main/webapp/ajax/tabbedpanel/nodecorate/panel2Submit.ftl
    
struts/struts2/trunk/apps/showcase/src/main/webapp/ajax/tabbedpanel/nodecorate/panel3.ftl
    
struts/struts2/trunk/apps/showcase/src/main/webapp/ajax/tabbedpanel/nodecorate/panel3Submit.ftl
Modified:
    struts/struts2/trunk/apps/showcase/src/main/resources/struts-ajax.xml
    struts/struts2/trunk/apps/showcase/src/main/webapp/WEB-INF/decorators.xml
    
struts/struts2/trunk/apps/showcase/src/main/webapp/ajax/tabbedpanel/index.jsp

Added: 
struts/struts2/trunk/apps/showcase/src/main/java/org/apache/struts2/showcase/ajax/Example4ShowPanelAction.java
URL: 
http://svn.apache.org/viewvc/struts/struts2/trunk/apps/showcase/src/main/java/org/apache/struts2/showcase/ajax/Example4ShowPanelAction.java?rev=422376&view=auto
==============================================================================
--- 
struts/struts2/trunk/apps/showcase/src/main/java/org/apache/struts2/showcase/ajax/Example4ShowPanelAction.java
 (added)
+++ 
struts/struts2/trunk/apps/showcase/src/main/java/org/apache/struts2/showcase/ajax/Example4ShowPanelAction.java
 Sat Jul 15 22:24:08 2006
@@ -0,0 +1,72 @@
+/*
+ * $Id: AjaxTestAction.java 420385 2006-07-10 00:57:05Z tmjee $
+ *
+ * Copyright 2006 The Apache Software Foundation.
+ *
+ * Licensed 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.struts2.showcase.ajax;
+
+import java.text.SimpleDateFormat;
+import java.util.Date;
+
+import com.opensymphony.xwork2.ActionSupport;
+
+/**
+ * @version $Date$ $Id$
+ */
+public class Example4ShowPanelAction extends ActionSupport {
+
+       private String name;
+       private String gender;
+       
+       private static final long serialVersionUID = 7751976335066456596L;
+
+       public String panel1() throws Exception {
+               return SUCCESS;
+       }
+       
+       public String panel2() throws Exception {
+               return SUCCESS;
+       }
+       
+       public String panel3() throws Exception {
+               return SUCCESS;
+       }
+
+       public String getGender() {
+               return gender;
+       }
+
+       public void setGender(String gender) {
+               this.gender = gender;
+       }
+
+       public String getName() {
+               return name;
+       }
+
+       public void setName(String name) {
+               this.name = name;
+       }
+       
+       public String getTodayDate() {
+               SimpleDateFormat sdf = new SimpleDateFormat("dd-MMMM-yyyy");
+               return sdf.format(new Date());
+       }
+       
+       public String getTodayTime() {
+               SimpleDateFormat sdf = new SimpleDateFormat("kk:mm:ss");
+               return sdf.format(new Date());
+       }
+}

Propchange: 
struts/struts2/trunk/apps/showcase/src/main/java/org/apache/struts2/showcase/ajax/Example4ShowPanelAction.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: struts/struts2/trunk/apps/showcase/src/main/resources/struts-ajax.xml
URL: 
http://svn.apache.org/viewvc/struts/struts2/trunk/apps/showcase/src/main/resources/struts-ajax.xml?rev=422376&r1=422375&r2=422376&view=diff
==============================================================================
--- struts/struts2/trunk/apps/showcase/src/main/resources/struts-ajax.xml 
(original)
+++ struts/struts2/trunk/apps/showcase/src/main/resources/struts-ajax.xml Sat 
Jul 15 22:24:08 2006
@@ -41,5 +41,29 @@
         <action name="toggle" 
class="org.apache.struts2.showcase.ajax.tree.Toggle">
             <result>/ajax/tree/toggle.jsp</result>
         </action>
+        
+        <action name="example4">
+               <result 
type="freemarker">/ajax/tabbedpanel/example4.ftl</result>
+        </action>
+        
+    </package>
+    
+    <package name="ajaxNoDecorate" namespace="/nodecorate" 
extends="struts-default">
+       <!--  example 4 -->
+        <action name="panel1" 
class="org.apache.struts2.showcase.ajax.Example4ShowPanelAction" 
method="panel1">
+               <result 
type="freemarker">/ajax/tabbedpanel/nodecorate/panel1.ftl</result>
+       </action>
+       <action name="panel2">
+               <result 
type="freemarker">/ajax/tabbedpanel/nodecorate/panel2.ftl</result>
+       </action>
+       <action name="panel3">
+               <result 
type="freemarker">/ajax/tabbedpanel/nodecorate/panel3.ftl</result>
+       </action>
+       <action name="panel2Submit" 
class="org.apache.struts2.showcase.ajax.Example4ShowPanelAction" 
method="panel2">
+               <result 
type="freemarker">/ajax/tabbedpanel/nodecorate/panel2Submit.ftl</result>
+       </action>
+       <action name="panel3Submit" 
class="org.apache.struts2.showcase.ajax.Example4ShowPanelAction" 
method="panel3">
+               <result 
type="freemarker">/ajax/tabbedpanel/nodecorate/panel3Submit.ftl</result>
+       </action>
     </package>
 </struts>

Modified: 
struts/struts2/trunk/apps/showcase/src/main/webapp/WEB-INF/decorators.xml
URL: 
http://svn.apache.org/viewvc/struts/struts2/trunk/apps/showcase/src/main/webapp/WEB-INF/decorators.xml?rev=422376&r1=422375&r2=422376&view=diff
==============================================================================
--- struts/struts2/trunk/apps/showcase/src/main/webapp/WEB-INF/decorators.xml 
(original)
+++ struts/struts2/trunk/apps/showcase/src/main/webapp/WEB-INF/decorators.xml 
Sat Jul 15 22:24:08 2006
@@ -15,6 +15,7 @@
         <pattern>/tags/ui/ajax/*</pattern>
         <pattern>/chat/ajax/*</pattern>
         <pattern>/hangman/ajax/*</pattern>
+        <pattern>/nodecorate/*</pattern>
     </excludes>
 
     <decorator name="main" page="main.jsp">

Added: 
struts/struts2/trunk/apps/showcase/src/main/webapp/ajax/tabbedpanel/example4.ftl
URL: 
http://svn.apache.org/viewvc/struts/struts2/trunk/apps/showcase/src/main/webapp/ajax/tabbedpanel/example4.ftl?rev=422376&view=auto
==============================================================================
--- 
struts/struts2/trunk/apps/showcase/src/main/webapp/ajax/tabbedpanel/example4.ftl
 (added)
+++ 
struts/struts2/trunk/apps/showcase/src/main/webapp/ajax/tabbedpanel/example4.ftl
 Sat Jul 15 22:24:08 2006
@@ -0,0 +1,18 @@
+<html>
+<head>
+       <title>Example 4</title>
+       <@saf.head theme="ajax" debug="false" />
+       <link rel="stylesheet" type="text/css" href="<@saf.url 
value="/struts/tabs.css"/>" />
+</head>
+<body>
+       <@saf.url id="panel1url" action="panel1" namespace="/nodecorate" 
includeContext="false" />
+       <@saf.url id="panel2url" action="panel2" namespace="/nodecorate" 
includeContext="false"/>
+       <@saf.url id="panel3url" action="panel3" namespace="/nodecorate" 
includeContext="false"/>
+       <@saf.tabbedPanel id="tabbedpanel" >
+               <@saf.panel id="panel1" tabName="Panel1" remote="true" 
href="%{#panel1url}" theme="ajax" /> 
+               <@saf.panel id="panel2" tabName="Panel2" remote="true" 
href="%{#panel2url}" theme="ajax"  />
+               <@saf.panel id="panel3" tabName="Panel3" remote="true" 
href="%{#panel3url}" theme="ajax" />
+       </@saf.tabbedPanel>
+</body>
+</html>
+

Modified: 
struts/struts2/trunk/apps/showcase/src/main/webapp/ajax/tabbedpanel/index.jsp
URL: 
http://svn.apache.org/viewvc/struts/struts2/trunk/apps/showcase/src/main/webapp/ajax/tabbedpanel/index.jsp?rev=422376&r1=422375&r2=422376&view=diff
==============================================================================
--- 
struts/struts2/trunk/apps/showcase/src/main/webapp/ajax/tabbedpanel/index.jsp 
(original)
+++ 
struts/struts2/trunk/apps/showcase/src/main/webapp/ajax/tabbedpanel/index.jsp 
Sat Jul 15 22:24:08 2006
@@ -14,6 +14,10 @@
         <li><a href="example2.jsp">A local tabbed panel</a></li>
         <li><a href="example3.jsp">A remote and local tabbed panel</a></li>
         <li><a href="example1.jsp">Various remote and local tabbed panels 
(with enclosed tabbed pannels)</a></li>
+        <li>
+               <saf:url id="url" action="example4" />
+               <saf:a href="%{#url}">Only remove tabbed panel</saf:a>
+        </li>
     </ol>
 
 

Added: 
struts/struts2/trunk/apps/showcase/src/main/webapp/ajax/tabbedpanel/nodecorate/panel1.ftl
URL: 
http://svn.apache.org/viewvc/struts/struts2/trunk/apps/showcase/src/main/webapp/ajax/tabbedpanel/nodecorate/panel1.ftl?rev=422376&view=auto
==============================================================================
--- 
struts/struts2/trunk/apps/showcase/src/main/webapp/ajax/tabbedpanel/nodecorate/panel1.ftl
 (added)
+++ 
struts/struts2/trunk/apps/showcase/src/main/webapp/ajax/tabbedpanel/nodecorate/panel1.ftl
 Sat Jul 15 22:24:08 2006
@@ -0,0 +1,3 @@
+
+Hello, <br/>
+Today is ${todayDate}, the time now is ${todayTime}

Added: 
struts/struts2/trunk/apps/showcase/src/main/webapp/ajax/tabbedpanel/nodecorate/panel2.ftl
URL: 
http://svn.apache.org/viewvc/struts/struts2/trunk/apps/showcase/src/main/webapp/ajax/tabbedpanel/nodecorate/panel2.ftl?rev=422376&view=auto
==============================================================================
--- 
struts/struts2/trunk/apps/showcase/src/main/webapp/ajax/tabbedpanel/nodecorate/panel2.ftl
 (added)
+++ 
struts/struts2/trunk/apps/showcase/src/main/webapp/ajax/tabbedpanel/nodecorate/panel2.ftl
 Sat Jul 15 22:24:08 2006
@@ -0,0 +1,7 @@
+
+<div id="result">
+</div>
+<@saf.form action="panel2Submit" namespace="/nodecorate" theme="ajax">
+       <@saf.textfield label="Name" name="name" theme="ajax" />
+       <@saf.submit theme="ajax" resultDivId="result" />
+</@saf.form>

Added: 
struts/struts2/trunk/apps/showcase/src/main/webapp/ajax/tabbedpanel/nodecorate/panel2Submit.ftl
URL: 
http://svn.apache.org/viewvc/struts/struts2/trunk/apps/showcase/src/main/webapp/ajax/tabbedpanel/nodecorate/panel2Submit.ftl?rev=422376&view=auto
==============================================================================
--- 
struts/struts2/trunk/apps/showcase/src/main/webapp/ajax/tabbedpanel/nodecorate/panel2Submit.ftl
 (added)
+++ 
struts/struts2/trunk/apps/showcase/src/main/webapp/ajax/tabbedpanel/nodecorate/panel2Submit.ftl
 Sat Jul 15 22:24:08 2006
@@ -0,0 +1,2 @@
+
+Hello, ${name}

Added: 
struts/struts2/trunk/apps/showcase/src/main/webapp/ajax/tabbedpanel/nodecorate/panel3.ftl
URL: 
http://svn.apache.org/viewvc/struts/struts2/trunk/apps/showcase/src/main/webapp/ajax/tabbedpanel/nodecorate/panel3.ftl?rev=422376&view=auto
==============================================================================
--- 
struts/struts2/trunk/apps/showcase/src/main/webapp/ajax/tabbedpanel/nodecorate/panel3.ftl
 (added)
+++ 
struts/struts2/trunk/apps/showcase/src/main/webapp/ajax/tabbedpanel/nodecorate/panel3.ftl
 Sat Jul 15 22:24:08 2006
@@ -0,0 +1,9 @@
+
+<div id="result">
+</div>
+
+<@saf.form action="panel3Submit" namespace="/nodecorate" theme="ajax">
+       <@saf.select label="Gender" name="gender" 
list=r"%{#{'Male':'Male','Female':'Female'}}" theme="ajax" />
+       <@saf.submit theme="ajax" resultDivId="result" />
+</@saf.form>
+

Added: 
struts/struts2/trunk/apps/showcase/src/main/webapp/ajax/tabbedpanel/nodecorate/panel3Submit.ftl
URL: 
http://svn.apache.org/viewvc/struts/struts2/trunk/apps/showcase/src/main/webapp/ajax/tabbedpanel/nodecorate/panel3Submit.ftl?rev=422376&view=auto
==============================================================================
--- 
struts/struts2/trunk/apps/showcase/src/main/webapp/ajax/tabbedpanel/nodecorate/panel3Submit.ftl
 (added)
+++ 
struts/struts2/trunk/apps/showcase/src/main/webapp/ajax/tabbedpanel/nodecorate/panel3Submit.ftl
 Sat Jul 15 22:24:08 2006
@@ -0,0 +1,2 @@
+
+So, you are a ${gender}


Reply via email to