Hi Thiago,

A couple of years' ago I extended Tapestry's AbstractField to create a DateTimeField, as DateField's standard JavaScript calendar looks a little dated (pardon the pun). DateTimeField leverages the HTML5 datetime-local input type, and one of its parameters is 'boolean readOnly'. I think the wheel-based date picker has a more modern feel, and is more mobile friendly.

I'm happy to contribute the code for this component if you think it might make a good form field, an optional alternative to DateField?

My original question was more about exploring the possibility of manipulating form field components from within the controller class, and whether this is a good idea or not. I like to keep the view template as 'dumb' as possible, free of multiple <t:if...> and suchlike.

Although I never tried it, the below may be a better approach than the one I took.

    <t:select ... t:disabled="disabled" t:readonly="readonly"/>

    public isDisabled() {
        return ...;
    }

    public isReadonly() {
        return ...;
    }

Regards,

Chris.

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

Reply via email to