getting form data

0 views
Skip to first unread message

Jrad

unread,
Jun 9, 2010, 2:26:06 AM6/9/10
to jquery-claypool
Howdy,
Is there any way to access form(:inputs) data in Claypool controllers/
models? I'm afraid I was only successful to access them with

jquery $('myInputId').val()

and this is gross code in Controllers or Models! I was expecting to
access them via event.m()!!!

chris thatcher

unread,
Jun 9, 2010, 9:51:11 AM6/9/10
to jquery-...@googlegroups.com
Thats a nice point.  There are a couple ways I can think to approach this.  Claypool now has a 'normalize' function built into the $.router plugin, and it's purpose is to add data to the event state which is accessible via the event.params() in the controller.  This is how posted form data becomes accessible to a serverside controller, and it would make sense then that the parallel would apply to form submission events.  does this approach sound ok?  I can have it in by lunch time I bet.

Thatcher


--
You received this message because you are subscribed to the Google Groups "jquery-claypool" group.
To post to this group, send email to jquery-...@googlegroups.com.
To unsubscribe from this group, send email to jquery-claypo...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/jquery-claypool?hl=en.




--
Christopher Thatcher

Jrad

unread,
Jun 10, 2010, 3:15:35 AM6/10/10
to jquery-claypool
I'm using the view-method-with-callback approach. something like:

view = $.$('#myViewView');
view.collectData( function( model ) {
/* callback to get model */
});

but i thing that's not a neat solution code! So,
I think accessing view data with event.params() OR event.m() (via
flash attay object name/value pairs)
is OK. I wish you would have it in! :)
And another clarification i need:
event.m() (and flash object) is a way to transfer state data from
controllers/models to views and since a ONE-WAY state transferrer!
to transfer data from views (forms) back to controllers we should use
event.params() !? Could you make event.m() TWO-WAY?!

On Jun 9, 5:51 pm, chris thatcher <thatcher.christop...@gmail.com>
wrote:
> Thats a nice point.  There are a couple ways I can think to approach this.
> Claypool now has a 'normalize' function built into the $.router plugin, and
> it's purpose is to add data to the event state which is accessible via the
> event.params() in the controller.  This is how posted form data becomes
> accessible to a serverside controller, and it would make sense then that the
> parallel would apply to form submission events.  does this approach sound
> ok?  I can have it in by lunch time I bet.
>
> Thatcher
>
>
>
> On Wed, Jun 9, 2010 at 2:26 AM, Jrad <behr...@gmail.com> wrote:
> > Howdy,
> > Is there any way to access form(:inputs) data in Claypool controllers/
> > models? I'm afraid I was only successful to access them with
>
> > jquery $('myInputId').val()
>
> > and this is gross code in Controllers or Models! I was expecting to
> > access them via event.m()!!!
>
> > --
> > You received this message because you are subscribed to the Google Groups
> > "jquery-claypool" group.
> > To post to this group, send email to jquery-...@googlegroups.com.
> > To unsubscribe from this group, send email to
> > jquery-claypo...@googlegroups.com<jquery-claypool%2Bunsu...@googlegroups.com>
> > .
Reply all
Reply to author
Forward
0 new messages