1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20 package net.sf.jameleon.plugin.jiffie.tags;
21
22 /***
23 * This action point sets the value of any radio button.
24 *
25 * Some example uses might be:
26 *
27 * Selecting a radio button <input type="radio" name="radioButton" value="radio1"><input type="radio" name="radioButton" value="radio2">
28 * <pre><source>
29 * <ie-set-radiobutton functionId="Check the second radio button"
30 * name="radioButton"
31 * value="radio2"
32 * form="testForm"/>
33 * </source></pre>
34 *
35 * NOTE: <b>This tag does not currently support the xpath attribute nor the nested ie-attribute tags.</b>
36 * @jameleon.function name="ie-set-radiobutton" type="action"
37 * @jameleon.step Find the given form and set it as the working form
38 * @jameleon.step Find the given radio button and check it
39 */
40 public class IESetRadiobuttonTag extends IEFireEventTag {
41
42 /***
43 * The name of the radio button
44 * @jameleon.attribute required="true" contextName="ieSetRadiobuttonName"
45 */
46 protected String name;
47
48 /***
49 * Check the radio button with given value.
50 * @jameleon.attribute required="true" contextName="ieSetRadiobuttonValue"
51 */
52 protected String value;
53
54 /***
55 * The name, id or index of the field
56 * @jameleon.attribute contextName="ieSetRadiobuttonForm"
57 */
58 protected String form;
59
60 public void testBlock() {
61 if (htmlElement != null ||
62 xpath != null ||
63 getParamLength() > 0) {
64 throw new RuntimeException("htmlElement, xpath and ie-attribute are not supported by this tag");
65 }
66 setWorkingForm(form);
67 fireEvent(setRadioButtonValue(name, value));
68
69 }
70 }