Hi all,
> (<0.3201.0>) call wtype_date:validate({[{description,"Start date (YYYYMMDD)"},
> {format,"YYYYMMDD"},
> {optional,{2010,3,29}}],
> []})
The validate function here is called with [] since the user didn't set
any value in the form.
In wtype_date.erl, the validate function is expecting the atom
"undefined" instead, to trigger the search of the optional value.
validate({Types, undefined}) ->
case wpart_valid:is_private(Types) of
true ->
{ok, undefined};
false ->
case lists:keysearch(optional, 1, Types) of
{value, {optional, Default}} ->
{ok, Default};
_ ->
{error, {empty_input, undefined}}
end
end;
The wype_date.erl should match:
validate({Types, []}) ->
Or am I missing something?
Roberto Aloi
--
University of Kent - Erlang Solutions Ltd.
Twitter: @prof3ta
Blog: http://aloiroberto.wordpress.com
---------------------------------------------------
---------------------------------------------------
WE'VE CHANGED NAMES!
Since January 1st 2010 Erlang Training and Consulting Ltd. has become ERLANG
SOLUTIONS LTD.
www.erlang-solutions.com
------------------------------------------------------------------------------
Download Intel® Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
Erlangweb-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/erlangweb-users
http://www.erlang-web.org/