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 do
make (n, "div") make (n, "div")
add_class ("form-group") add_class ("form-group")
c.add_class ("form-control")
value_control := c value_control := c
validators := v validators := v
label := "" label := ""
@@ -56,11 +57,11 @@ feature --Implementation
render: STRING render: STRING
local local
body:STRING body: STRING
do do
body := "" body := ""
if not label.is_empty then 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 end
body := body + "<div class=%"col-lg-10%">" body := body + "<div class=%"col-lg-10%">"
body := body + value_control.render body := body + value_control.render

View File

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

View File

@@ -11,6 +11,9 @@
</option> </option>
<library name="base" location="$ISE_LIBRARY\library\base\base-safe.ecf"/> <library name="base" location="$ISE_LIBRARY\library\base\base-safe.ecf"/>
<library name="encoder" location="..\..\text\encoder\encoder-safe.ecf"/> <library name="encoder" location="..\..\text\encoder\encoder-safe.ecf"/>
<library name="gobo_kernel" location="$ISE_LIBRARY\library\gobo\gobo_kernel-safe.ecf"/>
<library name="gobo_lexical" location="$ISE_LIBRARY\library\gobo\gobo_lexical-safe.ecf"/>
<library name="gobo_parse" location="$ISE_LIBRARY\library\gobo\gobo_parse-safe.ecf"/>
<library name="http" location="..\..\network\protocol\http\http-safe.ecf"/> <library name="http" location="..\..\network\protocol\http\http-safe.ecf"/>
<library name="json" location="..\..\..\contrib\library\text\parser\json\library\json-safe.ecf"/> <library name="json" location="..\..\..\contrib\library\text\parser\json\library\json-safe.ecf"/>
<library name="uri_template" location="..\..\text\parser\uri_template\uri_template-safe.ecf"/> <library name="uri_template" location="..\..\text\parser\uri_template\uri_template-safe.ecf"/>
@@ -18,7 +21,9 @@
<cluster name="api" location=".\api\" recursive="true"/> <cluster name="api" location=".\api\" recursive="true"/>
<cluster name="css" location=".\css\" recursive="true"/> <cluster name="css" location=".\css\" recursive="true"/>
<cluster name="form" location=".\form\" recursive="true"/> <cluster name="form" location=".\form\" recursive="true"/>
<cluster name="webcontrol" location=".\webcontrol\"/> <cluster name="webcontrol" location=".\webcontrol\">
<cluster name="validators" location=".\webcontrol\validators\"/>
</cluster>
<cluster name="widget" location=".\widget\" recursive="true"/> <cluster name="widget" location=".\widget\" recursive="true"/>
</target> </target>
</system> </system>