You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Ricardo Veloso <ri...@flowinn.biz> on 2016/04/26 16:14:49 UTC

Fwd: Datefield parse exception with surrounding zone

This is fixed, at least in T5.4.1
Nevertheless the datefield.js api is close. In fact, the requirejs module
returns null, which prevents you from having any custom behaviour. I can't
even know when a date is changed.

What I've done (I don't know if this is the best way of doing it) was catch
the button that launches que calendar, register the input text associated
to it, register a onselect handler for DatePicker.prototype and trigger an
event from the input when a date is changed. This allows me to trigger a
zone refresh when a date is changed.

Snippet:

var datepicker = null;

$('button > .glyphicon-calendar').on('click', function() {

    var self = $(this);

    datepicker = self.closest('.input-group').children('input');

});

require(['t5/core/datepicker'], function(DatePicker) {

    DatePicker.prototype.onchange = function() {

        if(datepicker) {

            var value = this.getDate().getTime();

            datepicker.trigger('change', value);

        }

    };

});


My suggestion is that when a datefield is changed it should trigger an
event that can be caught in page.

Cumprimentos / Best regards,
Ricardo Veloso







ricardo.veloso@flowinn.biz


(+351) 926 728 741


www.flowinn.biz


facebook.com/grupoflowinn <https://www.facebook.com/grupoflowinn>

AVISO LEGAL A informação presente nesta mensagem, bem como em qualquer dos
seus anexos é confidencial e destinada exclusivamente ao(s)
destinatário(s). Qualquer utilização desta informação que não esteja de
acordo com o seu objectivo, qualquer disseminação ou divulgação, total ou
parcial, é proibida excepto se formalmente aprovada. A Internet não garante
a integridade desta mensagem, a qual poderá ter sido interceptada,
corrompida, perdida, atrasada ou acrescida de vírus. Assim, a Flowinn não
se responsabiliza pela mensagem se modificada.

DISCLAIMER The information in this e-mail and in any attachments is
confidential and intended exclusively for the named addressee(s). Any use
of this information not in accordance with its purpose, any dissemination
or disclosure, either whole or partial, is prohibited except if formally
approved. The Internet cannot guarantee the integrity of this message, as
it could be intercepted, corrupted, lost, destroyed, arrive late or
incomplete or have viruses added to it. Flowinn will not therefore be
liable for the message if modified.

---------- Forwarded message ----------
From: Ricardo Veloso <ri...@flowinn.biz>
Date: 2015-12-14 17:20 GMT+00:00
Subject: Datefield parse exception with surrounding zone
To: users-subscribe@tapestry.apache.org


Hello,

When a date field is used surrounded by a zone component it fails parsing
date since the first input element is an encoded value.

<t:zone t:id="dateZone" id="dateZone" t:update="show">
  <t:datefield class="form-control dateField teste" id="date" t:id="date"
t:value="searchModel.date" placeholder="${message:date-label}" />
</t:zone>

Tapestry renders an hidden input element before the input for date field
causing a failure when parsing the field date.

Cumprimentos / Best regards,
Ricardo Veloso






ricardo.veloso@flowinn.biz


(+351) 926 728 741


www.flowinn.biz


facebook.com/grupoflowinn <https://www.facebook.com/grupoflowinn>

AVISO LEGAL A informação presente nesta mensagem, bem como em qualquer dos
seus anexos é confidencial e destinada exclusivamente ao(s)
destinatário(s). Qualquer utilização desta informação que não esteja de
acordo com o seu objectivo, qualquer disseminação ou divulgação, total ou
parcial, é proibida excepto se formalmente aprovada. A Internet não garante
a integridade desta mensagem, a qual poderá ter sido interceptada,
corrompida, perdida, atrasada ou acrescida de vírus. Assim, a Flowinn não
se responsabiliza pela mensagem se modificada.

DISCLAIMER The information in this e-mail and in any attachments is
confidential and intended exclusively for the named addressee(s). Any use
of this information not in accordance with its purpose, any dissemination
or disclosure, either whole or partial, is prohibited except if formally
approved. The Internet cannot guarantee the integrity of this message, as
it could be intercepted, corrupted, lost, destroyed, arrive late or
incomplete or have viruses added to it. Flowinn will not therefore be
liable for the message if modified.