Commits

Luke Plant committed 4cc5991

Changed RadioButtonList.value to .selectedValue for clarity

Comments (0)

Files changed (2)

src/Ella/Forms/Widgets/RadioButtonList.hs

 
 
 data RadioButtonList = RadioButtonList {
-      value :: String
+      selectedValue :: String
     , name :: String
     , identifier :: String
     , values :: [String]
                                                       , identifier = if (not . null . identifier) rbl
                                                                      then identifier rbl ++ "_" ++ show idx
                                                                      else ""
-                                                      , checked = val == value rbl
+                                                      , checked = val == selectedValue rbl
                                                       }
                                        +++ " " +++ caption)
                            +++ X.br)
     getId t = identifier t
 
 instance HasVal RadioButtonList String where
-    setVal val t = t { value = val }
-    getVal t = value t
+    setVal val t = t { selectedValue = val }
+    getVal t = selectedValue t
 

testsuite/Tests/Ella/Forms/Widgets.hs

                              "<label>" ++
                              "<input type=\"radio\" name=\"foo\" value=\"val2\" id=\"id_foo_1\" />" ++
                              " Label 2</label><br />") ~=?
-                            (render $ RBL.RadioButtonList { value = "val1"
+                            (render $ RBL.RadioButtonList { selectedValue = "val1"
                                                           , name = "foo"
                                                           , identifier = "id_foo"
                                                           , values = ["val1", "val2"]