You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Christian Köberl <ta...@gmail.com> on 2010/11/03 08:41:16 UTC

HTML5 forms for Tapestry 5.3?

Hi!

Has anybody read this article?
http://www.alistapart.com/articles/forward-thinking-form-validation/

It's about building web forms for HTML5 browsers with backward compatibility
to older browsers.

Simply spoken a input field for a numeric postcode is defined as:
<input id="postcode" name="postcode" type="number" min="1001" max="8000"
maxlength="4" required />
(not as type="text)

Modern (HTML5) browsers can now use this info for validating and styling the
input. 
For older browsers the author has built a simple JavaScript that does some
validation and styling. 
I especially like the style they use for input validation, see the example: 
http://www.alistapart.com/d/forward-thinking-form-validation/enhanced_2.html

Tapestry could use the JSR-303 annotations and type-info to generate this
HTML5 code instead of the old plain HTML:
@NonNull
@Min(1001)
@Max(8000)
private Int postcode;

I think this would be a great feature (maybe for 5.3) and an advantage over
other web frameworks.

What do you think? 

Cheers,
Chris
-- 
View this message in context: http://tapestry-users.832.n2.nabble.com/HTML5-forms-for-Tapestry-5-3-tp5700366p5700366.html
Sent from the Tapestry Users mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: HTML5 forms for Tapestry 5.3?

Posted by Christian Köberl <ta...@gmail.com>.

Igor Drobiazko wrote:
> 
> Well, I don't think 5.3 will support HTML 5 as it will take some time
> until
> the standard is ready.
> 

The article says you can (and should) support new browser features now event
if they aren't standardized yet.

It's about graceful degradation of HTML and progressive enhancement:
http://www.alistapart.com/articles/understandingprogressiveenhancement/


françois facon wrote:
> 
> This could be done at server side (sniffing header + free db) or at client
> side (http://diveintohtml5.org/detect.html)
> 
For the simple form fields like number, email, etc. there is no need for
detection. Older browser will display them just as simple text fields.

For the date field a client side detection would do fine
(http://diveintohtml5.org/detect.html#input-types): if date fileld supported
do nothing otherwise add JS date picker.

-- 
View this message in context: http://tapestry-users.832.n2.nabble.com/HTML5-forms-for-Tapestry-5-3-tp5700366p5708403.html
Sent from the Tapestry Users mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: HTML5 forms for Tapestry 5.3?

Posted by françois facon <fr...@gmail.com>.
did you know that http://ishtml5readyyet.com/ use html5 :)

What about doing desktop capability detection to check if browser is ready
for html5?
This could be done at server side (sniffing header + free db) or at client
side (http://diveintohtml5.org/detect.html)


Is possible to tapestry an equivalent to *xmlns:h5*="
http://java.sun.com/jsf/composite/html5">

please don't give the point to
http://www.ibm.com/developerworks/java/library/j-jsf2fu-1010/




2010/11/4 Igor Drobiazko <ig...@gmail.com>

> Well, I don't think 5.3 will support HTML 5 as it will take some time until
> the standard is ready.
>
> See here: http://ishtml5readyyet.com/
>
> On Wed, Nov 3, 2010 at 8:41 AM, Christian Köberl <
> tapestry.christian.koeberl@gmail.com> wrote:
>
> >
> > Hi!
> >
> > Has anybody read this article?
> > http://www.alistapart.com/articles/forward-thinking-form-validation/
> >
> > It's about building web forms for HTML5 browsers with backward
> > compatibility
> > to older browsers.
> >
> > Simply spoken a input field for a numeric postcode is defined as:
> > <input id="postcode" name="postcode" type="number" min="1001" max="8000"
> > maxlength="4" required />
> > (not as type="text)
> >
> > Modern (HTML5) browsers can now use this info for validating and styling
> > the
> > input.
> > For older browsers the author has built a simple JavaScript that does
> some
> > validation and styling.
> > I especially like the style they use for input validation, see the
> example:
> >
> >
> http://www.alistapart.com/d/forward-thinking-form-validation/enhanced_2.html
> >
> > Tapestry could use the JSR-303 annotations and type-info to generate this
> > HTML5 code instead of the old plain HTML:
> > @NonNull
> > @Min(1001)
> > @Max(8000)
> > private Int postcode;
> >
> > I think this would be a great feature (maybe for 5.3) and an advantage
> over
> > other web frameworks.
> >
> > What do you think?
> >
> > Cheers,
> > Chris
> > --
> > View this message in context:
> >
> http://tapestry-users.832.n2.nabble.com/HTML5-forms-for-Tapestry-5-3-tp5700366p5700366.html
> > Sent from the Tapestry Users mailing list archive at Nabble.com.
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> > For additional commands, e-mail: users-help@tapestry.apache.org
> >
> >
>
>
> --
> Best regards,
>
> Igor Drobiazko
> http://tapestry5.de
>

Re: HTML5 forms for Tapestry 5.3?

Posted by Igor Drobiazko <ig...@gmail.com>.
Well, I don't think 5.3 will support HTML 5 as it will take some time until
the standard is ready.

See here: http://ishtml5readyyet.com/

On Wed, Nov 3, 2010 at 8:41 AM, Christian Köberl <
tapestry.christian.koeberl@gmail.com> wrote:

>
> Hi!
>
> Has anybody read this article?
> http://www.alistapart.com/articles/forward-thinking-form-validation/
>
> It's about building web forms for HTML5 browsers with backward
> compatibility
> to older browsers.
>
> Simply spoken a input field for a numeric postcode is defined as:
> <input id="postcode" name="postcode" type="number" min="1001" max="8000"
> maxlength="4" required />
> (not as type="text)
>
> Modern (HTML5) browsers can now use this info for validating and styling
> the
> input.
> For older browsers the author has built a simple JavaScript that does some
> validation and styling.
> I especially like the style they use for input validation, see the example:
>
> http://www.alistapart.com/d/forward-thinking-form-validation/enhanced_2.html
>
> Tapestry could use the JSR-303 annotations and type-info to generate this
> HTML5 code instead of the old plain HTML:
> @NonNull
> @Min(1001)
> @Max(8000)
> private Int postcode;
>
> I think this would be a great feature (maybe for 5.3) and an advantage over
> other web frameworks.
>
> What do you think?
>
> Cheers,
> Chris
> --
> View this message in context:
> http://tapestry-users.832.n2.nabble.com/HTML5-forms-for-Tapestry-5-3-tp5700366p5700366.html
> Sent from the Tapestry Users mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>


-- 
Best regards,

Igor Drobiazko
http://tapestry5.de

Re: HTML5 forms for Tapestry 5.3?

Posted by Christian Köberl <ta...@gmail.com>.

Thiago H. de Paula Figueiredo wrote:
> 
> Int? I thought Tapestry was written in Java, hehehe.
> 
That happens when you "code" in gmail ;)


Thiago H. de Paula Figueiredo wrote:
> 
> I think this is a good idea. We already have a very nice support for JSR  
> 303 and this doesn't seem to need too much effort. Please file a JIRA  
> about it. ;)
> 

I will try to put this into an requirement description and file a JIRA.
-- 
View this message in context: http://tapestry-users.832.n2.nabble.com/HTML5-forms-for-Tapestry-5-3-tp5700366p5701582.html
Sent from the Tapestry Users mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: HTML5 forms for Tapestry 5.3?

Posted by "Thiago H. de Paula Figueiredo" <th...@gmail.com>.
On Wed, 03 Nov 2010 05:41:16 -0200, Christian Köberl  
<ta...@gmail.com> wrote:

> Hi!

Hi!

> Has anybody read this article?
> http://www.alistapart.com/articles/forward-thinking-form-validation/
> Tapestry could use the JSR-303 annotations and type-info to generate this
> HTML5 code instead of the old plain HTML:
> @NonNull
> @Min(1001)
> @Max(8000)
> private Int postcode;

Int? I thought Tapestry was written in Java, hehehe.

> I think this would be a great feature (maybe for 5.3) and an advantage  
> over
> other web frameworks.

I think this is a good idea. We already have a very nice support for JSR  
303 and this doesn't seem to need too much effort. Please file a JIRA  
about it. ;)

-- 
Thiago H. de Paula Figueiredo
Independent Java, Apache Tapestry 5 and Hibernate consultant, developer,  
and instructor
Owner, Ars Machina Tecnologia da Informação Ltda.
http://www.arsmachina.com.br

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org