1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20 package org.apache.myfaces.custom.inputAjax;
21
22 import java.io.IOException;
23
24 import javax.faces.context.FacesContext;
25 import javax.faces.render.Renderer;
26
27 import org.apache.commons.logging.Log;
28 import org.apache.commons.logging.LogFactory;
29 import org.apache.myfaces.component.html.ext.HtmlSelectOneRadio;
30 import org.apache.myfaces.custom.ajax.AjaxCallbacks;
31 import org.apache.myfaces.custom.ajax.api.AjaxRenderer;
32 import org.apache.myfaces.custom.ajax.api.DeprecatedAjaxComponent;
33
34
35
36
37
38
39
40
41
42
43
44
45
46 public abstract class AbstractHtmlSelectOneRadioAjax extends HtmlSelectOneRadio implements DeprecatedAjaxComponent, AjaxCallbacks
47 {
48 private static final Log log = LogFactory.getLog(AbstractHtmlSelectOneRadioAjax.class);
49 public static final String COMPONENT_TYPE = "org.apache.myfaces.HtmlSelectOneRadioAjax";
50 public static final String DEFAULT_RENDERER_TYPE = "org.apache.myfaces.SelectOneRadioAjax";
51
52 public AbstractHtmlSelectOneRadioAjax()
53 {
54 super();
55 setRendererType(DEFAULT_RENDERER_TYPE);
56 }
57
58
59
60
61
62
63 public void decodeAjax(FacesContext context)
64 {
65 log.debug("entering HtmlSelectOneRadioAjax.decodeAjax");
66
67 processDecodes(context);
68 processValidators(context);
69 processUpdates(context);
70
71 if (log.isDebugEnabled())
72 {
73 Object valOb = this.getValue();
74 log.debug("value object after decodeAjax: " + valOb);
75 }
76 }
77
78 public void encodeAjax(FacesContext context) throws IOException
79 {
80
81 if (context == null) throw new NullPointerException("context");
82 if (!isRendered()) return;
83 Renderer renderer = getRenderer(context);
84
85 if (renderer != null && renderer instanceof AjaxRenderer)
86 {
87 ((AjaxRenderer) renderer).encodeAjax(context, this);
88
89 }
90 }
91
92
93
94
95
96
97 public abstract String getOnSuccess();
98
99
100
101
102
103
104 public abstract String getOnFailure();
105
106
107
108
109
110
111 public abstract String getOnStart();
112
113 }