#custom validator doesnt get evaluated but #is_required does

11 views
Skip to first unread message

Franklin Brauning

unread,
Nov 30, 2016, 3:13:20 PM11/30/16
to Nitrogen Project / The Nitrogen Web Framework for Erlang
I Have a button whose event(doit) -> ...       calls add_item()

What add_item() is somethin like this

add_item() ->
   Textbox = #textbox { id=mytextbox... },
   wf:insert_bottom("#some_id", Textbox),
  wf:flush(),
   wf:wire(submit, mytext, #validate { validators = ... }),
   wf:flush().

Now, when I validate with #is_required, the validation takes places before submitting (ok),
 but if I try with #custom function it never gets triggered at all.


Franklin Brauning

unread,
Dec 1, 2016, 8:41:27 AM12/1/16
to Nitrogen Project / The Nitrogen Web Framework for Erlang
OK, I was wiring the validators (wf:wire(...)) in the context of a comet function.
I inlined that wiring into the event(...) function itself and now the validators get triggered.

The question now is, whose flaw is this?
  Nitrogen? (wiring #is_required from comet function works but #custom doesn't
  Me? (are comet processes supposed to push validators into the page?)

Jesse Gumm

unread,
Dec 1, 2016, 2:17:58 PM12/1/16
to nitrogenweb
Hi Franklin,

This is definitely a bug in Nitrogen. Thanks for pointing it out.

-Jesse

--
You received this message because you are subscribed to the Google Groups "Nitrogen Project / The Nitrogen Web Framework for Erlang" group.
To unsubscribe from this group and stop receiving emails from it, send an email to nitrogenweb+unsubscribe@googlegroups.com.
To post to this group, send email to nitro...@googlegroups.com.
Visit this group at https://groups.google.com/group/nitrogenweb.
For more options, visit https://groups.google.com/d/optout.



--
Jesse Gumm
Owner, Sigma Star Systems
414.940.4866 || sigma-star.com || @jessegumm
Reply all
Reply to author
Forward
0 new messages