Added ability to show/hide border of form elements
This commit is contained in:
@@ -21,25 +21,33 @@ inherit
|
|||||||
WSF_VALIDATABLE
|
WSF_VALIDATABLE
|
||||||
|
|
||||||
create
|
create
|
||||||
make, make_with_validators
|
make, make_without_border, make_with_validators
|
||||||
|
|
||||||
feature {NONE} -- Initialization
|
feature {NONE} -- Initialization
|
||||||
|
|
||||||
|
make_without_border (a_label: detachable STRING; c: WSF_VALUE_CONTROL [G])
|
||||||
|
-- Initialize form element control with a specific label (or 'Void' for no label) and value control
|
||||||
|
do
|
||||||
|
make_with_validators (a_label, False, c, create {ARRAYED_LIST [WSF_VALIDATOR [G]]}.make (0))
|
||||||
|
end
|
||||||
|
|
||||||
make (a_label: detachable STRING; c: WSF_VALUE_CONTROL [G])
|
make (a_label: detachable STRING; c: WSF_VALUE_CONTROL [G])
|
||||||
-- Initialize form element control with a specific label (or 'Void' for no label) and value control
|
-- Initialize form element control with a specific label (or 'Void' for no label) and value control
|
||||||
do
|
do
|
||||||
make_with_validators (a_label, c, create {ARRAYED_LIST [WSF_VALIDATOR [G]]}.make (0))
|
make_with_validators (a_label, True, c, create {ARRAYED_LIST [WSF_VALIDATOR [G]]}.make (0))
|
||||||
end
|
end
|
||||||
|
|
||||||
make_with_validators (a_label: detachable STRING; c: WSF_VALUE_CONTROL [G]; v: LIST [WSF_VALIDATOR [G]])
|
make_with_validators (a_label: detachable STRING; show_border: BOOLEAN; c: WSF_VALUE_CONTROL [G]; v: LIST [WSF_VALIDATOR [G]])
|
||||||
-- Initialize form element control with a specific label (or 'Void' for no label), value control and list of validators
|
-- Initialize form element control with a specific label (or 'Void' for no label), value control and list of validators
|
||||||
do
|
do
|
||||||
make_control ("div")
|
make_control ("div")
|
||||||
add_class ("form-group")
|
add_class ("form-group")
|
||||||
if not attached {WSF_VALUE_CONTROL [LIST [ANY]]} c then
|
if show_border then
|
||||||
c.add_class ("form-control")
|
if not attached {WSF_VALUE_CONTROL [LIST [ANY]]} c then
|
||||||
else
|
c.add_class ("form-control")
|
||||||
c.add_class ("form-control-static")
|
else
|
||||||
|
c.add_class ("form-control-static")
|
||||||
|
end
|
||||||
end
|
end
|
||||||
label_width := 2
|
label_width := 2
|
||||||
value_control := c
|
value_control := c
|
||||||
@@ -51,6 +59,7 @@ feature {NONE} -- Initialization
|
|||||||
feature
|
feature
|
||||||
|
|
||||||
set_label_width (w: INTEGER)
|
set_label_width (w: INTEGER)
|
||||||
|
-- Set the label span (a value between 1 and 12 to specify the bootstrap column span or 0 for not displaying the label)
|
||||||
do
|
do
|
||||||
label_width := w
|
label_width := w
|
||||||
end
|
end
|
||||||
@@ -210,5 +219,6 @@ feature -- Properties
|
|||||||
-- The error message that is displayed when client side validation fails
|
-- The error message that is displayed when client side validation fails
|
||||||
|
|
||||||
label_width: INTEGER
|
label_width: INTEGER
|
||||||
|
-- The bootstrap column span of the label of this form element control
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user