On Fri, 24 Oct 2014 13:07:52 -0200, Dmitry Gusev <dmitry.gu...@gmail.com>
wrote:
Hello,
Hi!
Just wonder if anybody have any ideas how we can deprecate usage os
<input name="t:formdata" /> element?
I'd too love to get rid of that . . .
Tapestry5.x form submission logic heavily relies on the value of
t:formdata at the moment.
This approach just doesn't play well with REST. Which means in practice
that we can't integrate well with modern JS frameworks when we talk about
form submissions.
I may be wrong (and I often am), but I think using Tapestry 5 form stuff
for REST endpoints doesn't make much sense. Tapestry form components and
its server-side handling (t:formdata included) were built with the
assumption to be used with each other. On the other hand, REST endpoints,
as far as I know, define an API in terms of URLs and query parameters and
assume *nothing* from whatever is calling them.
I'd really love to get rid of t:formdata, but it would need very deep
rewrite of how the form components work, because t:formdata stores the
actions the fields want to be triggered when a submission is done. That's
actually how form submission processing works. Take a look at
AbstractField, Form and FormSupport. I guess it wouldn't be too hard to
come up with a solution that covers simple forms (no loops, HTML id always
equal to component t:id), but covering all scenarios as Tapestry does now,
you need some form of t:formdata.
And by "well" I mean that we cannot reuse T5 support for validation,
value encoders, translators, etc.
What I'd miss the most for REST would be the property bindings. You
already have support for ValueEncoder in page and event activation
context. No client-side validation from Tapestry would be possible for
REST submissions, but server-side could.
--
Thiago H. de Paula Figueiredo
Tapestry, Java and Hibernate consultant and developer
http://machina.com.br
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
For additional commands, e-mail: users-h...@tapestry.apache.org