You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by christophe <ma...@wanadoo.fr> on 2018/11/30 09:43:06 UTC

Datetime-local input fields "send" empty values

Hello

I am still a user of Wicket 6.3. At this time upgrading is not possible

I created a DateTimeField as an extension of a TextField with
type="datetime-local"
It all works fine but any change or blur event  at the WEB page level
tiggers a message to the server with an empy string (in other words  date &
time are missing)

Can someone help me fixw this?

Regards
Christophe

--
Sent from: http://apache-wicket.1842946.n4.nabble.com/Users-forum-f1842947.html

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


Re: Datetime-local input fields "send" empty values

Posted by Sven Meier <sv...@meiers.net>.
Hi,

works fine when I've added your case to FormInput in wicket-examples.

You should create a quickstart showing your problem.

Have fun
Sven


Am 08.12.18 um 13:40 schrieb christophe:
> Hello
>
> Sorry for this late reply and a fairly confusing request. Let me try to
> clarify
>
> 1) I still use Wicket 6.3 and wont be able to upgrade before 5 to 6 months
> at least
> 2) I need a  "HTML" date and time field that  "uses" the "<input
> type="datetime-local".../> HTML markup
>
> 3) I proceed as follows
>   a) I created a DateTime class that specializes TextField<String>and simply
> checks that the corresponding
>       marup is indeed of type "input type="datetime-local""
>       This all works very well as Wicket does not complain and a pretty
> datetime-local field is displayed on my
>      page.
>
> b) I also need to receive the "value" of the datetime-local field when the
> input field loses the focus ( DOM change event). So I created a
> specilaization of AjaxFormComponentUpdatingBehavior whose method
> onUpdate(..) is overloaded. The behavior is added to the Java component
>
> This method is invoked when the date time  markup loses the  focus.
>
> However the value is alswas an empty string.
>
> I took a look at the message sent by the browser. It contains "an empty
> string"
>
> This is where I need your help.
> i) Why is the value sent by the browser empy
> ii) What do I do wrong / How can I fix it
>
> Thank you very much
>
> Christophe
>
>
> --
> Sent from: http://apache-wicket.1842946.n4.nabble.com/Users-forum-f1842947.html
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>

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


Re: Datetime-local input fields "send" empty values

Posted by christophe <ma...@wanadoo.fr>.
Hello 

Sorry for this late reply and a fairly confusing request. Let me try to
clarify

1) I still use Wicket 6.3 and wont be able to upgrade before 5 to 6 months
at least
2) I need a  "HTML" date and time field that  "uses" the "<input
type="datetime-local".../> HTML markup

3) I proceed as follows
 a) I created a DateTime class that specializes TextField<String>and simply
checks that the corresponding 
     marup is indeed of type "input type="datetime-local""
     This all works very well as Wicket does not complain and a pretty
datetime-local field is displayed on my 
    page.

b) I also need to receive the "value" of the datetime-local field when the
input field loses the focus ( DOM change event). So I created a
specilaization of AjaxFormComponentUpdatingBehavior whose method
onUpdate(..) is overloaded. The behavior is added to the Java component

This method is invoked when the date time  markup loses the  focus.

However the value is alswas an empty string.

I took a look at the message sent by the browser. It contains "an empty
string"

This is where I need your help. 
i) Why is the value sent by the browser empy 
ii) What do I do wrong / How can I fix it

Thank you very much

Christophe


--
Sent from: http://apache-wicket.1842946.n4.nabble.com/Users-forum-f1842947.html

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


Re: Datetime-local input fields "send" empty values

Posted by Martin Grigorov <mg...@apache.org>.
Hi,

We will need some more information to be able to help you.


On Fri, Nov 30, 2018 at 12:17 PM christophe <ma...@wanadoo.fr>
wrote:

> Hello
>
> I am still a user of Wicket 6.3. At this time upgrading is not possible
>

Upgrade to a newer 6.x should be relative easy and it is highly recommended
because there are security related fixes!


>
> I created a DateTimeField as an extension of a TextField with
> type="datetime-local"
> It all works fine but any change or blur event  at the WEB page level
>

What do you mean by "it all works fine" ?
In which case it works ?
What do you mean by change/blur event on *page level* ? Do you change
another text field in the page ? Because I am not sure when JS document can
trigger 'change' or 'blur' event, and why this would lead to a request to
the server.
Do you use Ajax behaviors somewhere ? For this date field ? Or for an
element that is parent of this date field ?


> tiggers a message to the server with an empy string (in other words  date &
> time are missing)
>
> Can someone help me fixw this?
>
> Regards
> Christophe
>
> --
> Sent from:
> http://apache-wicket.1842946.n4.nabble.com/Users-forum-f1842947.html
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>