01: /*
02: * Copyright Javelin Software, All rights reserved.
03: */
04:
05: package com.javelin.swinglets.event;
06:
07: /**
08: * ScriptedFormListener is used to determine what happens when
09: * a Scripted Event happens, such as a JavaScript event on the client
10: * browser.
11: *
12: * @author Robin Sharp
13: */
14:
15: public class ScriptedFormListener extends ScriptedListener implements
16: FormListener {
17: public final static String FORM_SUBMITTED = "onsubmit";
18: public final static String FORM_RESET = "onreset";
19:
20: /**
21: * Construct a listener with the script content type.
22: */
23: public ScriptedFormListener(String contentType) {
24: super (contentType);
25: }
26:
27: /**
28: * Get the component Hidden Script.
29: */
30: public Object getFormSubmittedScript() {
31: return get(FORM_SUBMITTED);
32: }
33:
34: /**
35: * Get the form Submitted Script.
36: */
37: public ScriptedFormListener setFormSubmittedScript(
38: Object formSubmittedScript) {
39: put(FORM_SUBMITTED, formSubmittedScript);
40: return this ;
41: }
42:
43: /**
44: * Get the component Hidden Script.
45: */
46: public Object getFormResetScript() {
47: return get(FORM_RESET);
48: }
49:
50: /**
51: * Get the form Reset Script.
52: */
53: public ScriptedFormListener setFormResetScript(
54: Object formResetScript) {
55: put(FORM_RESET, formResetScript);
56: return this ;
57: }
58:
59: // STUB EVENT HANDLERS /////////////////////////////////////////////////////
60:
61: public void formSubmitted(FormEvent formEvent) {
62: };
63:
64: public void formReset(FormEvent formEvent) {
65: };
66:
67: // PRIVATE /////////////////////////////////////////////////////////////////
68:
69: }
|