01: /*
02: * Copyright 2001-2007 Geert Bevin <gbevin[remove] at uwyn dot com>
03: * Distributed under the terms of either:
04: * - the common development and distribution license (CDDL), v1.0; or
05: * - the GNU Lesser General Public License, v2.1 or later
06: * $Id: ParampassParent2.java 3634 2007-01-08 21:42:24Z gbevin $
07: */
08: package com.uwyn.rife.engine.testelements.inheritance;
09:
10: import com.uwyn.rife.engine.Element;
11:
12: public class ParampassParent2 extends Element {
13: public void processElement() {
14: if (getInput("globalvar1").equals("stage1a")
15: && getInput("globalvar2").equals("stage2a")) {
16: if (hasSubmission("activatechildparent2")) {
17: if (getParameter("activationparent2").equals(
18: "go to child")) {
19: setOutput("globalvar1", "stage1b");
20: setOutput("globalvar2", "stage2b");
21: setOutput("trigger", "ok");
22: }
23: }
24:
25: print("<html><body>\n");
26: print("<form name=\"formparent2\" action=\""
27: + getSubmissionFormUrl() + "\" method=\"post\">\n");
28: print(getSubmissionFormParameters("activatechildparent2"));
29: print("<input name=\"activationparent2\" type=\"text\">\n");
30: print("<input type=\"submit\">\n");
31: print("</form>\n");
32: print("</body></html>\n");
33: }
34: }
35:
36: public boolean childTriggered(String name, String[] values) {
37: if (name.equals("trigger") && values[0].equals("ok")) {
38: return true;
39: } else {
40: return false;
41: }
42: }
43: }
|