1 package net.sf.tacos.components;
2
3 import java.util.HashMap;
4 import java.util.Map;
5
6 import org.apache.tapestry.BaseComponent;
7 import org.apache.tapestry.IMarkupWriter;
8 import org.apache.tapestry.IRequestCycle;
9 import org.apache.tapestry.IScript;
10 import org.apache.tapestry.TapestryUtils;
11 import org.apache.tapestry.form.IFormComponent;
12
13
14
15
16
17
18
19 public abstract class FieldHint extends BaseComponent {
20
21
22
23 protected void renderComponent(IMarkupWriter writer, IRequestCycle cycle) {
24 writer.begin("span");
25 renderIdAttribute(writer, cycle);
26 writer.appendAttribute("class", "hint");
27 renderBody(writer, cycle);
28 super.renderComponent(writer, cycle);
29 writer.end();
30
31 if (!cycle.isRewinding()) {
32 Map parms = new HashMap();
33 parms.put("component", this);
34 parms.put("startEvent", getStartEvent());
35 parms.put("endEvent", getEndEvent());
36
37 getScript().execute(this, cycle, TapestryUtils.getPageRenderSupport(cycle, this), parms);
38 }
39 }
40
41
42 public abstract IScript getScript();
43
44
45 public abstract IFormComponent getField();
46
47
48 public abstract String getStartEvent();
49
50
51 public abstract String getEndEvent();
52 }