Rename validators, Make forms resizable
This commit is contained in:
@@ -359,7 +359,7 @@ class WSF_INPUT_CONTROL extends WSF_CONTROL
|
||||
if state.text?
|
||||
@state['text'] = state.text
|
||||
@$el.val(state.text)
|
||||
|
||||
|
||||
class WSF_PASSWORD_CONTROL extends WSF_INPUT_CONTROL
|
||||
|
||||
class WSF_NAVLIST_ITEM_CONTROL extends WSF_BUTTON_CONTROL
|
||||
@@ -489,7 +489,7 @@ class WSF_FORM_ELEMENT_CONTROL extends WSF_CONTROL
|
||||
if message.length>0
|
||||
@$el.addClass("has-error")
|
||||
errordiv = $("<div />").addClass('help-block').addClass('validation').text(message)
|
||||
@$el.find(".col-lg-10").append(errordiv)
|
||||
@$el.children("div").append(errordiv)
|
||||
|
||||
update: (state) ->
|
||||
if state.error?
|
||||
|
||||
@@ -817,7 +817,7 @@ WSF_FORM_ELEMENT_CONTROL = (function(_super) {
|
||||
if (message.length > 0) {
|
||||
this.$el.addClass("has-error");
|
||||
errordiv = $("<div />").addClass('help-block').addClass('validation').text(message);
|
||||
return this.$el.find(".col-lg-10").append(errordiv);
|
||||
return this.$el.children("div").append(errordiv);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -35,13 +35,13 @@ feature
|
||||
--Number 1
|
||||
create textbox1.make ("1")
|
||||
create n1_container.make ("Number1", textbox1)
|
||||
n1_container.add_validator (create {WSF_DECIMAL_VALIDATOR}.make_decimal_validator ("Invalid Number"))
|
||||
n1_container.add_validator (create {WSF_DECIMAL_VALIDATOR}.make ("Invalid Number"))
|
||||
n1_container.add_validator (create {OWN_VALIDATOR}.make_own)
|
||||
form.add_control (n1_container)
|
||||
--Number 2
|
||||
create textbox2.make ("2")
|
||||
create n2_container.make ("Number2", textbox2)
|
||||
n2_container.add_validator (create {WSF_DECIMAL_VALIDATOR}.make_decimal_validator ("Invalid Number"))
|
||||
n2_container.add_validator (create {WSF_DECIMAL_VALIDATOR}.make ("Invalid Number"))
|
||||
form.add_control (n2_container)
|
||||
--Flag autocomplete
|
||||
create autocompletion1.make (create {FLAG_AUTOCOMPLETION}.make)
|
||||
@@ -61,8 +61,8 @@ feature
|
||||
cklist.add_control (create {WSF_CHECKBOX_CONTROL}.make ("Operating Systems", "os"))
|
||||
cklist.add_control (create {WSF_CHECKBOX_CONTROL}.make ("Formal Methods and Functional Programming", "fmfp"))
|
||||
create cats_container.make ("Categories", cklist)
|
||||
cats_container.add_validator (create {WSF_MIN_VALIDATOR [LIST[STRING]]}.make_min_validator (1, "Choose at least one category"))
|
||||
cats_container.add_validator (create {WSF_MAX_VALIDATOR [LIST[STRING]]}.make_max_validator (2, "Choose at most two category"))
|
||||
cats_container.add_validator (create {WSF_MIN_VALIDATOR [LIST[STRING]]}.make (1, "Choose at least one category"))
|
||||
cats_container.add_validator (create {WSF_MAX_VALIDATOR [LIST[STRING]]}.make (2, "Choose at most two category"))
|
||||
form.add_control (cats_container)
|
||||
--Button 1
|
||||
create button1.make ("Update")
|
||||
|
||||
Reference in New Issue
Block a user