Restructured validators, fixed form element rendering

This commit is contained in:
Severin Münger
2013-09-05 16:51:51 +02:00
parent 6486c8c472
commit f52f6512a0
4 changed files with 37 additions and 3 deletions

View File

@@ -0,0 +1,21 @@
note
description: "Summary description for {WSF_PHONE_NUMBER_VALIDATOR}."
author: ""
date: "$Date$"
revision: "$Revision$"
class
WSF_PHONE_NUMBER_VALIDATOR
inherit
WSF_VALIDATOR[STRING]
create
make
feature -- Implementation
validate(input:STRING):BOOLEAN
do
end
end

View File

@@ -20,6 +20,7 @@ feature {NONE}
do
make (n, "div")
add_class ("form-group")
c.add_class ("form-control")
value_control := c
validators := v
label := ""
@@ -56,11 +57,11 @@ feature --Implementation
render: STRING
local
body:STRING
body: STRING
do
body := ""
if not label.is_empty then
body := "<label class=%"col-lg-10 control-label%" for=%"" + value_control.control_name + "%">" + label + "</label>"
body := "<label class=%"col-lg-2 control-label%" for=%"" + value_control.control_name + "%">" + label + "</label>"
end
body := body + "<div class=%"col-lg-10%">"
body := body + value_control.render

View File

@@ -7,6 +7,13 @@ note
deferred class
WSF_VALIDATOR [G]
feature {NONE}
make (e: STRING)
do
error := e
end
feature
validate (input: G): BOOLEAN