summaryrefslogtreecommitdiff
path: root/wotonomy-web-test/src/main/webapp/WEB-INF/classes/Main.java
diff options
context:
space:
mode:
authorBenjamin Culkin <scorpress@gmail.com>2024-05-21 17:07:23 -0400
committerBenjamin Culkin <scorpress@gmail.com>2024-05-21 17:07:23 -0400
commit8283e417245b26abd290f7e6fd0511869802fc82 (patch)
treeab9a6b3593d4ce5b059dbcd723fdc112edd2613d /wotonomy-web-test/src/main/webapp/WEB-INF/classes/Main.java
parent59b10ba33f4c0b1d399b5d31b7a07380abb62677 (diff)
Rename to avoid name conflict
Diffstat (limited to 'wotonomy-web-test/src/main/webapp/WEB-INF/classes/Main.java')
-rw-r--r--wotonomy-web-test/src/main/webapp/WEB-INF/classes/Main.java54
1 files changed, 54 insertions, 0 deletions
diff --git a/wotonomy-web-test/src/main/webapp/WEB-INF/classes/Main.java b/wotonomy-web-test/src/main/webapp/WEB-INF/classes/Main.java
new file mode 100644
index 0000000..a12ca44
--- /dev/null
+++ b/wotonomy-web-test/src/main/webapp/WEB-INF/classes/Main.java
@@ -0,0 +1,54 @@
+import net.wotonomy.foundation.NSDate;
+import net.wotonomy.web.*;
+
+public class Main extends WOComponent {
+
+ private boolean showing;
+ private String textFieldValue;
+
+ public Main() {
+ super();
+ showing = true;
+ }
+
+ public NSDate getCurrentTime() {
+ return new NSDate();
+ }
+
+ public boolean getShowTime() {
+ return showing;
+ }
+ public void setShowTime(boolean value) {
+ showing = value;
+ }
+
+ public WOActionResults submit() {
+ System.out.println("Form Submitted");
+ System.out.println("textfield says '" + getTextValue() + "'");
+ return null;
+ }
+
+ public void takeValuesFromRequest(WORequest r, WOContext c) {
+ System.out.println("taking values from request");
+ if (r.formValueForKey("show") != null)
+ setShowTime(r.formValueForKey("show").equals("true"));
+ }
+
+ public String getTimeLinkString() {
+ return showing ? "Hide the time display" : "Show time display";
+ }
+
+ public void setTextValue(String value) {
+ textFieldValue = value;
+ }
+ public String getTextValue() {
+ return textFieldValue;
+ }
+
+ public WOComponent switchTime() {
+ System.out.println("switching time display");
+ setShowTime(!getShowTime());
+ return this;
+ }
+
+}