Author: steveh
Date: Tue Apr 19 15:49:30 2005
New Revision: 161988
URL: http://svn.apache.org/viewcvs?view=rev&rev=161988
Log:
Adding popup window sample.
Added:
incubator/beehive/trunk/samples/netui-samples/ui/popup/
incubator/beehive/trunk/samples/netui-samples/ui/popup/Controller.jpf
(with props)
incubator/beehive/trunk/samples/netui-samples/ui/popup/error.jsp (with
props)
incubator/beehive/trunk/samples/netui-samples/ui/popup/getColorPopup/
incubator/beehive/trunk/samples/netui-samples/ui/popup/getColorPopup/GetColorController.jpf
(with props)
incubator/beehive/trunk/samples/netui-samples/ui/popup/getColorPopup/error.jsp
(with props)
incubator/beehive/trunk/samples/netui-samples/ui/popup/getColorPopup/index.jsp
(with props)
incubator/beehive/trunk/samples/netui-samples/ui/popup/index.jsp (with
props)
incubator/beehive/trunk/samples/netui-samples/ui/popup/show.jsp (with
props)
Modified:
incubator/beehive/trunk/samples/netui-samples/index.jsp
Modified: incubator/beehive/trunk/samples/netui-samples/index.jsp
URL:
http://svn.apache.org/viewcvs/incubator/beehive/trunk/samples/netui-samples/index.jsp?view=diff&r1=161987&r2=161988
==============================================================================
--- incubator/beehive/trunk/samples/netui-samples/index.jsp (original)
+++ incubator/beehive/trunk/samples/netui-samples/index.jsp Tue Apr 19 15:49:30
2005
@@ -21,5 +21,9 @@
<dt><a href="ui/tree/Controller.jpf">tree</a></dt>
<dd>Demonstrates how to use &netui:tree> and related tags.</dd>
</dl>
+ <dl>
+ <dt><a href="ui/popup/Controller.jpf">popup window</a></dt>
+ <dd>Demonstrates popup window implemented by a nested page flow.</dd>
+ </dl>
</netui-template:section>
</netui-template:template>
Added: incubator/beehive/trunk/samples/netui-samples/ui/popup/Controller.jpf
URL:
http://svn.apache.org/viewcvs/incubator/beehive/trunk/samples/netui-samples/ui/popup/Controller.jpf?view=auto&rev=161988
==============================================================================
--- incubator/beehive/trunk/samples/netui-samples/ui/popup/Controller.jpf
(added)
+++ incubator/beehive/trunk/samples/netui-samples/ui/popup/Controller.jpf Tue
Apr 19 15:49:30 2005
@@ -0,0 +1,109 @@
+/*
+ * Copyright 2004 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.
+ *
+ * $Header:$
+ */
+package ui.popup;
+
+import javax.servlet.http.HttpSession;
+
+import org.apache.beehive.netui.pageflow.Forward;
+import org.apache.beehive.netui.pageflow.PageFlowController;
+import org.apache.beehive.netui.pageflow.annotations.Jpf;
+
+import ui.popup.getColorPopup.GetColorController;
+
[EMAIL PROTECTED](
+ simpleActions={
+ @Jpf.SimpleAction(name="begin", path="index.jsp"),
+ @Jpf.SimpleAction(name="getColor", path="getColorPopup/index.jsp")
+ },
+ sharedFlowRefs={
+ @Jpf.SharedFlowRef(name="shared", type=shared.SharedFlow.class)
+ }
+)
+public class Controller
+ extends PageFlowController
+{
+ @Jpf.SharedFlowField(name="shared")
+ private shared.SharedFlow sharedFlow;
+
+ @Jpf.Action()
+ public Forward gotColor(GetColorController.ColorForm colorForm)
+ {
+ return new Forward("_auto");
+ }
+
+ @Jpf.Action(
+ forwards={
+ @Jpf.Forward( name="success", path="show.jsp" )
+ }
+ )
+ public Forward submit(SubmitForm form)
+ {
+ Forward forward = new Forward("success");
+ forward.addActionOutput("form", form);
+ return forward;
+ }
+
+
+ public static class SubmitForm
+ {
+ private String _name;
+ private String _address;
+ private String _city;
+ private String _color;
+
+ public String getName()
+ {
+ return _name;
+ }
+
+ public void setName(String value)
+ {
+ _name = value;
+ }
+
+ public String getAddress()
+ {
+ return _address;
+ }
+
+ public void setAddress( String address )
+ {
+ _address = address;
+ }
+
+ public String getCity()
+ {
+ return _city;
+ }
+
+ public void setCity( String city )
+ {
+ _city = city;
+ }
+
+ public String getColor()
+ {
+ return _color;
+ }
+
+ public void setColor( String color )
+ {
+ _color = color;
+ }
+ }
+}
Propchange:
incubator/beehive/trunk/samples/netui-samples/ui/popup/Controller.jpf
------------------------------------------------------------------------------
svn:eol-style = native
Added: incubator/beehive/trunk/samples/netui-samples/ui/popup/error.jsp
URL:
http://svn.apache.org/viewcvs/incubator/beehive/trunk/samples/netui-samples/ui/popup/error.jsp?view=auto&rev=161988
==============================================================================
--- incubator/beehive/trunk/samples/netui-samples/ui/popup/error.jsp (added)
+++ incubator/beehive/trunk/samples/netui-samples/ui/popup/error.jsp Tue Apr 19
15:49:30 2005
@@ -0,0 +1,69 @@
+<%@ page language="java" contentType="text/html;charset=UTF-8"%>
+<%@ taglib uri="http://beehive.apache.org/netui/tags-html-1.0" prefix="netui"%>
+<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
+<netui:html>
+ <head>
+ <title>NetUI Error</title>
+ <style>
+ table {
+ border: solid 1pt #90180F;
+ background-color: #ffffff;
+ }
+ body {
+ margin: 20pt 5%;
+ background-color: #fdf4b6;
+ font-family: Arial, Helvetica, sans-serif;
+ font-size: 10pt;
+ }
+ .caption {
+ font-weight: bold;
+ font-size: 20pt;
+ text-align: left;
+ width: 500px
+ }
+ th {vertical-align: top;
+ text-align: right;
+ font-size: 12pt;
+ color: #90180F;
+ width: 100px;
+ }
+ td {
+ text-align: left;
+ }
+ hr {
+ color: #90180F;
+ }
+ .posTitle {
+ position: relative;
+ color: #6C0C06;
+ left: -160pt;
+ top: -12pt;
+ }
+ .pfErrorLineOne {
+ color: red;
+ font-size: 12pt;
+ font-style: italic;
+ }
+ img {
+ border: solid 2pt #90180F;
+ }
+ </style>
+ <netui:base/>
+ </head>
+ <netui:body>
+ <div class="caption">
+ <netui:image
src="${pageContext.request.contextPath}/resources/beehive/version1/images/error-header.jpg"
width="338" height="96" alt="Page Flow Error"/>
+ <span class="posTitle">NetUI Error</span>
+ </div>
+ <table border="0" cellspacing='0' cellpadding='4'>
+ <c:if test="${request.errorMessage != null}">
+ <tr><th>Message:</th><td class="pfErrorLineOne"><netui:label
value="${request.errorMessage}" defaultValue=" "/></td></tr>
+ </c:if>
+ <tr><th>Exception:</th><td class="pfErrorLineOne"><netui:exceptions
showMessage="true"/></td></tr>
+ <tr><td colspan="2" style="min-width:342"><hr></td></tr>
+ <tr><th>Stack Trace:</th><td><netui:exceptions showMessage="false"
showDevModeStackTrace="true"/></td></tr>
+ </table>
+ </netui:body>
+</netui:html>
+<%-- Some browsers will not display this page unless the response status code
is 200. --%>
+<% response.setStatus(200); %>
Propchange: incubator/beehive/trunk/samples/netui-samples/ui/popup/error.jsp
------------------------------------------------------------------------------
svn:eol-style = native
Added:
incubator/beehive/trunk/samples/netui-samples/ui/popup/getColorPopup/GetColorController.jpf
URL:
http://svn.apache.org/viewcvs/incubator/beehive/trunk/samples/netui-samples/ui/popup/getColorPopup/GetColorController.jpf?view=auto&rev=161988
==============================================================================
---
incubator/beehive/trunk/samples/netui-samples/ui/popup/getColorPopup/GetColorController.jpf
(added)
+++
incubator/beehive/trunk/samples/netui-samples/ui/popup/getColorPopup/GetColorController.jpf
Tue Apr 19 15:49:30 2005
@@ -0,0 +1,67 @@
+/*
+ * Copyright 2004 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.
+ *
+ * $Header:$
+ */
+package ui.popup.getColorPopup;
+
+import javax.servlet.http.HttpSession;
+
+import org.apache.beehive.netui.pageflow.Forward;
+import org.apache.beehive.netui.pageflow.PageFlowController;
+import org.apache.beehive.netui.pageflow.annotations.Jpf;
+
[EMAIL PROTECTED](
+ nested=true,
+ simpleActions={
+ @Jpf.SimpleAction(name="begin", path="index.jsp")
+ },
+ sharedFlowRefs={
+ @Jpf.SharedFlowRef(name="shared", type=shared.SharedFlow.class)
+ }
+)
+public class GetColorController extends PageFlowController
+{
+ @Jpf.SharedFlowField(name="shared")
+ private shared.SharedFlow sharedFlow;
+
+ @Jpf.Action(
+ forwards={
+ @Jpf.Forward(name="success",
+ returnAction="gotColor",
+ outputFormBeanType=ColorForm.class
+ )
+ }
+ )
+ public Forward done( ColorForm returnForm )
+ {
+ return new Forward("success", returnForm);
+ }
+
+ public static class ColorForm
+ {
+ private String _color;
+
+ public String getColor()
+ {
+ return _color;
+ }
+
+ public void setColor(String value)
+ {
+ _color = value;
+ }
+ }
+}
Propchange:
incubator/beehive/trunk/samples/netui-samples/ui/popup/getColorPopup/GetColorController.jpf
------------------------------------------------------------------------------
svn:eol-style = native
Added:
incubator/beehive/trunk/samples/netui-samples/ui/popup/getColorPopup/error.jsp
URL:
http://svn.apache.org/viewcvs/incubator/beehive/trunk/samples/netui-samples/ui/popup/getColorPopup/error.jsp?view=auto&rev=161988
==============================================================================
---
incubator/beehive/trunk/samples/netui-samples/ui/popup/getColorPopup/error.jsp
(added)
+++
incubator/beehive/trunk/samples/netui-samples/ui/popup/getColorPopup/error.jsp
Tue Apr 19 15:49:30 2005
@@ -0,0 +1,69 @@
+<%@ page language="java" contentType="text/html;charset=UTF-8"%>
+<%@ taglib uri="http://beehive.apache.org/netui/tags-html-1.0" prefix="netui"%>
+<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
+<netui:html>
+ <head>
+ <title>NetUI Error</title>
+ <style>
+ table {
+ border: solid 1pt #90180F;
+ background-color: #ffffff;
+ }
+ body {
+ margin: 20pt 5%;
+ background-color: #fdf4b6;
+ font-family: Arial, Helvetica, sans-serif;
+ font-size: 10pt;
+ }
+ .caption {
+ font-weight: bold;
+ font-size: 20pt;
+ text-align: left;
+ width: 500px
+ }
+ th {vertical-align: top;
+ text-align: right;
+ font-size: 12pt;
+ color: #90180F;
+ width: 100px;
+ }
+ td {
+ text-align: left;
+ }
+ hr {
+ color: #90180F;
+ }
+ .posTitle {
+ position: relative;
+ color: #6C0C06;
+ left: -160pt;
+ top: -12pt;
+ }
+ .pfErrorLineOne {
+ color: red;
+ font-size: 12pt;
+ font-style: italic;
+ }
+ img {
+ border: solid 2pt #90180F;
+ }
+ </style>
+ <netui:base/>
+ </head>
+ <netui:body>
+ <div class="caption">
+ <netui:image
src="${pageContext.request.contextPath}/resources/beehive/version1/images/error-header.jpg"
width="338" height="96" alt="Page Flow Error"/>
+ <span class="posTitle">NetUI Error</span>
+ </div>
+ <table border="0" cellspacing='0' cellpadding='4'>
+ <c:if test="${request.errorMessage != null}">
+ <tr><th>Message:</th><td class="pfErrorLineOne"><netui:label
value="${request.errorMessage}" defaultValue=" "/></td></tr>
+ </c:if>
+ <tr><th>Exception:</th><td class="pfErrorLineOne"><netui:exceptions
showMessage="true"/></td></tr>
+ <tr><td colspan="2" style="min-width:342"><hr></td></tr>
+ <tr><th>Stack Trace:</th><td><netui:exceptions showMessage="false"
showDevModeStackTrace="true"/></td></tr>
+ </table>
+ </netui:body>
+</netui:html>
+<%-- Some browsers will not display this page unless the response status code
is 200. --%>
+<% response.setStatus(200); %>
Propchange:
incubator/beehive/trunk/samples/netui-samples/ui/popup/getColorPopup/error.jsp
------------------------------------------------------------------------------
svn:eol-style = native
Added:
incubator/beehive/trunk/samples/netui-samples/ui/popup/getColorPopup/index.jsp
URL:
http://svn.apache.org/viewcvs/incubator/beehive/trunk/samples/netui-samples/ui/popup/getColorPopup/index.jsp?view=auto&rev=161988
==============================================================================
---
incubator/beehive/trunk/samples/netui-samples/ui/popup/getColorPopup/index.jsp
(added)
+++
incubator/beehive/trunk/samples/netui-samples/ui/popup/getColorPopup/index.jsp
Tue Apr 19 15:49:30 2005
@@ -0,0 +1,24 @@
+<%@ page language="java" contentType="text/html;charset=UTF-8"%>
+<%@ taglib uri="http://beehive.apache.org/netui/tags-databinding-1.0"
prefix="netui-data"%>
+<%@ taglib uri="http://beehive.apache.org/netui/tags-html-1.0" prefix="netui"%>
+<%@ taglib uri="http://beehive.apache.org/netui/tags-template-1.0"
prefix="netui-template"%>
+<netui:html>
+ <head>
+ <title>Web Application Page</title>
+ <netui:base/>
+ </head>
+ <netui:body>
+ <netui:form action="done">
+ Color:<br/>
+ <netui:select dataSource="actionForm.color" size="5">
+ <netui:selectOption value="red" />
+ <netui:selectOption value="blue" />
+ <netui:selectOption value="green" />
+ <netui:selectOption value="yellow" />
+ <netui:selectOption value="orange" />
+ </netui:select>
+ <br/>
+ <netui:button type="submit" value="submit"/>
+ </netui:form>
+ </netui:body>
+</netui:html>
Propchange:
incubator/beehive/trunk/samples/netui-samples/ui/popup/getColorPopup/index.jsp
------------------------------------------------------------------------------
svn:eol-style = native
Added: incubator/beehive/trunk/samples/netui-samples/ui/popup/index.jsp
URL:
http://svn.apache.org/viewcvs/incubator/beehive/trunk/samples/netui-samples/ui/popup/index.jsp?view=auto&rev=161988
==============================================================================
--- incubator/beehive/trunk/samples/netui-samples/ui/popup/index.jsp (added)
+++ incubator/beehive/trunk/samples/netui-samples/ui/popup/index.jsp Tue Apr 19
15:49:30 2005
@@ -0,0 +1,24 @@
+<%@ page language="java" contentType="text/html;charset=UTF-8"%>
+<%@ taglib uri="http://beehive.apache.org/netui/tags-databinding-1.0"
prefix="netui-data"%>
+<%@ taglib uri="http://beehive.apache.org/netui/tags-html-1.0" prefix="netui"%>
+<%@ taglib uri="http://beehive.apache.org/netui/tags-template-1.0"
prefix="netui-template"%>
+
+<netui-template:template templatePage="/resources/template/template.jsp">
+ <netui-template:setAttribute name="samTitle" value="Popup Windows"/>
+ <netui-template:section name="main">
+ <netui:form action="submit">
+ <table>
+ <tr><td>Name:</td><td><netui:textBox
dataSource="actionForm.name"/></td></tr>
+ <tr><td>Address:</td><td><netui:textBox
dataSource="actionForm.address"/></td></tr>
+ <tr><td>City:</td><td><netui:textBox
dataSource="actionForm.city"/></td></tr>
+ <tr><td>Favorite Color:</td><td><netui:textBox
dataSource="actionForm.color" tagId="colorField"/>
+ <netui:button type="submit" value="Go to the Color Picker"
action="getColor" popup="true">
+ <netui:configurePopup location="false" width="550" height="150">
+ <netui:retrievePopupOutput dataSource="outputFormBean.color"
tagIdRef="colorField"/>
+ </netui:configurePopup>
+ </netui:button></td></tr>
+ </table>
+ <netui:button type="submit" value="Submit" action="submit"/>
+ </netui:form>
+ </netui-template:section>
+</netui-template:template>
Propchange: incubator/beehive/trunk/samples/netui-samples/ui/popup/index.jsp
------------------------------------------------------------------------------
svn:eol-style = native
Added: incubator/beehive/trunk/samples/netui-samples/ui/popup/show.jsp
URL:
http://svn.apache.org/viewcvs/incubator/beehive/trunk/samples/netui-samples/ui/popup/show.jsp?view=auto&rev=161988
==============================================================================
--- incubator/beehive/trunk/samples/netui-samples/ui/popup/show.jsp (added)
+++ incubator/beehive/trunk/samples/netui-samples/ui/popup/show.jsp Tue Apr 19
15:49:30 2005
@@ -0,0 +1,15 @@
+<%@ page language="java" contentType="text/html;charset=UTF-8"%>
+<%@ taglib uri="http://beehive.apache.org/netui/tags-databinding-1.0"
prefix="netui-data"%>
+<%@ taglib uri="http://beehive.apache.org/netui/tags-html-1.0" prefix="netui"%>
+<%@ taglib uri="http://beehive.apache.org/netui/tags-template-1.0"
prefix="netui-template"%>
+
+<netui-template:template templatePage="/resources/template/template.jsp">
+ <netui-template:setAttribute name="samTitle" value="Popup Windows"/>
+ <netui-template:section name="main">
+ <h3>You submitted the following information:</h3>
+ Name: <netui:span value="${pageInput.form.name}"/><br/>
+ Address: <netui:span value="${pageInput.form.address}"/><br/>
+ City: <netui:span value="${pageInput.form.city}"/><br/>
+ Favorite Color: <netui:span value="${pageInput.form.color}"/>
+ </netui-template:section>
+</netui-template:template>
Propchange: incubator/beehive/trunk/samples/netui-samples/ui/popup/show.jsp
------------------------------------------------------------------------------
svn:eol-style = native