Zotonic
Zotonic
zotonic@conference.zotonic.com
Wednesday, 3 July 2013< ^ >
Arjan has set the subject to: Zotonic - The Erlang Web Framework & CMS
Room Configuration

GMT+2
[04:20:54] bronzeboyvn joins the room
[08:56:07] arjan joins the room
[08:56:51] arjan leaves the room
[08:59:34] arjan joins the room
[09:05:07] Marc Worrell leaves the room: Disconnected: connection closed
[09:34:11] Piotr Nosek joins the room
[10:35:38] mawuli.ypa joins the room
[10:50:52] Maas joins the room
[11:09:56] mawuli.ypa leaves the room
[11:22:35] mawuli.ypa joins the room
[12:16:49] Piotr Nosek leaves the room
[12:53:36] mawuli.ypa leaves the room
[12:55:11] mawuli.ypa joins the room
[12:57:30] mawuli.ypa leaves the room
[12:59:28] mawuli.ypa joins the room
[13:36:05] bronzeboyvn leaves the room
[14:03:26] Jeff Bell joins the room
[14:34:25] mawuli.ypa leaves the room
[14:50:07] Piotr Nosek joins the room
[15:28:57] arcusfelis joins the room
[16:44:50] arjan leaves the room
[17:05:22] Maas leaves the room
[17:38:38] jeff.5nines leaves the room
[18:14:45] jeff.5nines joins the room
[18:47:51] mawuli.ypa joins the room
[20:48:56] cillian.deroiste joins the room
[21:02:02] <Piotr Nosek> Hello again. :) I have a problem with postback handler. Context passed to event/2 has following element:
[{q_validated,[]},
{session_id,"Ot5UkiW6HW9uR0MCF2bG"},
{q,[{"zotonic_host","myhost"},
{"zotonic_dispatch","postback"},
{"postback",
"QJ1i9avI6wSrwvvxBfBJK77C9_WDaAVrAAZzdWJtaXRrAAxuZXdfZGVsZWdhdGVrAAxuZXdfZGVsZWdhdGVkAAxhZGRfZGVsZWdhdGVkAAxlZl9kZWxlZ2F0ZXM"},
{"z_trigger_id","new_person"},
{"z_pageid","WsIOwrldRCNXDWoYLp5w"},
{"admission","2"},
{"first_name","Piotr"},
{"last_name","Nosek"},
{"email","e@a.com"},
{"triggervalue",[]}]},
{no_session,true},
{ssl,any},
{zotonic_dispatch,postback}]}
but following list contruction:
[
{admission, z_context:get("admission", Context)},
{first_name, z_context:get("first_name", Context)},
{last_name, z_context:get("last_name", Context)},
{email, z_context:get("email", Context)}
]
returns
[ {admission,undefined},
{first_name,undefined},
{last_name,undefined},
{email,undefined}]
What have I done wrong? :)
[21:07:01] arcusfelis leaves the room
[21:38:08] <jeff.5nines> Hi Piotr, I think you may need to use z_context:get_q("admission", Context) or z_context:get_q_validated("admission", Context)
[21:47:17] <jeff.5nines> Actually I see for your case is z_context_q.
[21:47:34] <jeff.5nines> z_context:get_q :)
[22:10:19] mawuli.ypa leaves the room
[22:10:46] mawuli.ypa joins the room
[22:29:12] <Piotr Nosek> Thanks, indeed it worked. :) I'm wondering though why get_q_validated doesn't work, even after adding "validate" tags:
<u>First name:</u><input name="first_name" id="first_name" type="text"/><br />
{% validate id="first_name" type="{length minimum=1}" %}
<u>Last name:</u><input name="last_name" id="last_name" type="text"/><br />
{% validate id="last_name" type="{length minimum=1}" %}
<u>E-mail:</u><input name="email" id="email" type="email"/><br /><br />
{% validate id="email_name" type="{email}" %}
[22:50:56] <Piotr Nosek> Also how can I execute action after postback has been *successfuly* done? It seems that "action" parameter executes action even on postback error.
[22:51:57] <Piotr Nosek> Or perhaps can I return some value from event/2 that would define an action to be executed?
[23:15:41] <jeff.5nines> Does your template validation work? meaning does it enforce validation on the form? If not the validation script is not working. Other than that it looks like it should work.
[23:16:52] <jeff.5nines> Make sure you have "js/modules/livevalidation-1.3.js" enabled somewhere in your includes
[23:19:06] <jeff.5nines> As for follow-up actions, you can wire events back from within event/2. I have to pick up my kids right now but I'll try to send you a gist or something later
[23:19:21] jeff.5nines leaves the room
[23:22:50] <Piotr Nosek> Sure, no hurry. :)
[23:23:19] <Piotr Nosek> Does "validate" work only on client side? I thought it also automatically enforces server-side validation.
[23:52:29] mawuli.ypa leaves the room
[23:52:37] Mawuli Adzaku joins the room
Powered by ejabberd Powered by Erlang Valid XHTML 1.0 Transitional Valid CSS!