Author: rich
Date: Thu Jan 20 19:15:45 2005
New Revision: 125875
URL: http://svn.apache.org/viewcvs?view=rev&rev=125875
Log:
Support for nested page flows in popup windows.
To use the feature in its simplest form, do the following:
- Add a 'popup' attribute to the netui:anchor that will launch the nested
page flow.
<netui:anchor action="goNested" popup="true">launch nested page
flow</netui:anchor>
- In the original page flow, in the action that handles the nested page
flow's return-action, forward to a special global Forward named "_auto". This
will cause a script page to get rendered -- it will close the popup window (and
more, in the advanced cases below).
@Jpf.Action()
public Forward nestedPageFlowDone()
{
return new Forward("_auto");
}
That's all. The nested page flow will run in the popup window, and when it's
done, the popup window will close.
There are more interesting things you can do here. First, to configure the
popup window (location, size, whether it has a toolbar, whether it's resizable,
etc.), you include a netui:configurePopup tag inside the anchor:
<netui:anchor action="lookupZipCode" popup="true">
launch a nested page flow to look up a zip code
<netui:configurePopup resizable="false" width="400" height="200"/>
</netui:anchor>
Next, you want to retrieve values that were submitted to the nested page flow,
and map them into the original page dynamically. To do this, add one or more
netui:retrievePopupOutput tags inside the configurePopup tag:
zip code: <netui:textBox tagId="zipCodeField"/><br/>
another value: <netui:textBox tagId="anotherField"/><br/>
<netui:anchor action="lookupZipCode" popup="true">
launch a nested page flow to look up a zip code
<netui:configurePopup resizable="false" width="400" height="200">
<netui:retrievePopupOutput dataSource="outputFormBean.zipCode"
tagIdRef="zipCodeField"/>
<netui:retrievePopupOutput dataSource="request.anotherValue"
tagIdRef="anotherField"/>
</netui:configurePopup>
</netui:anchor>
The dataSource is simply an expression to get evaluated when the popup window
closes, and tagIdRef is the tagId of the field to update. Note that
'outputFormBean' is a special binding context that applies in this situation.
It is the "return value" of the nested page flow: it receives the value
generated by the 'outputFormBean' (or 'outputFormBeanType') in the returnAction
forward from the nested page flow. In this case, the nested page flow had the
following as its return action:
@Jpf.Action(
forwards={
@Jpf.Forward(name="success",
returnAction="nestedPageFlowGotZip", outputFormBeanType=ZipForm.class)
}
)
public Forward done()
{
getRequest().setAttribute("anotherValue", "hi there"); // just for
the purposes of the example above
ZipForm returnForm = new ZipCodeForm();
returnForm.setZipCode("12345"); // pretend we got this through
user input
return new Forward("success", new ZipForm( "12345" ));
}
The original page flow has this:
@Jpf.Action()
public Forward nestedPageFlowGotZip(ZipForm zipForm)
{
return new Forward("_auto");
}
So, 'outputFormBean.zipCode' evaluates to "12345", which is the value mapped
into the 'zipCodeField' field.
Finally, you may want to run custom JavaScript to open the popup window, or to
run when the popup window closes. Both can be configured in the configurePopup
tag:
<netui:configurePopup popupFunc="myOpenPopupFunc"
onPopupDone="myOnPopupDone"/>
The 'popupFunc' simply does whatever you want to open the popup window. The
'onPopupDone' func can do whatever it wants, but it also receives a Map of
tagIdRef->value as its argument. In the example above, the following method
would bring up two alerts: "anotherField: hi there" and "zipCodeField: 12345".
function myOnPopupDone(map)
{
for (var i in map)
{
alert(i + ": " + map[i]);
}
}
An example of this feature can be found at
netui/test/webapps/drt/coreWeb/miniTests/updateFormFromNestedPopup.
DRT/BVT: netui (WinXP)
BB: self (linux)
Added:
incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/PopupSupport.java
- copied, changed from r125730,
incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/PopupHelper.java
incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/miniTests/updateFormFromNestedPopup/
incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/miniTests/updateFormFromNestedPopup/Controller.jpf
(contents, props changed)
incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/miniTests/updateFormFromNestedPopup/getZip/
incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/miniTests/updateFormFromNestedPopup/getZip/GetZip.jpf
(contents, props changed)
incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/miniTests/updateFormFromNestedPopup/getZip/confirm.jsp
(contents, props changed)
incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/miniTests/updateFormFromNestedPopup/getZip/index.jsp
(contents, props changed)
incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/miniTests/updateFormFromNestedPopup/getZip/invalidZip.jsp
(contents, props changed)
incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/miniTests/updateFormFromNestedPopup/index.jsp
(contents, props changed)
incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/miniTests/updateFormFromNestedPopup/results.jsp
(contents, props changed)
incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/miniTests/updateFormFromNestedPopup/ttt
incubator/beehive/trunk/netui/test/webapps/drt/testRecorder/tests/UpdateFormFromNestedPopup.xml
(contents, props changed)
Removed:
incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/IPopupSupport.java
incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/PopupHelper.java
incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/internal/IIdProvider.java
Modified:
incubator/beehive/trunk/netui/src/compiler/org/apache/beehive/netui/compiler/genmodel/GenStrutsApp.java
incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/FlowController.java
incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/ForwardHandler.java
incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/PageFlowConstants.java
incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/AbstractClassicTag.java
incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/AnchorBase.java
incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/ConfigurePopup.java
incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/IHasPopupSupport.java
incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/RetrievePopupOutput.java
incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/javaScript.properties
incubator/beehive/trunk/netui/test/webapps/drt/testRecorder/config/testRecorder-tests.xml
incubator/beehive/trunk/netui/test/webapps/drt/testRecorder/tests/UpdateFormFromNested.xml
Modified:
incubator/beehive/trunk/netui/src/compiler/org/apache/beehive/netui/compiler/genmodel/GenStrutsApp.java
Url:
http://svn.apache.org/viewcvs/incubator/beehive/trunk/netui/src/compiler/org/apache/beehive/netui/compiler/genmodel/GenStrutsApp.java?view=diff&rev=125875&p1=incubator/beehive/trunk/netui/src/compiler/org/apache/beehive/netui/compiler/genmodel/GenStrutsApp.java&r1=125874&p2=incubator/beehive/trunk/netui/src/compiler/org/apache/beehive/netui/compiler/genmodel/GenStrutsApp.java&r2=125875
==============================================================================
---
incubator/beehive/trunk/netui/src/compiler/org/apache/beehive/netui/compiler/genmodel/GenStrutsApp.java
(original)
+++
incubator/beehive/trunk/netui/src/compiler/org/apache/beehive/netui/compiler/genmodel/GenStrutsApp.java
Thu Jan 20 19:15:45 2005
@@ -22,6 +22,7 @@
import org.apache.beehive.netui.compiler.model.FormBeanModel;
import org.apache.beehive.netui.compiler.model.MessageResourcesModel;
import org.apache.beehive.netui.compiler.model.ActionModel;
+import org.apache.beehive.netui.compiler.model.ForwardModel;
import org.apache.beehive.netui.compiler.CompilerUtils;
import org.apache.beehive.netui.compiler.FlowControllerInfo;
import org.apache.beehive.netui.compiler.MergedControllerAnnotation;
@@ -101,6 +102,13 @@
addSimpleActions( mca.getSimpleActions() );
setMultipartHandler( mca.getMultipartHandler() );
GenForwardModel.addForwards( mca.getForwards(), this, _jclass,
this, null );
+
+ // TODO: this is a *temporary* workaround for
http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=5090006.
+ // When this bug is fixed, we can uncomment the @Jpf.Controller
annotation in FlowController.java, and
+ // remove the following line:
+ addForward( new ForwardModel( "_auto", "", this ) );
+
+
GenExceptionModel.addCatches( mca.getCatches(), this, _jclass,
this, this );
addTilesDefinitionsConfigs( mca.getTilesDefinitionsConfigs() );
Modified:
incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/FlowController.java
Url:
http://svn.apache.org/viewcvs/incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/FlowController.java?view=diff&rev=125875&p1=incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/FlowController.java&r1=125874&p2=incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/FlowController.java&r2=125875
==============================================================================
---
incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/FlowController.java
(original)
+++
incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/FlowController.java
Thu Jan 20 19:15:45 2005
@@ -67,11 +67,15 @@
/**
* Base class for user-written flow controllers - [EMAIL PROTECTED]
PageFlowController}s and [EMAIL PROTECTED] SharedFlowController}s.
*/
+/*
+ * TODO: this annotation can't be enabled until we move onto JDK1.5.0_01,
which fixes
+ * http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=5090006
@Jpf.Controller(
forwards={
- @Jpf.Forward(name="_auto", path="")
+ @Jpf.Forward(name=PageFlowConstants.AUTO_VIEW_RENDER_FORWARD_NAME,
path="")
}
)
+*/
public abstract class FlowController extends PageFlowManagedObject
implements PageFlowConstants, ActionResolver
{
Modified:
incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/ForwardHandler.java
Url:
http://svn.apache.org/viewcvs/incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/ForwardHandler.java?view=diff&rev=125875&p1=incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/ForwardHandler.java&r1=125874&p2=incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/ForwardHandler.java&r2=125875
==============================================================================
---
incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/ForwardHandler.java
(original)
+++
incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/ForwardHandler.java
Thu Jan 20 19:15:45 2005
@@ -64,7 +64,11 @@
boolean isSpecialForward = false;
boolean isReturnToCurrentPage = false;
- if ( fwd != null && "_auto".equals( fwd.getName() ) ) // TODO:
rename _auto
+ //
+ // There is a special forward ("auto"), which signals us to render
using a registered ViewRenderer.
+ // This is used as part of popup window support.
+ //
+ if ( fwd != null && AUTO_VIEW_RENDER_FORWARD_NAME.equals(
fwd.getName() ) )
{
return doAutoViewRender( mapping, request, response,
servletContext, flowController, form );
}
@@ -225,7 +229,8 @@
}
else
{
- _log.debug( "No ViewRenderer -- not doing any forward or
redirect." );
+ _log.error( "Auto-render forward " + AUTO_VIEW_RENDER_FORWARD_NAME
+ " used, but no ViewRenderer "
+ + "was registered -- not doing any forward or
redirect." );
}
return null;
Modified:
incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/PageFlowConstants.java
Url:
http://svn.apache.org/viewcvs/incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/PageFlowConstants.java?view=diff&rev=125875&p1=incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/PageFlowConstants.java&r1=125874&p2=incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/PageFlowConstants.java&r2=125875
==============================================================================
---
incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/PageFlowConstants.java
(original)
+++
incubator/beehive/trunk/netui/src/pageflow/org/apache/beehive/netui/pageflow/PageFlowConstants.java
Thu Jan 20 19:15:45 2005
@@ -100,4 +100,6 @@
* page flow compiler.
*/
public static final String JPF_MODULE_CONFIG_GEN_DIR =
InternalConstants.WEBINF_DIR + "/.pageflow-struts-generated";
+
+ public static final String AUTO_VIEW_RENDER_FORWARD_NAME = "_auto";
}
Modified:
incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/AbstractClassicTag.java
Url:
http://svn.apache.org/viewcvs/incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/AbstractClassicTag.java?view=diff&rev=125875&p1=incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/AbstractClassicTag.java&r1=125874&p2=incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/AbstractClassicTag.java&r2=125875
==============================================================================
---
incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/AbstractClassicTag.java
(original)
+++
incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/AbstractClassicTag.java
Thu Jan 20 19:15:45 2005
@@ -23,7 +23,6 @@
import org.apache.beehive.netui.tags.naming.FormDataNameInterceptor;
import org.apache.beehive.netui.tags.naming.IndexedNameInterceptor;
import org.apache.beehive.netui.tags.naming.INameInterceptor;
-import org.apache.beehive.netui.tags.internal.IIdProvider;
import org.apache.beehive.netui.util.Bundle;
import org.apache.beehive.netui.util.logging.Logger;
import org.apache.struts.Globals;
@@ -64,7 +63,7 @@
* @netui:tag
*/
public abstract class AbstractClassicTag
- extends BodyTagSupport implements INetuiTag, IIdProvider
+ extends BodyTagSupport implements INetuiTag
{
//@todo: how should we handle errors messages from third party tags?
//@todo: need to implement the flag to turn errors into JSP exceptions
@@ -484,7 +483,7 @@
* @param req the Request
* @return the next unique integer for this request.
*/
- public int getNextId(ServletRequest req)
+ protected int getNextId(ServletRequest req)
{
Integer i = (Integer) req.getAttribute(NETUI_UNIQUE_CNT);
if (i == null) {
Modified:
incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/AnchorBase.java
Url:
http://svn.apache.org/viewcvs/incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/AnchorBase.java?view=diff&rev=125875&p1=incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/AnchorBase.java&r1=125874&p2=incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/AnchorBase.java&r2=125875
==============================================================================
---
incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/AnchorBase.java
(original)
+++
incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/AnchorBase.java
Thu Jan 20 19:15:45 2005
@@ -2,12 +2,10 @@
import org.apache.beehive.netui.core.urls.MutableURI;
import org.apache.beehive.netui.pageflow.scoping.ScopedServletUtils;
-import org.apache.beehive.netui.pageflow.internal.InternalConstants;
import org.apache.beehive.netui.tags.ByRef;
import org.apache.beehive.netui.tags.HtmlUtils;
import org.apache.beehive.netui.tags.IScriptReporter;
import org.apache.beehive.netui.tags.internal.PageFlowTagUtils;
-import org.apache.beehive.netui.tags.internal.ReturnActionViewRenderer;
import org.apache.beehive.netui.tags.rendering.*;
import org.apache.beehive.netui.util.Bundle;
import org.apache.beehive.netui.util.ParamHelper;
@@ -44,7 +42,7 @@
private Map _params; // Parameters
private Form _form; // the nearest form
private boolean _formSubmit = false; // should the anchor submit an
enclosing form?
- private PopupHelper _popupHelper = null; // popup support, if the popup
attribute is set to true
+ private PopupSupport _popupSupport = null; // popup support, if the popup
attribute is set to true
/**
* Base support for the attribute tag. This is overridden to prevent
setting the <code>href</code>
@@ -193,7 +191,7 @@
*/
public void setPopup(boolean popup)
{
- _popupHelper = new PopupHelper();
+ _popupSupport = new PopupSupport();
}
@@ -387,8 +385,8 @@
addParamInternal(ScopedServletUtils.SCOPE_ID_PARAM,
_targetScope);
}
- if (_popupHelper != null) {
- _popupHelper.addParams(this, this, request);
+ if (_popupSupport != null) {
+ _popupSupport.addParams(this, request);
}
// Generate the opening anchor element
@@ -455,8 +453,8 @@
if (_form != null)
_form.insureRealId();
}
- else if (_popupHelper != null) {
- _state.onClick = _popupHelper.getOnClick(_state.href);
+ else if (_popupSupport != null) {
+ _state.onClick = _popupSupport.getOnClick(_state.href);
}
}
@@ -466,14 +464,14 @@
trb.doStartTag(writer, _state);
//Emit javascript if this anchor needs to sumbit the form
- if (_formSubmit && formAction != null || idScript != null ||
_popupHelper != null) {
+ if (_formSubmit && formAction != null || idScript != null ||
_popupSupport != null) {
StringBuilder script = new StringBuilder(32);
StringBuilderRenderAppender scriptWriter = new
StringBuilderRenderAppender(script);
if (_formSubmit && formAction != null)
jsu.writeAnchorFormSubmit(getScriptReporter(), scriptWriter);
- if (_popupHelper != null)
- _popupHelper.writeScript(jsu, getScriptReporter(),
scriptWriter);
+ if (_popupSupport != null)
+ _popupSupport.writeScript(jsu, getScriptReporter(),
scriptWriter);
if (idScript != null)
scriptWriter.append(idScript);
scriptRef.setRef(script.toString());
@@ -593,11 +591,11 @@
_params = null;
_form = null;
_formSubmit = false;
- _popupHelper = null;
+ _popupSupport = null;
}
- public IPopupSupport getPopupSupport()
+ public PopupSupport getPopupSupport()
{
- return _popupHelper;
+ return _popupSupport;
}
}
Modified:
incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/ConfigurePopup.java
Url:
http://svn.apache.org/viewcvs/incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/ConfigurePopup.java?view=diff&rev=125875&p1=incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/ConfigurePopup.java&r1=125874&p2=incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/ConfigurePopup.java&r2=125875
==============================================================================
---
incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/ConfigurePopup.java
(original)
+++
incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/ConfigurePopup.java
Thu Jan 20 19:15:45 2005
@@ -31,11 +31,11 @@
* @example
*
* <pre>
- * <netui:anchor action="getZip">
- * Look up a zip code
+ * <netui:anchor action="getCityZipFromNestedPageFlow" popup="true">
+ * Get a city and zip code
* <netui:configurePopup resizable="false" width="400" height="200">
- * Search Google with the query "Socrates"
- * <netui:retrievePopupOutput fieldId="zipCodeField"
expressionToRetrieve="outputFormBean.zipCode" />
+ * <netui:retrievePopupOutput tagIdRef="zipCodeField"
dataSource="outputFormBean.zipCode" />
+ * <netui:retrievePopupOutput tagIdRef="cityField"
dataSource="outputFormBean.city" />
* </netui:configurePopup>
* </netui:anchor></pre>
* @netui:tag name="configurePopup" description="Configures popup window
parameters for parent tags that can open popup windows."
@@ -61,6 +61,7 @@
private Integer _left = null;
private Integer _top = null;
private boolean _replace = false;
+ private String _popupFunc;
private String _onPopupDone;
/**
@@ -87,6 +88,21 @@
}
/**
+ * Sets the JavaScript function to be called to open the popup window.
This function overrides the auto-generated
+ * one that is based on the other attributes like <code>resizable</code>,
<code>name</code>, etc.
+ * @param popupFunc - the JavaScript function to be called to open the
popup window.
+ * @jsptagref.attributedescription The JavaScript function to be called to
open the popup window.
+ * @jsptagref.databindable false
+ * @jsptagref.attributesyntaxvalue <i>string_popupFunc</i>
+ * @netui:attribute required="false" rtexprvalue="true"
+ * description="The JavaScript function to be called to open the popup
window."
+ */
+ public void setPopupFunc(String popupFunc)
+ {
+ _popupFunc = popupFunc;
+ }
+
+ /**
* Sets the name of the popup window.
* @param name - the name of the popup window.
* @jsptagref.attributedescription The name of the popup window.
@@ -280,7 +296,7 @@
reportErrors();
}
else {
- IPopupSupport popupSupport = ((IHasPopupSupport)
parentTag).getPopupSupport();
+ PopupSupport popupSupport = ((IHasPopupSupport)
parentTag).getPopupSupport();
// if popupSupport is null, then the tag isn't set to open a popup
window
if (popupSupport != null) {
@@ -308,6 +324,7 @@
if (_top != null)
popupSupport.setTop(_top);
popupSupport.setReplace(_replace);
+ popupSupport.setPopupFunc(_popupFunc);
popupSupport.setOnPopupDone(_onPopupDone);
}
}
@@ -321,6 +338,22 @@
*/
protected void localRelease()
{
+ _name = "";
+ _toolbar = null;
+ _location = null;
+ _directories = null;
+ _status = null;
+ _menubar = null;
+ _resizable = null;
+ _scrollbars = null;
+ _width = null;
+ _height = null;
+ _left = null;
+ _top = null;
+ _replace = false;
+ _popupFunc = null;
+ _onPopupDone = null;
+
super.localRelease();
}
Modified:
incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/IHasPopupSupport.java
Url:
http://svn.apache.org/viewcvs/incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/IHasPopupSupport.java?view=diff&rev=125875&p1=incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/IHasPopupSupport.java&r1=125874&p2=incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/IHasPopupSupport.java&r2=125875
==============================================================================
---
incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/IHasPopupSupport.java
(original)
+++
incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/IHasPopupSupport.java
Thu Jan 20 19:15:45 2005
@@ -19,6 +19,13 @@
interface IHasPopupSupport
{
+ /**
+ * Enable popup support.
+ */
public void setPopup(boolean popup);
- public IPopupSupport getPopupSupport();
+
+ /**
+ * Get a helper to provide popup support.
+ */
+ public PopupSupport getPopupSupport();
}
Deleted:
/incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/IPopupSupport.java
Url:
http://svn.apache.org/viewcvs/incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/IPopupSupport.java?view=auto&rev=125874
==============================================================================
Deleted:
/incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/PopupHelper.java
Url:
http://svn.apache.org/viewcvs/incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/PopupHelper.java?view=auto&rev=125874
==============================================================================
Copied:
incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/PopupSupport.java
(from r125730,
incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/PopupHelper.java)
Url:
http://svn.apache.org/viewcvs/incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/PopupSupport.java?view=diff&rev=125875&p1=incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/PopupHelper.java&r1=125730&p2=incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/PopupSupport.java&r2=125875
==============================================================================
---
incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/PopupHelper.java
(original)
+++
incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/PopupSupport.java
Thu Jan 20 19:15:45 2005
@@ -19,7 +19,6 @@
import org.apache.beehive.netui.pageflow.internal.InternalConstants;
import org.apache.beehive.netui.tags.internal.ReturnActionViewRenderer;
-import org.apache.beehive.netui.tags.internal.IIdProvider;
import org.apache.beehive.netui.tags.IScriptReporter;
import org.apache.beehive.netui.tags.AbstractClassicTag;
import org.apache.beehive.netui.tags.rendering.AbstractRenderAppender;
@@ -29,8 +28,7 @@
import java.util.HashMap;
import java.util.Map;
-class PopupHelper
- implements IPopupSupport
+class PopupSupport
{
private static final String VIEW_RENDERER_CLASS_NAME =
ReturnActionViewRenderer.class.getName();
private static final String ON_POPUP_DONE_FUNC = "Netui_OnPopupDone_";
@@ -39,6 +37,7 @@
private HashMap _features;
private boolean _replace = false;
private String _onPopupDone;
+ private String _popupFunc;
public void setName( String name )
{
@@ -110,38 +109,65 @@
_onPopupDone = onPopupDone;
}
+ public void setPopupFunc( String popupFunc )
+ {
+ _popupFunc = popupFunc;
+ }
+
public String getOnClick(String url)
{
- StringBuilder features = new StringBuilder();
-
- if (_features != null) {
- boolean firstOne = true;
- for (Object i : _features.entrySet()) {
- Map.Entry entry = (Map.Entry) i;
- if (! firstOne) {
- features.append(',');
+ if ( _popupFunc != null ) {
+ return JavaScriptUtils.getString("popupSupportOnClickCustom", new
Object[]{_popupFunc});
+ }
+ else {
+ StringBuilder features = new StringBuilder();
+
+ if (_features != null) {
+ boolean firstOne = true;
+ for (Object i : _features.entrySet()) {
+ Map.Entry entry = (Map.Entry) i;
+ if (! firstOne) {
+ features.append(',');
+ }
+ features.append(entry.getKey());
+ features.append('=');
+ features.append(entry.getValue());
+ firstOne = false;
}
- features.append(entry.getKey());
- features.append('=');
- features.append(entry.getValue());
- firstOne = false;
}
+
+ Object[] args = new Object[]{url, _name, features.toString(),
_replace};
+ return JavaScriptUtils.getString("popupSupportOnClick", args);
}
-
- Object[] args = new Object[]{url, _name, features.toString(),
_replace};
- return JavaScriptUtils.getString("popupHelperOnClick", args);
}
- public void addParams(IUrlParams urlParams, IIdProvider idProvider,
ServletRequest request)
+ public void addParams(IUrlParams urlParams, ServletRequest request)
throws JspException
{
urlParams.addParameter(InternalConstants.RETURN_ACTION_VIEW_RENDERER_PARAM,
VIEW_RENDERER_CLASS_NAME, null);
if (_onPopupDone == null) {
- _onPopupDone = ON_POPUP_DONE_FUNC + idProvider.getNextId(request);
+ _onPopupDone = ON_POPUP_DONE_FUNC + getNextId(request);
}
urlParams.addParameter(ReturnActionViewRenderer.getCallbackParamName(),
_onPopupDone, null);
}
+ /**
+ * This method will generate the next unique int within this request.
+ * @param req the Request
+ * @return the next unique integer for this request.
+ */
+ private static int getNextId(ServletRequest req)
+ {
+ Integer i = (Integer)
req.getAttribute(AbstractClassicTag.NETUI_UNIQUE_CNT);
+ if (i == null) {
+ i = new Integer(0);
+ }
+
+ int ret = i.intValue();
+ req.setAttribute(AbstractClassicTag.NETUI_UNIQUE_CNT, new Integer(ret
+ 1));
+ return ret;
+ }
+
public void writeScript(JavaScriptUtils jsu, IScriptReporter
scriptReporter, AbstractRenderAppender results)
{
// Write the generic function for popping a window.
@@ -149,7 +175,7 @@
// Write the callback that's triggered when the popup window is
closing.
assert (_onPopupDone != null); // addParams() should ensure that
this isn't null
- String func = JavaScriptUtils.getString("popupHelperOnPopupDone", new
Object[]{_onPopupDone});
+ String func = JavaScriptUtils.getString("popupSupportOnPopupDone", new
Object[]{_onPopupDone});
if (scriptReporter != null) {
scriptReporter.addScriptFunction(func);
}
Modified:
incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/RetrievePopupOutput.java
Url:
http://svn.apache.org/viewcvs/incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/RetrievePopupOutput.java?view=diff&rev=125875&p1=incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/RetrievePopupOutput.java&r1=125874&p2=incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/RetrievePopupOutput.java&r2=125875
==============================================================================
---
incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/RetrievePopupOutput.java
(original)
+++
incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/RetrievePopupOutput.java
Thu Jan 20 19:15:45 2005
@@ -32,11 +32,11 @@
* @example
*
* <pre>
- * <netui:anchor action="getZip">
- * Look up a zip code
+ * <netui:anchor action="getCityZipFromNestedPageFlow" popup="true">
+ * Get a city and zip code
* <netui:configurePopup resizable="false" width="400" height="200">
- * Search Google with the query "Socrates"
- * <netui:retrievePopupOutput fieldId="zipCodeField"
expressionToRetrieve="outputFormBean.zipCode" />
+ * <netui:retrievePopupOutput tagIdRef="zipCodeField"
dataSource="outputFormBean.zipCode" />
+ * <netui:retrievePopupOutput tagIdRef="cityField"
dataSource="outputFormBean.city" />
* </netui:configurePopup>
* </netui:anchor></pre>
* @netui:tag name="retrievePopupOutput" description="Causes a value to be
retrieved when a popup window closes."
@@ -49,8 +49,8 @@
public class RetrievePopupOutput
extends AbstractClassicTag
{
- private String _fieldId = null;
- private String _expressionToRetrieve = null;
+ private String _tagIdRef = null;
+ private String _dataSource = null;
/**
* Return the name of the Tag.
@@ -62,31 +62,31 @@
/**
* Sets the ID of the form field to populate with a popup output.
- * @param fieldId - the ID of the form field to populate with a popup
output.
+ * @param tagIdRef - the ID of the form field to populate with a popup
output.
* @jsptagref.attributedescription The ID of the form field to populate
with a popup output.
* @jsptagref.databindable false
- * @jsptagref.attributesyntaxvalue <i>string_fieldId</i>
+ * @jsptagref.attributesyntaxvalue <i>string_tagidRef</i>
* @netui:attribute required="true" rtexprvalue="true"
* description="The ID of the form field to populate with a popup output."
*/
- public void setFieldId(String fieldId)
+ public void setTagIdRef(String tagIdRef)
{
- _fieldId = fieldId;
+ _tagIdRef = tagIdRef;
}
/**
* Sets an expression to be evaluated and retrieved from the popup window.
- * @param expressionToRetrieve - an expression to be evaluated and
retrieved from the popup window.
+ * @param dataSource - an expression to be evaluated and retrieved from
the popup window.
* @jsptagref.attributedescription An expression to be evaluated and
retrieved from the popup window.
* @jsptagref.databindable false
- * @jsptagref.attributesyntaxvalue <i>string_expressionToRetrieve</i>
+ * @jsptagref.attributesyntaxvalue <i>string_dataSource</i>
* @netui:attribute required="true" rtexprvalue="true"
* description="An expression to be evaluated and retrieved from the popup
window."
* @netui.tldx:attribute
*/
- public void setExpressionToRetrieve(String expressionToRetrieve)
+ public void setDataSource(String dataSource)
{
- _expressionToRetrieve = expressionToRetrieve;
+ _dataSource = dataSource;
}
/**
@@ -106,7 +106,7 @@
{
IUrlParams urlParams = (IUrlParams) parentParent;
urlParams.addParameter(ReturnActionViewRenderer.getMapItemParamName(),
- _expressionToRetrieve +
ReturnActionViewRenderer.getDelim() + _fieldId,
+ _dataSource +
ReturnActionViewRenderer.getDelim() + _tagIdRef,
null);
}
}
@@ -121,7 +121,7 @@
{
super.localRelease();
- _expressionToRetrieve = null;
- _fieldId = null;
+ _dataSource = null;
+ _tagIdRef = null;
}
}
Modified:
incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/javaScript.properties
Url:
http://svn.apache.org/viewcvs/incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/javaScript.properties?view=diff&rev=125875&p1=incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/javaScript.properties&r1=125874&p2=incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/javaScript.properties&r2=125875
==============================================================================
---
incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/javaScript.properties
(original)
+++
incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/javaScript.properties
Thu Jan 20 19:15:45 2005
@@ -45,9 +45,12 @@
}\n
# Open a popup window
-popupHelperOnClick=netui_popup("{0}","{1}","{2}",{3});return false;
+popupSupportOnClick=netui_popup("{0}","{1}","{2}",{3});return false;
-popupHelperOnPopupDone=\
+# Open a popup window using a custom function
+popupSupportOnClickCustom={0}();return false;
+
+popupSupportOnPopupDone=\
function {0}(map)\n\
'{'\n\
\ for (var i in map)\n\
Deleted:
/incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/internal/IIdProvider.java
Url:
http://svn.apache.org/viewcvs/incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/internal/IIdProvider.java?view=auto&rev=125874
==============================================================================
Added:
incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/miniTests/updateFormFromNestedPopup/Controller.jpf
Url:
http://svn.apache.org/viewcvs/incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/miniTests/updateFormFromNestedPopup/Controller.jpf?view=auto&rev=125875
==============================================================================
--- (empty file)
+++
incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/miniTests/updateFormFromNestedPopup/Controller.jpf
Thu Jan 20 19:15:45 2005
@@ -0,0 +1,124 @@
+package miniTests.updateFormFromNestedPopup;
+
+import org.apache.beehive.netui.pageflow.FormData;
+import org.apache.beehive.netui.pageflow.Forward;
+import org.apache.beehive.netui.pageflow.PageFlowController;
+import org.apache.beehive.netui.pageflow.internal.ViewRenderer;
+import org.apache.beehive.netui.pageflow.internal.RequestValues;
+import org.apache.beehive.netui.pageflow.internal.InternalUtils;
+import org.apache.beehive.netui.pageflow.annotations.Jpf;
+
+import miniTests.updateFormFromNestedPopup.getZip.GetZip;
+
+import javax.servlet.*;
+import java.io.*;
+
+
[EMAIL PROTECTED](
+ simpleActions={
+ @Jpf.SimpleAction(name="begin", path="index.jsp"),
+ @Jpf.SimpleAction(name="getZip", path="getZip/GetZip.jpf")
+ }
+)
+public class Controller extends PageFlowController
+{
+ @Jpf.Action()
+ protected Forward zipSuccess( GetZip.ZipForm zip )
+ {
+ return new Forward( "_auto" );
+ }
+
+ @Jpf.Action()
+ protected Forward zipCancel()
+ {
+ return new Forward( "_auto" ); // THIS IS THE MAGIC GLOBAL FORWARD
+ }
+
+
+ @Jpf.Action(
+ forwards={
+ @Jpf.Forward(
+ name = "success",
+ path = "results.jsp"
+ )
+ },
+ [EMAIL PROTECTED](name="fail", navigateTo=Jpf.NavigateTo.currentPage)
+ )
+ protected Forward submit(SubmitForm form)
+ {
+ return new Forward("success", "form", form );
+ }
+
+
+ public static class SubmitForm
+ extends FormData
+ {
+ private String _name;
+ private String _address;
+ private String _city;
+ private String _state;
+ private String _zip;
+
+ @Jpf.ValidatableProperty(
+ displayName="The name",
+ [EMAIL PROTECTED]()
+ )
+ 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;
+ }
+
+ @Jpf.ValidatableProperty(
+ displayName="The state",
+ [EMAIL PROTECTED]()
+ )
+ public String getState()
+ {
+ return _state;
+ }
+
+ public void setState( String state )
+ {
+ _state = state;
+ }
+
+ @Jpf.ValidatableProperty(
+ displayName="The zip code",
+ [EMAIL PROTECTED]()
+ )
+ public String getZip()
+ {
+ return _zip;
+ }
+
+ public void setZip(String value)
+ {
+ _zip = value;
+ }
+ }
+}
Added:
incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/miniTests/updateFormFromNestedPopup/getZip/GetZip.jpf
Url:
http://svn.apache.org/viewcvs/incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/miniTests/updateFormFromNestedPopup/getZip/GetZip.jpf?view=auto&rev=125875
==============================================================================
--- (empty file)
+++
incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/miniTests/updateFormFromNestedPopup/getZip/GetZip.jpf
Thu Jan 20 19:15:45 2005
@@ -0,0 +1,224 @@
+package miniTests.updateFormFromNestedPopup.getZip;
+
+import javax.servlet.http.HttpSession;
+import org.apache.beehive.netui.pageflow.PageFlowController;
+import org.apache.beehive.netui.pageflow.Forward;
+import org.apache.beehive.netui.pageflow.annotations.Jpf;
+import javax.servlet.http.HttpServletRequest;
+import org.apache.struts.action.ActionMapping;
+import org.apache.beehive.netui.pageflow.FormData;
+
+
[EMAIL PROTECTED](
+ nested=true,
+ simpleActions={
+ @Jpf.SimpleAction(name="begin", path="index.jsp")
+ }
+)
+public class GetZip extends PageFlowController
+{
+ /**
+ * This is the zip code and state that will be returned in [EMAIL
PROTECTED] #done}.
+ */
+ private ZipForm _zip;
+
+ @Jpf.Action(
+ forwards={
+ @Jpf.Forward(
+ name="done",
+ returnAction="zipSuccess",
+ outputFormBean="_zip"
+ )
+ }
+ )
+ protected Forward done()
+ {
+ return new Forward( "done" );
+ }
+
+
+ @Jpf.Action(
+ forwards={
+ @Jpf.Forward(name="confirm", path="confirm.jsp"),
+ @Jpf.Forward(name="invalidZip", path="invalidZip.jsp")
+ },
+ useFormBean="_zip",
+ [EMAIL PROTECTED](name="failure",
navigateTo=Jpf.NavigateTo.currentPage)
+ )
+ protected Forward submitZip( ZipForm form )
+ {
+ int prefix = Integer.parseInt( form.getZip().substring( 0, 3 ) );
+ String state = _zips[prefix];
+
+ if ( state == null )
+ {
+ return new Forward( "invalidZip", "zip", form.getZip() );
+ }
+
+ _zip.setState( state );
+
+ Forward fwd = new Forward( "confirm" );
+ fwd.addActionOutput( "zip", form.getZip() );
+ fwd.addActionOutput( "state", state );
+ return fwd;
+ }
+
+ @Jpf.Action(
+ forwards={
+ @Jpf.Forward(name="done", returnAction="zipCancel")
+ }
+ )
+ protected Forward cancel( ZipForm form )
+ {
+ return new Forward( "done" );
+ }
+
+ public static class ZipForm extends FormData
+ {
+ private String _state;
+ private String _zip;
+
+ public ZipForm()
+ {
+ }
+
+ @Jpf.ValidatableProperty(
+ displayName="The zip code",
+ [EMAIL PROTECTED](),
+ [EMAIL PROTECTED](chars=5),
+ [EMAIL PROTECTED](chars=5),
+ [EMAIL PROTECTED](regex="[0-9][0-9]")
+ )
+ public String getZip()
+ {
+ return _zip;
+ }
+
+ public void setZip( String zip )
+ {
+ _zip = zip;
+ }
+
+ public String getState()
+ {
+ return _state;
+ }
+
+ public void setState( String state )
+ {
+ _state = state;
+ }
+ }
+
+ private static String[] _zips = new String[1000];
+
+ static
+ {
+ setZips( 5, 5, "New York" );
+ setZips( 6, 7, "Puerto Rico" );
+ setZips( 8, 8, "Virgin Islands" );
+ setZips( 9, 9, "Puerto Rico" );
+ setZips( 10, 27, "Massachusetts" );
+ setZips( 28, 29, "Rhode Island" );
+ setZips( 30, 38, "New Hampshire" );
+ setZips( 39, 49, "Maine" );
+ setZips( 50, 54, "Vermont" );
+ setZips( 55, 55, "Massachusetts" );
+ setZips( 56, 59, "Vermont" );
+ setZips( 60, 69, "Connecticut" );
+ setZips( 70, 89, "New Jersey" );
+ setZips( 90, 99, "Armed Forces Europe*" );
+ setZips( 100, 149, "New York" );
+ setZips( 150, 196, "Pennsylvania" );
+ setZips( 197, 199, "Delaware" );
+ setZips( 200, 200, "District of Columbia" );
+ setZips( 201, 201, "Virginia" );
+ setZips( 202, 205, "District of Columbia" );
+ setZips( 206, 212, "Maryland" );
+ setZips( 214, 219, "Maryland" );
+ setZips( 220, 246, "Virginia" );
+ setZips( 247, 268, "West Virginia" );
+ setZips( 270, 289, "North Carolina" );
+ setZips( 290, 299, "South Carolina" );
+ setZips( 300, 319, "Georgia" );
+ setZips( 320, 339, "Florida" );
+ setZips( 340, 340, "Armed Forces Americas" );
+ setZips( 341, 342, "Florida" );
+ setZips( 344, 344, "Florida" );
+ setZips( 346, 347, "Florida" );
+ setZips( 349, 349, "Florida" );
+ setZips( 350, 352, "Alabama" );
+ setZips( 354, 369, "Alabama" );
+ setZips( 370, 385, "Tennessee" );
+ setZips( 386, 397, "Mississippi" );
+ setZips( 398, 399, "Georgia" );
+ setZips( 399, 399, "Georgia" );
+ setZips( 400, 427, "Kentucky" );
+ setZips( 430, 459, "Ohio" );
+ setZips( 460, 470, "Indiana" );
+ setZips( 471, 471, "Kentucky" );
+ setZips( 472, 479, "Indiana" );
+ setZips( 480, 499, "Michigan" );
+ setZips( 500, 528, "Iowa" );
+ setZips( 530, 532, "Wisconsin" );
+ setZips( 534, 535, "Wisconsin" );
+ setZips( 537, 549, "Wisconsin" );
+ setZips( 550, 551, "Minnesota" );
+ setZips( 553, 566, "Minnesota" );
+ setZips( 567, 567, "North Dakota" );
+ setZips( 570, 577, "South Dakota" );
+ setZips( 580, 588, "North Dakota" );
+ setZips( 590, 599, "Montana" );
+ setZips( 600, 620, "Illinois" );
+ setZips( 622, 629, "Illinois" );
+ setZips( 630, 631, "Missouri" );
+ setZips( 633, 641, "Missouri" );
+ setZips( 644, 658, "Missouri" );
+ setZips( 660, 662, "Kansas" );
+ setZips( 664, 679, "Kansas" );
+ setZips( 680, 681, "Nebraska" );
+ setZips( 683, 693, "Nebraska" );
+ setZips( 700, 701, "Louisiana" );
+ setZips( 703, 708, "Louisiana" );
+ setZips( 710, 714, "Louisiana" );
+ setZips( 716, 729, "Arkansas" );
+ setZips( 730, 731, "Oklahoma" );
+ setZips( 733, 733, "Texas" );
+ setZips( 734, 741, "Oklahoma" );
+ setZips( 743, 749, "Oklahoma" );
+ setZips( 750, 799, "Texas" );
+ setZips( 800, 816, "Colorado" );
+ setZips( 820, 831, "Wyoming" );
+ setZips( 832, 838, "Idaho" );
+ setZips( 840, 847, "Utah" );
+ setZips( 850, 850, "Arizona" );
+ setZips( 852, 853, "Arizona" );
+ setZips( 855, 857, "Arizona" );
+ setZips( 859, 860, "Arizona" );
+ setZips( 863, 865, "Arizona" );
+ setZips( 870, 875, "New Mexico" );
+ setZips( 877, 884, "New Mexico" );
+ setZips( 885, 885, "Texas" );
+ setZips( 889, 891, "Nevada" );
+ setZips( 893, 895, "Nevada" );
+ setZips( 897, 898, "Nevada" );
+ setZips( 900, 908, "California" );
+ setZips( 910, 928, "California" );
+ setZips( 930, 961, "California" );
+ setZips( 962, 966, "Armed Forces Pacific" );
+ setZips( 967, 968, "Hawaii" );
+ setZips( 969, 969, "Guam" );
+ setZips( 970, 979, "Oregon" );
+ setZips( 980, 986, "Washington" );
+ setZips( 988, 994, "Washington" );
+ setZips( 995, 999, "Alaska" );
+ }
+
+ private static void setZips( int start, int end, String state )
+ {
+ for ( int i = start; i <= end; ++i )
+ {
+ _zips[i] = state;
+ }
+ }
+}
Added:
incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/miniTests/updateFormFromNestedPopup/getZip/confirm.jsp
Url:
http://svn.apache.org/viewcvs/incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/miniTests/updateFormFromNestedPopup/getZip/confirm.jsp?view=auto&rev=125875
==============================================================================
--- (empty file)
+++
incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/miniTests/updateFormFromNestedPopup/getZip/confirm.jsp
Thu Jan 20 19:15:45 2005
@@ -0,0 +1,16 @@
+<[EMAIL PROTECTED] contentType="text/html;charset=UTF-8" language="java"%>
+<%@ taglib uri="http://beehive.apache.org/netui/tags-html-1.0" prefix="netui"%>
+<html>
+ <head>
+ </head>
+ <body>
+ You have chosen <b>${pageInput.zip}</b>, in <b>${pageInput.state}</b>.
+ Is this correct?
+ <br/>
+ <br/>
+ <netui:form action="done">
+ <netui:button value="yes"/>
+ <netui:button action="begin" value="no"/>
+ </netui:form>
+ </body>
+</html>
\ No newline at end of file
Added:
incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/miniTests/updateFormFromNestedPopup/getZip/index.jsp
Url:
http://svn.apache.org/viewcvs/incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/miniTests/updateFormFromNestedPopup/getZip/index.jsp?view=auto&rev=125875
==============================================================================
--- (empty file)
+++
incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/miniTests/updateFormFromNestedPopup/getZip/index.jsp
Thu Jan 20 19:15:45 2005
@@ -0,0 +1,30 @@
+<%@ page language="java" contentType="text/html;charset=UTF-8"%>
+<%@ taglib prefix="netui" uri="http://beehive.apache.org/netui/tags-html-1.0"%>
+<%@ taglib prefix="netui-data"
uri="http://beehive.apache.org/netui/tags-databinding-1.0"%>
+<%@ taglib prefix="netui-template"
uri="http://beehive.apache.org/netui/tags-template-1.0"%>
+
+
+<netui:html>
+ <head>
+ <netui:base/>
+ </head>
+ <netui:body>
+ <netui:form action="submitZip">
+ <table>
+ <tr valign="top">
+ <td>Zip:</td>
+ <td>
+ <netui:textBox dataSource="actionForm.zip"></netui:textBox>
+ <span style="color:red"><netui:error value="zip"/></span>
+ </td>
+ </tr>
+ </table>
+ <br/>
+ <netui:button type="submit" value="submit"/>
+ <netui:button type="submit" action="cancel" value="cancel"/>
+ </netui:form>
+
+ </netui:body>
+</netui:html>
+
+
\ No newline at end of file
Added:
incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/miniTests/updateFormFromNestedPopup/getZip/invalidZip.jsp
Url:
http://svn.apache.org/viewcvs/incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/miniTests/updateFormFromNestedPopup/getZip/invalidZip.jsp?view=auto&rev=125875
==============================================================================
--- (empty file)
+++
incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/miniTests/updateFormFromNestedPopup/getZip/invalidZip.jsp
Thu Jan 20 19:15:45 2005
@@ -0,0 +1,15 @@
+<[EMAIL PROTECTED] contentType="text/html;charset=UTF-8" language="java"%>
+<%@ taglib uri="http://beehive.apache.org/netui/tags-html-1.0" prefix="netui"%>
+<html>
+ <head>
+ </head>
+ <body>
+ <b>${pageInput.zip}</b> is not a registered zip code.
+ <br/>
+ <br/>
+ <netui:form action="begin">
+ <netui:button value="try again"/>
+ <netui:button action="cancel" value="cancel"/>
+ </netui:form>
+ </body>
+</html>
Added:
incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/miniTests/updateFormFromNestedPopup/index.jsp
Url:
http://svn.apache.org/viewcvs/incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/miniTests/updateFormFromNestedPopup/index.jsp?view=auto&rev=125875
==============================================================================
--- (empty file)
+++
incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/miniTests/updateFormFromNestedPopup/index.jsp
Thu Jan 20 19:15:45 2005
@@ -0,0 +1,61 @@
+<%@ page language="java" contentType="text/html;charset=UTF-8"%>
+<%@ taglib prefix="netui" uri="http://beehive.apache.org/netui/tags-html-1.0"%>
+<%@ taglib prefix="netui-data"
uri="http://beehive.apache.org/netui/tags-databinding-1.0"%>
+<%@ taglib prefix="netui-template"
uri="http://beehive.apache.org/netui/tags-template-1.0"%>
+
+<netui:html>
+ <head>
+ <netui:base/>
+ </head>
+ <netui:body>
+ <netui:form action="submit">
+ <table>
+ <tr valign="top">
+ <td><b>Name:<b></td>
+ <td>
+ <netui:textBox dataSource="actionForm.name"/>
+ <span style="color:red"><netui:error value="name"/></span>
+ </td>
+ </tr>
+ <tr valign="top">
+ <td>Address:</td>
+ <td>
+ <netui:textBox dataSource="actionForm.address"/>
+ </td>
+ </tr>
+ <tr valign="top">
+ <td>City:</td>
+ <td>
+ <netui:textBox dataSource="actionForm.city"/>
+ </td>
+ </tr>
+ <tr valign="top">
+ <td><b>State:</b></td>
+ <td>
+ <netui:textBox tagId="stateField" dataSource="actionForm.state"/>
+ <span style="color:red"><netui:error value="state"/></span>
+ </td>
+ </tr>
+ <tr valign="top">
+ <td><b>Zip:<b></td>
+ <td>
+ <netui:textBox tagId="zipField" dataSource="actionForm.zip"/>
+ <span style="color:red"><netui:error value="zip"/></span>
+
+ <netui:anchor action="getZip" popup="true">
+ look up
+ <netui:configurePopup location="false" width="550"
height="150">
+ <netui:retrievePopupOutput tagIdRef="stateField"
dataSource="outputFormBean.state"/>
+ <netui:retrievePopupOutput tagIdRef="zipField"
dataSource="outputFormBean.zip"/>
+ </netui:configurePopup>
+ </netui:anchor>
+
+ </td>
+ </tr>
+ </table>
+ <br/>
+ <netui:button type="submit" value="submit"/>
+ </netui:form>
+
+ </netui:body>
+</netui:html>
Added:
incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/miniTests/updateFormFromNestedPopup/results.jsp
Url:
http://svn.apache.org/viewcvs/incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/miniTests/updateFormFromNestedPopup/results.jsp?view=auto&rev=125875
==============================================================================
--- (empty file)
+++
incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/miniTests/updateFormFromNestedPopup/results.jsp
Thu Jan 20 19:15:45 2005
@@ -0,0 +1,27 @@
+<%@ page language="java" contentType="text/html;charset=UTF-8"%>
+<%@ taglib prefix="netui" uri="http://beehive.apache.org/netui/tags-html-1.0"%>
+<%@ taglib prefix="netui-data"
uri="http://beehive.apache.org/netui/tags-databinding-1.0"%>
+<%@ taglib prefix="netui-template"
uri="http://beehive.apache.org/netui/tags-template-1.0"%>
+
+
+<netui:html>
+ <head>
+ <netui:base/>
+ </head>
+ <netui:body>
+ name: <b>${pageInput.form.name}</b>
+ <br/>
+ address: <b>${pageInput.form.address}</b>
+ <br/>
+ city: <b>${pageInput.form.city}</b>
+ <br/>
+ state: <b>${pageInput.form.state}</b>
+ <br/>
+ zip: <b>${pageInput.form.zip}</b>
+ <br/>
+ <br/>
+ <netui:anchor action="begin">start over</netui:anchor>
+ </netui:body>
+</netui:html>
+
+
Added:
incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/miniTests/updateFormFromNestedPopup/ttt
Url:
http://svn.apache.org/viewcvs/incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/miniTests/updateFormFromNestedPopup/ttt?view=auto&rev=125875
==============================================================================
--- (empty file)
+++
incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/miniTests/updateFormFromNestedPopup/ttt
Thu Jan 20 19:15:45 2005
@@ -0,0 +1,19 @@
+webapp dir is C:/prog/jakarta-tomcat-5.0.25/jakarta-tomcat-5.0.25/webapps/tttjs
+Buildfile: d:\w\b\test\ant\buildWebapp.xml
+
+Main targets:
+
+ Beehive/DeployWebappRuntime.usage
+ Beehive/RunTomcat.usage
+ deploy Deploy a webapp to a running Tomcat server
+ deploy.beehive.webapp.runtime Deploy the Beehive webapp runtime into a
webapp rooted at ${webapp.dir}
+ deploy.wsm.webapp.runtime Deploy the Beehive web services runtime
into a webapp rooted at ${webapp.dir}
+ redeploy Redeploy a webapp already running on a
Tomcat server
+ reset.config Reset the Tomcat configuration to the
'default' test state
+ start Start a Tomcat instance.
+ start.with.shmem Start a Tomcat instance.
+ stop Stop the NetUI server
+ undeploy Undeploy a webapp running on a Tomcat
server
+ undeploy.beehive.webapp.runtime Clean the Beehive webapp runtime from a
webapp rooted at ${webapp.dir}
+ usage
+Default target: usage
Modified:
incubator/beehive/trunk/netui/test/webapps/drt/testRecorder/config/testRecorder-tests.xml
Url:
http://svn.apache.org/viewcvs/incubator/beehive/trunk/netui/test/webapps/drt/testRecorder/config/testRecorder-tests.xml?view=diff&rev=125875&p1=incubator/beehive/trunk/netui/test/webapps/drt/testRecorder/config/testRecorder-tests.xml&r1=125874&p2=incubator/beehive/trunk/netui/test/webapps/drt/testRecorder/config/testRecorder-tests.xml&r2=125875
==============================================================================
---
incubator/beehive/trunk/netui/test/webapps/drt/testRecorder/config/testRecorder-tests.xml
(original)
+++
incubator/beehive/trunk/netui/test/webapps/drt/testRecorder/config/testRecorder-tests.xml
Thu Jan 20 19:15:45 2005
@@ -6109,6 +6109,23 @@
</features>
</test>
<test>
+ <name>UpdateFormFromNestedPopup</name>
+ <description>Test of updating a form with values obtained from a
nested page flow that is run in a popup window.</description>
+ <webapp>coreWeb</webapp>
+ <categories>
+ <category>bvt</category>
+ <category>bvt.struts11</category>
+ <category>corePageFlow</category>
+ </categories>
+ <features>
+ <feature>PageFlow</feature>
+ <feature>Nesting</feature>
+ <feature>Form</feature>
+ <feature>Popup</feature>
+ <feature>Validation</feature>
+ </features>
+ </test>
+ <test>
<name>UrlBinding</name>
<description>Test of binding to the {url} context.</description>
<webapp>coreWeb</webapp>
Modified:
incubator/beehive/trunk/netui/test/webapps/drt/testRecorder/tests/UpdateFormFromNested.xml
Url:
http://svn.apache.org/viewcvs/incubator/beehive/trunk/netui/test/webapps/drt/testRecorder/tests/UpdateFormFromNested.xml?view=diff&rev=125875&p1=incubator/beehive/trunk/netui/test/webapps/drt/testRecorder/tests/UpdateFormFromNested.xml&r1=125874&p2=incubator/beehive/trunk/netui/test/webapps/drt/testRecorder/tests/UpdateFormFromNested.xml&r2=125875
==============================================================================
---
incubator/beehive/trunk/netui/test/webapps/drt/testRecorder/tests/UpdateFormFromNested.xml
(original)
+++
incubator/beehive/trunk/netui/test/webapps/drt/testRecorder/tests/UpdateFormFromNested.xml
Thu Jan 20 19:15:45 2005
@@ -3,7 +3,7 @@
<ses:sessionName>UpdateFormFromNested</ses:sessionName>
<ses:tester>rich</ses:tester>
<ses:startDate>18 Jan 2005, 06:56:25.265 PM MST</ses:startDate>
- <ses:description>rich</ses:description>
+ <ses:description>Test of updating a form with values obtained from a nested
page flow.</ses:description>
<ses:tests>
<ses:test>
<ses:testNumber>1</ses:testNumber>
@@ -743,4 +743,4 @@
<ses:testCount>7</ses:testCount>
<ses:passedCount>2</ses:passedCount>
<ses:failedCount>5</ses:failedCount>
-</ses:recorderSession>
\ No newline at end of file
+</ses:recorderSession>
Added:
incubator/beehive/trunk/netui/test/webapps/drt/testRecorder/tests/UpdateFormFromNestedPopup.xml
Url:
http://svn.apache.org/viewcvs/incubator/beehive/trunk/netui/test/webapps/drt/testRecorder/tests/UpdateFormFromNestedPopup.xml?view=auto&rev=125875
==============================================================================
--- (empty file)
+++
incubator/beehive/trunk/netui/test/webapps/drt/testRecorder/tests/UpdateFormFromNestedPopup.xml
Thu Jan 20 19:15:45 2005
@@ -0,0 +1,863 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ses:recorderSession
xmlns:ses="http://beehive.apache.org/netui/tools/testrecorder/2004/session">
+ <ses:sessionName>UpdateFormFromNestedPopup</ses:sessionName>
+ <ses:tester>rich</ses:tester>
+ <ses:startDate>20 Jan 2005, 06:38:07.986 PM MST</ses:startDate>
+ <ses:description>Test of updating a form with values obtained from a nested
page flow that is run in a popup window.</ses:description>
+ <ses:tests>
+ <ses:test>
+ <ses:testNumber>1</ses:testNumber>
+ <ses:request>
+ <ses:protocol>HTTP</ses:protocol>
+ <ses:protocolVersion>1.1</ses:protocolVersion>
+ <ses:host>localhost</ses:host>
+ <ses:port>8080</ses:port>
+
<ses:uri>/coreWeb/miniTests/updateFormFromNestedPopup/Controller.jpf</ses:uri>
+ <ses:method>GET</ses:method>
+ <ses:parameters/>
+ <ses:cookies>
+ <ses:cookie>
+ <ses:name>JSESSIONID</ses:name>
+ <ses:value>B81EAA5A06371210B4460C6B4BE54357</ses:value>
+ </ses:cookie>
+ </ses:cookies>
+ <ses:headers>
+ <ses:header>
+ <ses:name>accept</ses:name>
+
<ses:value>text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5</ses:value>
+ </ses:header>
+ <ses:header>
+ <ses:name>accept-charset</ses:name>
+ <ses:value>ISO-8859-1,utf-8;q=0.7,*;q=0.7</ses:value>
+ </ses:header>
+ <ses:header>
+ <ses:name>accept-encoding</ses:name>
+ <ses:value>gzip,deflate</ses:value>
+ </ses:header>
+ <ses:header>
+ <ses:name>accept-language</ses:name>
+ <ses:value>en-us,en;q=0.5</ses:value>
+ </ses:header>
+ <ses:header>
+ <ses:name>connection</ses:name>
+ <ses:value>keep-alive</ses:value>
+ </ses:header>
+ <ses:header>
+ <ses:name>cookie</ses:name>
+
<ses:value>JSESSIONID=B81EAA5A06371210B4460C6B4BE54357</ses:value>
+ </ses:header>
+ <ses:header>
+ <ses:name>host</ses:name>
+ <ses:value>localhost:8080</ses:value>
+ </ses:header>
+ <ses:header>
+ <ses:name>keep-alive</ses:name>
+ <ses:value>300</ses:value>
+ </ses:header>
+ <ses:header>
+ <ses:name>user-agent</ses:name>
+ <ses:value>Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US;
rv:1.7.5) Gecko/20041107 Firefox/1.0</ses:value>
+ </ses:header>
+ </ses:headers>
+ </ses:request>
+ <ses:response>
+ <ses:statusCode>200</ses:statusCode>
+ <ses:reason/>
+ <ses:responseBody><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01
Transitional//EN"
+ "http://www.w3.org/TR/html4/loose.dtd">
+<html lang="en">
+
+ <head>
+ <base
href="http://localhost:8080/coreWeb/miniTests/updateFormFromNestedPopup/index.jsp">
+ </head>
+ <body>
+ <form name="submitForm"
action="/coreWeb/miniTests/updateFormFromNestedPopup/submit.do" method="post">
+ <table>
+ <tr valign="top">
+ <td><b>Name:<b></td>
+ <td>
+ <input type="text" name="{actionForm.name}">
+ <span style="color:red"></span>
+ </td>
+ </tr>
+ <tr valign="top">
+ <td>Address:</td>
+ <td>
+ <input type="text" name="{actionForm.address}">
+ </td>
+ </tr>
+ <tr valign="top">
+ <td>City:</td>
+ <td>
+ <input type="text" name="{actionForm.city}">
+ </td>
+ </tr>
+ <tr valign="top">
+ <td><b>State:</b></td>
+ <td>
+ <input type="text" name="{actionForm.state}" id="stateField">
+ <span style="color:red"></span>
+ </td>
+ </tr>
+ <tr valign="top">
+ <td><b>Zip:<b></td>
+ <td>
+ <input type="text" name="{actionForm.zip}" id="zipField">
+ <span style="color:red"></span>
+
+ <a
href="/coreWeb/miniTests/updateFormFromNestedPopup/getZip.do?_netui%3AreturnActionViewRenderer=org.apache.beehive.netui.tags.internal.ReturnActionViewRenderer&_netui%3AretrieveItem=outputFormBean.state%3AstateField&_netui%3AretrieveItem=outputFormBean.zip%3AzipField&_netui%3AreturnActionCallback=Netui_OnPopupDone_1"
onclick='netui_popup("/coreWeb/miniTests/updateFormFromNestedPopup/getZip.do?_netui%3AreturnActionViewRenderer=org.apache.beehive.netui.tags.internal.ReturnActionViewRenderer&_netui%3AretrieveItem=outputFormBean.state%3AstateField&_netui%3AretrieveItem=outputFormBean.zip%3AzipField&_netui%3AreturnActionCallback=Netui_OnPopupDone_1","","width=550,height=150,location=0",false);return
false;'>look up</a>
+
+ </td>
+ </tr>
+ </table>
+ <br/>
+ <input type="submit" value="submit">
+ </form>
+
+
+
+<script language="JavaScript" type="text/JavaScript">
+<!--
+
+// **** This section contains code that will run when the page is loaded ****
+
+
+// Build the netui_names table to map the tagId attributes
+// to the real id written into the HTML
+if (netui_names == null)
+ var netui_names = new Object();
+netui_names.stateField="{actionForm.state}"
+netui_names.zipField="{actionForm.zip}"
+
+
+// Build the netui_names table to map the tagId attributes
+// to the real id written into the HTML
+if (netui_tagIdNameMap == null)
+ var netui_tagIdNameMap = new Object();
+netui_tagIdNameMap.stateField="{actionForm.state}"
+netui_tagIdNameMap.zipField="{actionForm.zip}"
+
+
+// **** This section contains functions typically run as events ****
+
+
+function netui_popup(url, name, features, replace)
+{
+ wnd=open(url, name, features, replace);
+ if (wnd.opener == null) wnd.opener=self;
+}
+
+function Netui_OnPopupDone_1(map)
+{
+ for (var i in map)
+ {
+ document.getElementById(i).value=map[i];
+ }
+}
+
+// method which will return a real id for a tagId,
+// the tag parameter will be used to find the idScope for
+// containers that may scope their ids
+function getNetuiTagName(id, tag)
+{
+ var idScope = getScopeId(tag);
+ if (idScope == "")
+ return netui_names[id];
+ else
+ return netui_names[idScope + "__" + id];
+}
+
+// This method will walk the hierarchy from the pass element looking for a
idScope.
+// The first idScope found will be returned or the empty string if a idScope
is not found.
+function getScopeId(tag)
+{
+ if (tag == null || tag.getAttribute == null)
+ return "";
+ var attrVal = tag.getAttribute("netui:idScope");
+ if (attrVal != null)
+ return attrVal;
+ return getScopeId(tag.parentNode);
+}
+
+// lookup by tagId to "real id"
+function lookupIdByTagId(id, tag)
+{
+ var idScope = lookupIdScope(tag,".");
+ return (idScope == "") ? id : idScope + id;
+}
+
+// lookup by tagId to "real name"
+function lookupNameByTagId(id, tag)
+{
+ var idScope = lookupIdScope(tag,"_");
+ if (idScope == "")
+ return netui_tagIdNameMap[id];
+ else
+ return netui_tagIdNameMap[idScope + "__" + id];
+}
+
+//Non-Legacy lookup method creating a fully qualified scope id
+function lookupIdScope(tag,sep)
+{
+ var val = "";
+ while (tag != null && tag.getAttribute != null) {
+ var attrVal = tag.getAttribute("netui:idScope");
+ if (attrVal != null)
+ val = attrVal + sep + val;
+ tag = tag.parentNode;
+ }
+ return val;
+}
+-->
+</script>
+
+</body>
+
+</html></ses:responseBody>
+ </ses:response>
+ </ses:test>
+ <ses:test>
+ <ses:testNumber>2</ses:testNumber>
+ <ses:request>
+ <ses:protocol>HTTP</ses:protocol>
+ <ses:protocolVersion>1.1</ses:protocolVersion>
+ <ses:host>localhost</ses:host>
+ <ses:port>8080</ses:port>
+
<ses:uri>/coreWeb/miniTests/updateFormFromNestedPopup/submit.do</ses:uri>
+ <ses:method>POST</ses:method>
+ <ses:parameters>
+ <ses:parameter>
+ <ses:name>{actionForm.address}</ses:name>
+ <ses:value/>
+ </ses:parameter>
+ <ses:parameter>
+ <ses:name>{actionForm.city}</ses:name>
+ <ses:value/>
+ </ses:parameter>
+ <ses:parameter>
+ <ses:name>{actionForm.name}</ses:name>
+ <ses:value>dick</ses:value>
+ </ses:parameter>
+ <ses:parameter>
+ <ses:name>{actionForm.state}</ses:name>
+ <ses:value/>
+ </ses:parameter>
+ <ses:parameter>
+ <ses:name>{actionForm.zip}</ses:name>
+ <ses:value/>
+ </ses:parameter>
+ </ses:parameters>
+ <ses:cookies>
+ <ses:cookie>
+ <ses:name>JSESSIONID</ses:name>
+ <ses:value>B81EAA5A06371210B4460C6B4BE54357</ses:value>
+ </ses:cookie>
+ </ses:cookies>
+ <ses:headers>
+ <ses:header>
+ <ses:name>accept</ses:name>
+
<ses:value>text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5</ses:value>
+ </ses:header>
+ <ses:header>
+ <ses:name>accept-charset</ses:name>
+ <ses:value>ISO-8859-1,utf-8;q=0.7,*;q=0.7</ses:value>
+ </ses:header>
+ <ses:header>
+ <ses:name>accept-encoding</ses:name>
+ <ses:value>gzip,deflate</ses:value>
+ </ses:header>
+ <ses:header>
+ <ses:name>accept-language</ses:name>
+ <ses:value>en-us,en;q=0.5</ses:value>
+ </ses:header>
+ <ses:header>
+ <ses:name>connection</ses:name>
+ <ses:value>keep-alive</ses:value>
+ </ses:header>
+ <ses:header>
+ <ses:name>content-length</ses:name>
+ <ses:value>121</ses:value>
+ </ses:header>
+ <ses:header>
+ <ses:name>content-type</ses:name>
+ <ses:value>application/x-www-form-urlencoded</ses:value>
+ </ses:header>
+ <ses:header>
+ <ses:name>cookie</ses:name>
+
<ses:value>JSESSIONID=B81EAA5A06371210B4460C6B4BE54357</ses:value>
+ </ses:header>
+ <ses:header>
+ <ses:name>host</ses:name>
+ <ses:value>localhost:8080</ses:value>
+ </ses:header>
+ <ses:header>
+ <ses:name>keep-alive</ses:name>
+ <ses:value>300</ses:value>
+ </ses:header>
+ <ses:header>
+ <ses:name>referer</ses:name>
+
<ses:value>http://localhost:8080/coreWeb/miniTests/updateFormFromNestedPopup/Controller.jpf</ses:value>
+ </ses:header>
+ <ses:header>
+ <ses:name>user-agent</ses:name>
+ <ses:value>Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US;
rv:1.7.5) Gecko/20041107 Firefox/1.0</ses:value>
+ </ses:header>
+ </ses:headers>
+ </ses:request>
+ <ses:response>
+ <ses:statusCode>200</ses:statusCode>
+ <ses:reason/>
+ <ses:responseBody><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01
Transitional//EN"
+ "http://www.w3.org/TR/html4/loose.dtd">
+<html lang="en">
+
+ <head>
+ <base
href="http://localhost:8080/coreWeb/miniTests/updateFormFromNestedPopup/index.jsp">
+ </head>
+ <body>
+ <form name="submitForm"
action="/coreWeb/miniTests/updateFormFromNestedPopup/submit.do" method="post">
+ <table>
+ <tr valign="top">
+ <td><b>Name:<b></td>
+ <td>
+ <input type="text" name="{actionForm.name}" value="dick">
+ <span style="color:red"></span>
+ </td>
+ </tr>
+ <tr valign="top">
+ <td>Address:</td>
+ <td>
+ <input type="text" name="{actionForm.address}">
+ </td>
+ </tr>
+ <tr valign="top">
+ <td>City:</td>
+ <td>
+ <input type="text" name="{actionForm.city}">
+ </td>
+ </tr>
+ <tr valign="top">
+ <td><b>State:</b></td>
+ <td>
+ <input type="text" name="{actionForm.state}" id="stateField">
+ <span style="color:red">The state is required.
+</span>
+ </td>
+ </tr>
+ <tr valign="top">
+ <td><b>Zip:<b></td>
+ <td>
+ <input type="text" name="{actionForm.zip}" id="zipField">
+ <span style="color:red">The zip code is required.
+</span>
+
+ <a
href="/coreWeb/miniTests/updateFormFromNestedPopup/getZip.do?_netui%3AreturnActionViewRenderer=org.apache.beehive.netui.tags.internal.ReturnActionViewRenderer&_netui%3AretrieveItem=outputFormBean.state%3AstateField&_netui%3AretrieveItem=outputFormBean.zip%3AzipField&_netui%3AreturnActionCallback=Netui_OnPopupDone_1"
onclick='netui_popup("/coreWeb/miniTests/updateFormFromNestedPopup/getZip.do?_netui%3AreturnActionViewRenderer=org.apache.beehive.netui.tags.internal.ReturnActionViewRenderer&_netui%3AretrieveItem=outputFormBean.state%3AstateField&_netui%3AretrieveItem=outputFormBean.zip%3AzipField&_netui%3AreturnActionCallback=Netui_OnPopupDone_1","","width=550,height=150,location=0",false);return
false;'>look up</a>
+
+ </td>
+ </tr>
+ </table>
+ <br/>
+ <input type="submit" value="submit">
+ </form>
+
+
+
+<script language="JavaScript" type="text/JavaScript">
+<!--
+
+// **** This section contains code that will run when the page is loaded ****
+
+
+// Build the netui_names table to map the tagId attributes
+// to the real id written into the HTML
+if (netui_names == null)
+ var netui_names = new Object();
+netui_names.stateField="{actionForm.state}"
+netui_names.zipField="{actionForm.zip}"
+
+
+// Build the netui_names table to map the tagId attributes
+// to the real id written into the HTML
+if (netui_tagIdNameMap == null)
+ var netui_tagIdNameMap = new Object();
+netui_tagIdNameMap.stateField="{actionForm.state}"
+netui_tagIdNameMap.zipField="{actionForm.zip}"
+
+
+// **** This section contains functions typically run as events ****
+
+
+function netui_popup(url, name, features, replace)
+{
+ wnd=open(url, name, features, replace);
+ if (wnd.opener == null) wnd.opener=self;
+}
+
+function Netui_OnPopupDone_1(map)
+{
+ for (var i in map)
+ {
+ document.getElementById(i).value=map[i];
+ }
+}
+
+// method which will return a real id for a tagId,
+// the tag parameter will be used to find the idScope for
+// containers that may scope their ids
+function getNetuiTagName(id, tag)
+{
+ var idScope = getScopeId(tag);
+ if (idScope == "")
+ return netui_names[id];
+ else
+ return netui_names[idScope + "__" + id];
+}
+
+// This method will walk the hierarchy from the pass element looking for a
idScope.
+// The first idScope found will be returned or the empty string if a idScope
is not found.
+function getScopeId(tag)
+{
+ if (tag == null || tag.getAttribute == null)
+ return "";
+ var attrVal = tag.getAttribute("netui:idScope");
+ if (attrVal != null)
+ return attrVal;
+ return getScopeId(tag.parentNode);
+}
+
+// lookup by tagId to "real id"
+function lookupIdByTagId(id, tag)
+{
+ var idScope = lookupIdScope(tag,".");
+ return (idScope == "") ? id : idScope + id;
+}
+
+// lookup by tagId to "real name"
+function lookupNameByTagId(id, tag)
+{
+ var idScope = lookupIdScope(tag,"_");
+ if (idScope == "")
+ return netui_tagIdNameMap[id];
+ else
+ return netui_tagIdNameMap[idScope + "__" + id];
+}
+
+//Non-Legacy lookup method creating a fully qualified scope id
+function lookupIdScope(tag,sep)
+{
+ var val = "";
+ while (tag != null && tag.getAttribute != null) {
+ var attrVal = tag.getAttribute("netui:idScope");
+ if (attrVal != null)
+ val = attrVal + sep + val;
+ tag = tag.parentNode;
+ }
+ return val;
+}
+-->
+</script>
+
+</body>
+
+</html></ses:responseBody>
+ </ses:response>
+ </ses:test>
+ <ses:test>
+ <ses:testNumber>3</ses:testNumber>
+ <ses:request>
+ <ses:protocol>HTTP</ses:protocol>
+ <ses:protocolVersion>1.1</ses:protocolVersion>
+ <ses:host>localhost</ses:host>
+ <ses:port>8080</ses:port>
+
<ses:uri>/coreWeb/miniTests/updateFormFromNestedPopup/getZip.do</ses:uri>
+ <ses:method>GET</ses:method>
+ <ses:parameters>
+ <ses:parameter>
+ <ses:name>_netui:retrieveItem</ses:name>
+ <ses:value>outputFormBean.state:stateField</ses:value>
+ </ses:parameter>
+ <ses:parameter>
+ <ses:name>_netui:retrieveItem</ses:name>
+ <ses:value>outputFormBean.zip:zipField</ses:value>
+ </ses:parameter>
+ <ses:parameter>
+ <ses:name>_netui:returnActionCallback</ses:name>
+ <ses:value>Netui_OnPopupDone_1</ses:value>
+ </ses:parameter>
+ <ses:parameter>
+ <ses:name>_netui:returnActionViewRenderer</ses:name>
+
<ses:value>org.apache.beehive.netui.tags.internal.ReturnActionViewRenderer</ses:value>
+ </ses:parameter>
+ </ses:parameters>
+ <ses:cookies>
+ <ses:cookie>
+ <ses:name>JSESSIONID</ses:name>
+ <ses:value>B81EAA5A06371210B4460C6B4BE54357</ses:value>
+ </ses:cookie>
+ </ses:cookies>
+ <ses:headers>
+ <ses:header>
+ <ses:name>accept</ses:name>
+
<ses:value>text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5</ses:value>
+ </ses:header>
+ <ses:header>
+ <ses:name>accept-charset</ses:name>
+ <ses:value>ISO-8859-1,utf-8;q=0.7,*;q=0.7</ses:value>
+ </ses:header>
+ <ses:header>
+ <ses:name>accept-encoding</ses:name>
+ <ses:value>gzip,deflate</ses:value>
+ </ses:header>
+ <ses:header>
+ <ses:name>accept-language</ses:name>
+ <ses:value>en-us,en;q=0.5</ses:value>
+ </ses:header>
+ <ses:header>
+ <ses:name>connection</ses:name>
+ <ses:value>keep-alive</ses:value>
+ </ses:header>
+ <ses:header>
+ <ses:name>cookie</ses:name>
+
<ses:value>JSESSIONID=B81EAA5A06371210B4460C6B4BE54357</ses:value>
+ </ses:header>
+ <ses:header>
+ <ses:name>host</ses:name>
+ <ses:value>localhost:8080</ses:value>
+ </ses:header>
+ <ses:header>
+ <ses:name>keep-alive</ses:name>
+ <ses:value>300</ses:value>
+ </ses:header>
+ <ses:header>
+ <ses:name>referer</ses:name>
+
<ses:value>http://localhost:8080/coreWeb/miniTests/updateFormFromNestedPopup/submit.do</ses:value>
+ </ses:header>
+ <ses:header>
+ <ses:name>user-agent</ses:name>
+ <ses:value>Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US;
rv:1.7.5) Gecko/20041107 Firefox/1.0</ses:value>
+ </ses:header>
+ </ses:headers>
+ </ses:request>
+ <ses:response>
+ <ses:statusCode>200</ses:statusCode>
+ <ses:reason/>
+ <ses:responseBody><![CDATA[<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML
4.01 Transitional//EN"
+ "http://www.w3.org/TR/html4/loose.dtd">
+<html lang="en">
+
+ <head>
+ <base
href="http://localhost:8080/coreWeb/miniTests/updateFormFromNestedPopup/getZip/index.jsp">
+ </head>
+ <body>
+ <form name="zipForm"
action="/coreWeb/miniTests/updateFormFromNestedPopup/getZip/submitZip.do"
method="post">
+ <table>
+ <tr valign="top">
+ <td>Zip:</td>
+ <td>
+ <input type="text" name="{actionForm.zip}">
+ <span style="color:red"></span>
+ </td>
+ </tr>
+ </table>
+ <br/>
+ <input type="submit" value="submit">
+ <input type="submit" name="actionOverride:cancel" value="cancel">
+ </form>
+
+ </body>
+
+</html>]]></ses:responseBody>
+ </ses:response>
+ </ses:test>
+ <ses:test>
+ <ses:testNumber>4</ses:testNumber>
+ <ses:request>
+ <ses:protocol>HTTP</ses:protocol>
+ <ses:protocolVersion>1.1</ses:protocolVersion>
+ <ses:host>localhost</ses:host>
+ <ses:port>8080</ses:port>
+
<ses:uri>/coreWeb/miniTests/updateFormFromNestedPopup/getZip/submitZip.do</ses:uri>
+ <ses:method>POST</ses:method>
+ <ses:parameters>
+ <ses:parameter>
+ <ses:name>{actionForm.zip}</ses:name>
+ <ses:value>12345</ses:value>
+ </ses:parameter>
+ </ses:parameters>
+ <ses:cookies>
+ <ses:cookie>
+ <ses:name>JSESSIONID</ses:name>
+ <ses:value>B81EAA5A06371210B4460C6B4BE54357</ses:value>
+ </ses:cookie>
+ </ses:cookies>
+ <ses:headers>
+ <ses:header>
+ <ses:name>accept</ses:name>
+
<ses:value>text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5</ses:value>
+ </ses:header>
+ <ses:header>
+ <ses:name>accept-charset</ses:name>
+ <ses:value>ISO-8859-1,utf-8;q=0.7,*;q=0.7</ses:value>
+ </ses:header>
+ <ses:header>
+ <ses:name>accept-encoding</ses:name>
+ <ses:value>gzip,deflate</ses:value>
+ </ses:header>
+ <ses:header>
+ <ses:name>accept-language</ses:name>
+ <ses:value>en-us,en;q=0.5</ses:value>
+ </ses:header>
+ <ses:header>
+ <ses:name>connection</ses:name>
+ <ses:value>keep-alive</ses:value>
+ </ses:header>
+ <ses:header>
+ <ses:name>content-length</ses:name>
+ <ses:value>26</ses:value>
+ </ses:header>
+ <ses:header>
+ <ses:name>content-type</ses:name>
+ <ses:value>application/x-www-form-urlencoded</ses:value>
+ </ses:header>
+ <ses:header>
+ <ses:name>cookie</ses:name>
+
<ses:value>JSESSIONID=B81EAA5A06371210B4460C6B4BE54357</ses:value>
+ </ses:header>
+ <ses:header>
+ <ses:name>host</ses:name>
+ <ses:value>localhost:8080</ses:value>
+ </ses:header>
+ <ses:header>
+ <ses:name>keep-alive</ses:name>
+ <ses:value>300</ses:value>
+ </ses:header>
+ <ses:header>
+ <ses:name>referer</ses:name>
+
<ses:value>http://localhost:8080/coreWeb/miniTests/updateFormFromNestedPopup/getZip.do?_netui%3AreturnActionViewRenderer=org.apache.beehive.netui.tags.internal.ReturnActionViewRenderer&_netui%3AretrieveItem=outputFormBean.state%3AstateField&_netui%3AretrieveItem=outputFormBean.zip%3AzipField&_netui%3AreturnActionCallback=Netui_OnPopupDone_1</ses:value>
+ </ses:header>
+ <ses:header>
+ <ses:name>user-agent</ses:name>
+ <ses:value>Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US;
rv:1.7.5) Gecko/20041107 Firefox/1.0</ses:value>
+ </ses:header>
+ </ses:headers>
+ </ses:request>
+ <ses:response>
+ <ses:statusCode>200</ses:statusCode>
+ <ses:reason/>
+ <ses:responseBody><![CDATA[<html>
+ <head>
+ </head>
+ <body>
+ You have chosen <b>12345</b>, in <b>New York</b>.
+ Is this correct?
+ <br/>
+ <br/>
+ <form id="Netui_Form_0"
action="/coreWeb/miniTests/updateFormFromNestedPopup/getZip/done.do"
method="post">
+ <input type="submit" value="yes">
+ <input type="submit" name="actionOverride:begin" value="no">
+ </form>
+ </body>
+</html>]]></ses:responseBody>
+ </ses:response>
+ </ses:test>
+ <ses:test>
+ <ses:testNumber>5</ses:testNumber>
+ <ses:request>
+ <ses:protocol>HTTP</ses:protocol>
+ <ses:protocolVersion>1.1</ses:protocolVersion>
+ <ses:host>localhost</ses:host>
+ <ses:port>8080</ses:port>
+
<ses:uri>/coreWeb/miniTests/updateFormFromNestedPopup/getZip/done.do</ses:uri>
+ <ses:method>POST</ses:method>
+ <ses:parameters/>
+ <ses:cookies>
+ <ses:cookie>
+ <ses:name>JSESSIONID</ses:name>
+ <ses:value>B81EAA5A06371210B4460C6B4BE54357</ses:value>
+ </ses:cookie>
+ </ses:cookies>
+ <ses:headers>
+ <ses:header>
+ <ses:name>accept</ses:name>
+
<ses:value>text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5</ses:value>
+ </ses:header>
+ <ses:header>
+ <ses:name>accept-charset</ses:name>
+ <ses:value>ISO-8859-1,utf-8;q=0.7,*;q=0.7</ses:value>
+ </ses:header>
+ <ses:header>
+ <ses:name>accept-encoding</ses:name>
+ <ses:value>gzip,deflate</ses:value>
+ </ses:header>
+ <ses:header>
+ <ses:name>accept-language</ses:name>
+ <ses:value>en-us,en;q=0.5</ses:value>
+ </ses:header>
+ <ses:header>
+ <ses:name>connection</ses:name>
+ <ses:value>keep-alive</ses:value>
+ </ses:header>
+ <ses:header>
+ <ses:name>content-length</ses:name>
+ <ses:value>0</ses:value>
+ </ses:header>
+ <ses:header>
+ <ses:name>content-type</ses:name>
+ <ses:value>application/x-www-form-urlencoded</ses:value>
+ </ses:header>
+ <ses:header>
+ <ses:name>cookie</ses:name>
+
<ses:value>JSESSIONID=B81EAA5A06371210B4460C6B4BE54357</ses:value>
+ </ses:header>
+ <ses:header>
+ <ses:name>host</ses:name>
+ <ses:value>localhost:8080</ses:value>
+ </ses:header>
+ <ses:header>
+ <ses:name>keep-alive</ses:name>
+ <ses:value>300</ses:value>
+ </ses:header>
+ <ses:header>
+ <ses:name>referer</ses:name>
+
<ses:value>http://localhost:8080/coreWeb/miniTests/updateFormFromNestedPopup/getZip/submitZip.do</ses:value>
+ </ses:header>
+ <ses:header>
+ <ses:name>user-agent</ses:name>
+ <ses:value>Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US;
rv:1.7.5) Gecko/20041107 Firefox/1.0</ses:value>
+ </ses:header>
+ </ses:headers>
+ </ses:request>
+ <ses:response>
+ <ses:statusCode>200</ses:statusCode>
+ <ses:reason/>
+ <ses:responseBody><script language="JavaScript"
type="text/JavaScript">
+<!--
+var map = new Object();
+map["stateField"] = "New York";
+map["zipField"] = "12345";
+top.opener.Netui_OnPopupDone_1(map);
+window.close();
+-->
+</script></ses:responseBody>
+ </ses:response>
+ </ses:test>
+ <ses:test>
+ <ses:testNumber>6</ses:testNumber>
+ <ses:request>
+ <ses:protocol>HTTP</ses:protocol>
+ <ses:protocolVersion>1.1</ses:protocolVersion>
+ <ses:host>localhost</ses:host>
+ <ses:port>8080</ses:port>
+
<ses:uri>/coreWeb/miniTests/updateFormFromNestedPopup/submit.do</ses:uri>
+ <ses:method>POST</ses:method>
+ <ses:parameters>
+ <ses:parameter>
+ <ses:name>{actionForm.address}</ses:name>
+ <ses:value>123 Main St.</ses:value>
+ </ses:parameter>
+ <ses:parameter>
+ <ses:name>{actionForm.city}</ses:name>
+ <ses:value>Schenectady</ses:value>
+ </ses:parameter>
+ <ses:parameter>
+ <ses:name>{actionForm.name}</ses:name>
+ <ses:value>dick</ses:value>
+ </ses:parameter>
+ <ses:parameter>
+ <ses:name>{actionForm.state}</ses:name>
+ <ses:value>New York</ses:value>
+ </ses:parameter>
+ <ses:parameter>
+ <ses:name>{actionForm.zip}</ses:name>
+ <ses:value>12345</ses:value>
+ </ses:parameter>
+ </ses:parameters>
+ <ses:cookies>
+ <ses:cookie>
+ <ses:name>JSESSIONID</ses:name>
+ <ses:value>B81EAA5A06371210B4460C6B4BE54357</ses:value>
+ </ses:cookie>
+ </ses:cookies>
+ <ses:headers>
+ <ses:header>
+ <ses:name>accept</ses:name>
+
<ses:value>text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5</ses:value>
+ </ses:header>
+ <ses:header>
+ <ses:name>accept-charset</ses:name>
+ <ses:value>ISO-8859-1,utf-8;q=0.7,*;q=0.7</ses:value>
+ </ses:header>
+ <ses:header>
+ <ses:name>accept-encoding</ses:name>
+ <ses:value>gzip,deflate</ses:value>
+ </ses:header>
+ <ses:header>
+ <ses:name>accept-language</ses:name>
+ <ses:value>en-us,en;q=0.5</ses:value>
+ </ses:header>
+ <ses:header>
+ <ses:name>connection</ses:name>
+ <ses:value>keep-alive</ses:value>
+ </ses:header>
+ <ses:header>
+ <ses:name>content-length</ses:name>
+ <ses:value>157</ses:value>
+ </ses:header>
+ <ses:header>
+ <ses:name>content-type</ses:name>
+ <ses:value>application/x-www-form-urlencoded</ses:value>
+ </ses:header>
+ <ses:header>
+ <ses:name>cookie</ses:name>
+
<ses:value>JSESSIONID=B81EAA5A06371210B4460C6B4BE54357</ses:value>
+ </ses:header>
+ <ses:header>
+ <ses:name>host</ses:name>
+ <ses:value>localhost:8080</ses:value>
+ </ses:header>
+ <ses:header>
+ <ses:name>keep-alive</ses:name>
+ <ses:value>300</ses:value>
+ </ses:header>
+ <ses:header>
+ <ses:name>referer</ses:name>
+
<ses:value>http://localhost:8080/coreWeb/miniTests/updateFormFromNestedPopup/submit.do</ses:value>
+ </ses:header>
+ <ses:header>
+ <ses:name>user-agent</ses:name>
+ <ses:value>Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US;
rv:1.7.5) Gecko/20041107 Firefox/1.0</ses:value>
+ </ses:header>
+ </ses:headers>
+ </ses:request>
+ <ses:response>
+ <ses:statusCode>200</ses:statusCode>
+ <ses:reason/>
+ <ses:responseBody><![CDATA[<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML
4.01 Transitional//EN"
+ "http://www.w3.org/TR/html4/loose.dtd">
+<html lang="en">
+
+ <head>
+ <base
href="http://localhost:8080/coreWeb/miniTests/updateFormFromNestedPopup/results.jsp">
+ </head>
+ <body>
+ name: <b>dick</b>
+ <br/>
+ address: <b>123 Main St.</b>
+ <br/>
+ city: <b>Schenectady</b>
+ <br/>
+ state: <b>New York</b>
+ <br/>
+ zip: <b>12345</b>
+ <br/>
+ <br/>
+ <a href="/coreWeb/miniTests/updateFormFromNestedPopup/begin.do">start
over</a>
+ </body>
+
+</html>]]></ses:responseBody>
+ </ses:response>
+ </ses:test>
+ </ses:tests>
+ <ses:endDate>20 Jan 2005, 06:40:12.265 PM MST</ses:endDate>
+ <ses:testCount>6</ses:testCount>
+</ses:recorderSession>