Commits

Anonymous committed 6113251

- added example in showcase to simulate these issue (WW-1295 and WW-1325)

Issue number: WW-1295 WW-1325
Obtained from:
Submitted by:
Reviewed by:

git-svn-id: http://svn.opensymphony.com/svn/webwork/trunk@2655573baa09-0c28-0410-bef9-dab3c582ae83

Comments (0)

Files changed (10)

webapps/showcase/src/java/com/opensymphony/webwork/showcase/ajax/Example4ShowPanelAction.java

+package com.opensymphony.webwork.showcase.ajax;
+
+import java.text.SimpleDateFormat;
+import java.util.Date;
+
+import com.opensymphony.xwork.ActionSupport;
+
+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());
+	}
+}

webapps/showcase/src/webapp/WEB-INF/classes/xwork-ajax.xml

         <action name="Test3" class="com.opensymphony.xwork.ActionSupport">
             <result name="success">/ajax/testjs.jsp</result>
         </action>
+        
+        <action name="example4">
+        	<result type="freemarker">/ajax/tabbedpanel/example4.ftl</result>
+        </action>
+        
+    </package>
+    
+    <package name="ajaxNoDecorate" namespace="/nodecorate" extends="webwork-default">
+    	<!--  example 4 -->
+        <action name="panel1" class="com.opensymphony.webwork.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="com.opensymphony.webwork.showcase.ajax.Example4ShowPanelAction" method="panel2">
+    		<result type="freemarker">/ajax/tabbedpanel/nodecorate/panel2Submit.ftl</result>
+    	</action>
+    	<action name="panel3Submit" class="com.opensymphony.webwork.showcase.ajax.Example4ShowPanelAction" method="panel3">
+    		<result type="freemarker">/ajax/tabbedpanel/nodecorate/panel3Submit.ftl</result>
+    	</action>
     </package>
+    
 </xwork>

webapps/showcase/src/webapp/WEB-INF/decorators.xml

         <pattern>/AjaxTest.action</pattern>
         <pattern>/ajax/remoteforms/AjaxRemoteForm.action</pattern>
         <pattern>/tags/ui/ajax/*</pattern>
+        <pattern>/nodecorate/*</pattern>
     </excludes>
 
     <decorator name="main" page="main.jsp">

webapps/showcase/src/webapp/ajax/tabbedpanel/example4.ftl

+<html>
+<head>
+	<title>Example 4</title>
+	<@ww.head theme="ajax" debug="false" />
+	<link rel="stylesheet" type="text/css" href="<@ww.url value="/webwork/tabs.css"/>" />
+</head>
+<body>
+	<@ww.url id="panel1url" action="panel1" namespace="/nodecorate" includeContext="false" />
+	<@ww.url id="panel2url" action="panel2" namespace="/nodecorate" includeContext="false"/>
+	<@ww.url id="panel3url" action="panel3" namespace="/nodecorate" includeContext="false"/>
+	<@ww.tabbedPanel id="tabbedpanel" >
+		<@ww.panel id="panel1" tabName="Panel1" remote="true" href="%{#panel1url}" theme="ajax" /> 
+		<@ww.panel id="panel2" tabName="Panel2" remote="true" href="%{#panel2url}" theme="ajax"  />
+		<@ww.panel id="panel3" tabName="Panel3" remote="true" href="%{#panel3url}" theme="ajax" />
+	</@ww.tabbedPanel>
+</body>
+</html>
+

webapps/showcase/src/webapp/ajax/tabbedpanel/index.jsp

         <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>
+        	<ww:url id="url" action="example4" />
+        	<ww:a href="%{#url}">Only remove tabbed panel</ww:a>
+        </li>
     </ol>
 
 

webapps/showcase/src/webapp/ajax/tabbedpanel/nodecorate/panel1.ftl

+
+Hello, <br/>
+Today is ${todayDate}, the time now is ${todayTime}

webapps/showcase/src/webapp/ajax/tabbedpanel/nodecorate/panel2.ftl

+
+<div id="result">
+</div>
+<@ww.form action="panel2Submit" namespace="/nodecorate" theme="ajax">
+	<@ww.textfield label="Name" name="name" theme="ajax" />
+	<@ww.submit theme="ajax" resultDivId="result" />
+</@ww.form>

webapps/showcase/src/webapp/ajax/tabbedpanel/nodecorate/panel2Submit.ftl

+
+Hello, ${name}

webapps/showcase/src/webapp/ajax/tabbedpanel/nodecorate/panel3.ftl

+
+<div id="result">
+</div>
+
+<@ww.form action="panel3Submit" namespace="/nodecorate" theme="ajax">
+	<@ww.select label="Gender" name="gender" list=r"%{#{'Male':'Male','Female':'Female'}}" theme="ajax" />
+	<@ww.submit theme="ajax" resultDivId="result" />
+</@ww.form>
+

webapps/showcase/src/webapp/ajax/tabbedpanel/nodecorate/panel3Submit.ftl

+
+So, you are a ${gender}