[TYPO3-mvc] Date examples, can't find any.

Franz Koch typo3.RemoveForMessage at elements-net.de
Thu Jan 14 21:49:59 CET 2010


Hi,

> I'm interested, but couldn't find (searched for javascript) the
> discussion.  I still have 245 unread posts in this list (out of 1556).

let me see. Topic title "f:form.dateselect ? (fluid)". But I just had a 
look again - maybe we didn't do that much discussion there as I thought 
we did. But might be worth reading anyway.

> I think this might be a difficult thing to do as different libraries
> require different things and sometimes they conflict with each other.

That's why you only decide for one library. All addon extensions should 
implement all features of the available viewHelpers - so that it's just 
a mater of taste which one to install or depends on what JSlib you're 
most familiar with.

> For very specific things like form validation, calendar date pickers and
> auto-complete it might be nice if it was encapsulated into a set of view
> helpers that extend the default ones in a different namespace:
>
> {namespace jquery=Tx_Jquery_ViewHelpers}
>
> <jquery:form name="someform" method="post" object="{someobj}"
> action="update" controller="Somecontroller" validate="onsubmit">
>
>      <jquery:form.textbox validate="onblur" property="myproperty">
>
>      <jquery:form.submit name="submit" value="Submit" />
>
> </jquery:form>

I don't think it's a good idea. The viewHelpers need a generalized 
syntax. Assume you're installing some extension using JS widgets of 
FLUID, but the extension author is a ExtJS fanboy whereas you prefer 
jQuery. In this case you would have to completely rewrite all templates 
- and that not the way to go (and not necessary if you ask me).

> Wouldn't it be sweet if that automatically generated the code to fire
> off an XHR request, use the mapAndValidate to automatically validate the
> property using the annotations and then return a thumbs up or down with
> appropriate message?

Sure it'll be sweet, but this feature doesn't require any jQuery 
specific viewHelpers. All you need is HTML code with special markup 
(let's say special css classes). So if FLUID is generating the following 
output:

<form action="" class="f-form f-validate f-validationType-inline">
	<input name="foobar" class="f-required f-eval-date f-widget-datepicker" 
size="30" />
</form>

Then every JSframework can parse the code for those css classes, 
automatically add inline validation, validate the field for certain 
types and even extend the fields with JS widgets like a datepicker or 
whatever. So no JSframework specific viewHelpers are needed. If you like 
to use some custom feature of a certain JSframework, then you might be 
able to configure it globally in the frameworks configuration or add 
additional CSS classes where needed for framework specific things.

-- 
kind regards,
Franz Koch


More information about the TYPO3-project-typo3v4mvc mailing list