01: /*
02: * Created on Nov 1, 2005
03: */
04: package uk.org.ponder.rsf.componentprocessor;
05:
06: import java.util.HashMap;
07: import java.util.Map;
08:
09: import uk.org.ponder.rsf.components.UIComponent;
10: import uk.org.ponder.rsf.components.UIForm;
11:
12: public class BasicFormModel implements FormModel {
13: // this is a map of component IDs in this container, to their parent
14: // form.
15: private Map componentToForm = new HashMap();
16:
17: public void registerChild(UIForm parent, UIComponent submitting) {
18: componentToForm.put(submitting, parent);
19: }
20:
21: public UIForm formForComponent(UIComponent component) {
22: return (UIForm) componentToForm.get(component);
23: }
24:
25: // For CONTAINMENT forms, we can render fossilized fields alongside their
26: // owners. For EXTERNAL (WAP) forms, it MUST be that the submitting controls
27: // FOLLOW their targets in the rendered file, otherwise we cannot determine
28: // whether a control will be suppressed or not.
29: // HENCE: for CONTAINMENT forms, each individual BOUND renders the fossil
30: // alongside itself. For EXTERNAL forms, we have the problem of knowing
31: // whether something has been rendererd, but it is easy to "find" the
32: // ID of the component fossil. IS IT?? Well, we can deal with that when
33: // it comes.
34: }
|