Re: AutoCompleteTextField and change AjaxFormComponentUpdatingBehavior

2016-01-21 Thread Zbynek Vavros
I'm not sure we understand each other.
Such a behavior is already there using AjaxFormComponentUpdatingBehavior
("change").
This way ajax is triggered ONLY when value is selected from choices (either
by mouse or by keyboard).
= exactly what I want.

I tested this in small prototype and it works just fine.

My issue is that this doesn't work in our business app so I am trying to
find why this works in prototype app
but not in business app (as I mentioned both use wicket-core and
wicket-extensions 7.0.0).

What I found out is that in both cases (prototype and business app)
the event in line 178 in wicket-autocomplete.js is invoked as expected. The
issue is that business app does no ajax call after that.

To summarize all I would like is some help with JS debugging since I am
java-dev and js-noob :(

On Thu, Jan 21, 2016 at 10:35 AM, Martin Grigorov 
wrote:

> OK. I understand now.
> Looking at wicket-autocomplete.js I see that it triggers "change" event
> after click on an entry.
> To support use cases like yours it has to trigger some custom event too,
> e.g. "itemselected.wa" ("wa" is a sample namespace for
> wicket-autocomplete). The you can use
> AjaxFormComponentUpdatingBehavior("itemselected.wa").
> Please create a ticket in our JIRA!
>
> Martin Grigorov
> Wicket Training and Consulting
> https://twitter.com/mtgrigorov
>
> On Thu, Jan 21, 2016 at 10:27 AM, Zbynek Vavros 
> wrote:
>
> > What I mean by final value is value selected from list of options.
> > The OnChangeAjaxBehavior you suggested will do ajax on every key stroke.
> > So lets say my autocomplete display list of cities.
> > I want the method called when user selects a value "London" from list.
> > Not on each stoke "L", "Lo", "Lon"...
> >
> > As I said, this is because I need to use the selected value for
> additional
> > processing.
> >
> > On Thu, Jan 21, 2016 at 9:56 AM, Martin Grigorov 
> > wrote:
> >
> > > Hi,
> > >
> > > How do you decide when "final" value is entered ?
> > > You can use Ajax throttling to avoid sending requests on every typed
> > > character but only after N ms after the last typed character. See
> > > AjaxRequestAttributes#setThrottling() for this option.
> > > There is no magic that will read your users' mind to tell whether an
> > > entered value is final or not.
> > >
> > > Martin Grigorov
> > > Wicket Training and Consulting
> > > https://twitter.com/mtgrigorov
> > >
> > > On Thu, Jan 21, 2016 at 9:48 AM, Zbynek Vavros  >
> > > wrote:
> > >
> > > > Hey,
> > > >
> > > > sorry for not explaining properly...
> > > > I already tried that and in this case the the ajax call is triggered
> > > > on "inputchange" as well, meaning on every key stroke.
> > > >
> > > > This is not desirable because we use the value of this autocomplete
> > field
> > > > to calculate value of another fields in form. This calculation should
> > > > happen only
> > > > when "final" value is selected.
> > > >
> > > > Zbynek
> > > >
> > > > On Thu, Jan 21, 2016 at 9:27 AM, Martin Grigorov <
> mgrigo...@apache.org
> > >
> > > > wrote:
> > > >
> > > > > Hi,
> > > > >
> > > > > It is not very clear what exactly is the issue.
> > > > > As far as I understand the problem is that the Ajax call is
> triggered
> > > > only
> > > > > when you navigate to another form field. If this is the issue then
> > try
> > > by
> > > > > using OnChangeAjaxBehavior instead of
> > > AjaxFormComponentUpdatingBehavior.
> > > > >
> > > > > Martin Grigorov
> > > > > Wicket Training and Consulting
> > > > > https://twitter.com/mtgrigorov
> > > > >
> > > > > On Wed, Jan 20, 2016 at 2:44 PM, Zbynek Vavros <
> > zbynekvav...@gmail.com
> > > >
> > > > > wrote:
> > > > >
> > > > > > Hi,
> > > > > >
> > > > > > in our project we have an AutoCompleteTextField with
> > > > > > AjaxFormComponentUpdatingBehavior ("change" event) attached.
> > > > > >
> > > > > > Small prototype I did proves that HTTP POST is done when an item
> is
> > > > > > selected from choices (either by mouse or keyboard). But for some
> > > > reason
> > > > > > the same code doesn't work in our project. It is required to move
> > > focus
> > > > > to
> > > > > > another component for the POST to be send. The behavior works
> like
> > if
> > > > > > "blur" type of event is set but there is "change".
> > > > > >
> > > > > > I'm quite new to Wicket so I tried to compare all HTML & JS files
> > but
> > > > > they
> > > > > > all seem to be the same.
> > > > > > Is there some other debug I can use to find what is going on (I
> > > suspect
> > > > > > something in JS but JS isn't my specialty) ?
> > > > > >
> > > > > >
> > > > > > Oh and both wicket-core and wicket-extension is 7.0.0.
> > > > > >
> > > > > > Thanks,
> > > > > > Zbynek
> > > > > >
> > > > >
> > > >
> > >
> >
>


Re: AutoCompleteTextField and change AjaxFormComponentUpdatingBehavior

2016-01-21 Thread Martin Grigorov
At the moment wicket-autocomplete.js triggers event with name "change":
https://github.com/apache/wicket/blob/580d92ddf068040214669c085f54d2faa702a921/wicket-extensions/src/main/java/org/apache/wicket/extensions/ajax/markup/html/autocomplete/wicket-autocomplete.js#L446

This makes it hard for the application to know whether this is a normal
change event for the  or the manually triggered from selection from
the dropdown.

I am not sure how it works for the simple app. I have to try it to see what
happens.

Martin Grigorov
Wicket Training and Consulting
https://twitter.com/mtgrigorov

On Thu, Jan 21, 2016 at 11:47 AM, Zbynek Vavros 
wrote:

> I'm not sure we understand each other.
> Such a behavior is already there using AjaxFormComponentUpdatingBehavior
> ("change").
> This way ajax is triggered ONLY when value is selected from choices (either
> by mouse or by keyboard).
> = exactly what I want.
>
> I tested this in small prototype and it works just fine.
>
> My issue is that this doesn't work in our business app so I am trying to
> find why this works in prototype app
> but not in business app (as I mentioned both use wicket-core and
> wicket-extensions 7.0.0).
>
> What I found out is that in both cases (prototype and business app)
> the event in line 178 in wicket-autocomplete.js is invoked as expected. The
> issue is that business app does no ajax call after that.
>
> To summarize all I would like is some help with JS debugging since I am
> java-dev and js-noob :(
>
> On Thu, Jan 21, 2016 at 10:35 AM, Martin Grigorov 
> wrote:
>
> > OK. I understand now.
> > Looking at wicket-autocomplete.js I see that it triggers "change" event
> > after click on an entry.
> > To support use cases like yours it has to trigger some custom event too,
> > e.g. "itemselected.wa" ("wa" is a sample namespace for
> > wicket-autocomplete). The you can use
> > AjaxFormComponentUpdatingBehavior("itemselected.wa").
> > Please create a ticket in our JIRA!
> >
> > Martin Grigorov
> > Wicket Training and Consulting
> > https://twitter.com/mtgrigorov
> >
> > On Thu, Jan 21, 2016 at 10:27 AM, Zbynek Vavros 
> > wrote:
> >
> > > What I mean by final value is value selected from list of options.
> > > The OnChangeAjaxBehavior you suggested will do ajax on every key
> stroke.
> > > So lets say my autocomplete display list of cities.
> > > I want the method called when user selects a value "London" from list.
> > > Not on each stoke "L", "Lo", "Lon"...
> > >
> > > As I said, this is because I need to use the selected value for
> > additional
> > > processing.
> > >
> > > On Thu, Jan 21, 2016 at 9:56 AM, Martin Grigorov  >
> > > wrote:
> > >
> > > > Hi,
> > > >
> > > > How do you decide when "final" value is entered ?
> > > > You can use Ajax throttling to avoid sending requests on every typed
> > > > character but only after N ms after the last typed character. See
> > > > AjaxRequestAttributes#setThrottling() for this option.
> > > > There is no magic that will read your users' mind to tell whether an
> > > > entered value is final or not.
> > > >
> > > > Martin Grigorov
> > > > Wicket Training and Consulting
> > > > https://twitter.com/mtgrigorov
> > > >
> > > > On Thu, Jan 21, 2016 at 9:48 AM, Zbynek Vavros <
> zbynekvav...@gmail.com
> > >
> > > > wrote:
> > > >
> > > > > Hey,
> > > > >
> > > > > sorry for not explaining properly...
> > > > > I already tried that and in this case the the ajax call is
> triggered
> > > > > on "inputchange" as well, meaning on every key stroke.
> > > > >
> > > > > This is not desirable because we use the value of this autocomplete
> > > field
> > > > > to calculate value of another fields in form. This calculation
> should
> > > > > happen only
> > > > > when "final" value is selected.
> > > > >
> > > > > Zbynek
> > > > >
> > > > > On Thu, Jan 21, 2016 at 9:27 AM, Martin Grigorov <
> > mgrigo...@apache.org
> > > >
> > > > > wrote:
> > > > >
> > > > > > Hi,
> > > > > >
> > > > > > It is not very clear what exactly is the issue.
> > > > > > As far as I understand the problem is that the Ajax call is
> > triggered
> > > > > only
> > > > > > when you navigate to another form field. If this is the issue
> then
> > > try
> > > > by
> > > > > > using OnChangeAjaxBehavior instead of
> > > > AjaxFormComponentUpdatingBehavior.
> > > > > >
> > > > > > Martin Grigorov
> > > > > > Wicket Training and Consulting
> > > > > > https://twitter.com/mtgrigorov
> > > > > >
> > > > > > On Wed, Jan 20, 2016 at 2:44 PM, Zbynek Vavros <
> > > zbynekvav...@gmail.com
> > > > >
> > > > > > wrote:
> > > > > >
> > > > > > > Hi,
> > > > > > >
> > > > > > > in our project we have an AutoCompleteTextField with
> > > > > > > AjaxFormComponentUpdatingBehavior ("change" event) attached.
> > > > > > >
> > > > > > > Small prototype I did proves that HTTP POST is done when an
> item
> > is
> > > > > > > selected from choices (either by mouse or 

Re: AutoCompleteTextField and change AjaxFormComponentUpdatingBehavior

2016-01-21 Thread Sven Meier

Hi,

wicket-autocomplete.js surpresses the "change" event while you operate 
on the drop down.
When it decides that your selection has finished (e.g. the drop down is 
hidden), the "change" event is triggered subsequently.


The AjaxFormComponentUpdatingBehavior will pick up the "change" event 
and do an Ajax request as usual.


Hope this helps
Sven


On 21.01.2016 12:00, Zbynek Vavros wrote:

I was s afraid of that :D

Just out of curiosity, I see in wicket-autocomplete.js that the onchange
event sets "triggerChangeOnHide" to true.
How is this handled afterwards ? I mean how does it get from here to
calling the ajax ?

Thanks!

On Thu, Jan 21, 2016 at 11:50 AM, Sven Meier  wrote:


Hi,

well, it seems you'll have to strip down your business app until it works
as expected :P

Have fun
Sven


On 21.01.2016 11:47, Zbynek Vavros wrote:


I'm not sure we understand each other.
Such a behavior is already there using AjaxFormComponentUpdatingBehavior
("change").
This way ajax is triggered ONLY when value is selected from choices
(either
by mouse or by keyboard).
= exactly what I want.

I tested this in small prototype and it works just fine.

My issue is that this doesn't work in our business app so I am trying to
find why this works in prototype app
but not in business app (as I mentioned both use wicket-core and
wicket-extensions 7.0.0).

What I found out is that in both cases (prototype and business app)
the event in line 178 in wicket-autocomplete.js is invoked as expected.
The
issue is that business app does no ajax call after that.

To summarize all I would like is some help with JS debugging since I am
java-dev and js-noob :(

On Thu, Jan 21, 2016 at 10:35 AM, Martin Grigorov 
wrote:

OK. I understand now.

Looking at wicket-autocomplete.js I see that it triggers "change" event
after click on an entry.
To support use cases like yours it has to trigger some custom event too,
e.g. "itemselected.wa" ("wa" is a sample namespace for
wicket-autocomplete). The you can use
AjaxFormComponentUpdatingBehavior("itemselected.wa").
Please create a ticket in our JIRA!

Martin Grigorov
Wicket Training and Consulting
https://twitter.com/mtgrigorov

On Thu, Jan 21, 2016 at 10:27 AM, Zbynek Vavros 
wrote:

What I mean by final value is value selected from list of options.

The OnChangeAjaxBehavior you suggested will do ajax on every key stroke.
So lets say my autocomplete display list of cities.
I want the method called when user selects a value "London" from list.
Not on each stoke "L", "Lo", "Lon"...

As I said, this is because I need to use the selected value for


additional


processing.

On Thu, Jan 21, 2016 at 9:56 AM, Martin Grigorov 
wrote:

Hi,

How do you decide when "final" value is entered ?
You can use Ajax throttling to avoid sending requests on every typed
character but only after N ms after the last typed character. See
AjaxRequestAttributes#setThrottling() for this option.
There is no magic that will read your users' mind to tell whether an
entered value is final or not.

Martin Grigorov
Wicket Training and Consulting
https://twitter.com/mtgrigorov

On Thu, Jan 21, 2016 at 9:48 AM, Zbynek Vavros 

Re: AutoCompleteTextField and change AjaxFormComponentUpdatingBehavior

2016-01-21 Thread Zbynek Vavros
I was s afraid of that :D

Just out of curiosity, I see in wicket-autocomplete.js that the onchange
event sets "triggerChangeOnHide" to true.
How is this handled afterwards ? I mean how does it get from here to
calling the ajax ?

Thanks!

On Thu, Jan 21, 2016 at 11:50 AM, Sven Meier  wrote:

> Hi,
>
> well, it seems you'll have to strip down your business app until it works
> as expected :P
>
> Have fun
> Sven
>
>
> On 21.01.2016 11:47, Zbynek Vavros wrote:
>
>> I'm not sure we understand each other.
>> Such a behavior is already there using AjaxFormComponentUpdatingBehavior
>> ("change").
>> This way ajax is triggered ONLY when value is selected from choices
>> (either
>> by mouse or by keyboard).
>> = exactly what I want.
>>
>> I tested this in small prototype and it works just fine.
>>
>> My issue is that this doesn't work in our business app so I am trying to
>> find why this works in prototype app
>> but not in business app (as I mentioned both use wicket-core and
>> wicket-extensions 7.0.0).
>>
>> What I found out is that in both cases (prototype and business app)
>> the event in line 178 in wicket-autocomplete.js is invoked as expected.
>> The
>> issue is that business app does no ajax call after that.
>>
>> To summarize all I would like is some help with JS debugging since I am
>> java-dev and js-noob :(
>>
>> On Thu, Jan 21, 2016 at 10:35 AM, Martin Grigorov 
>> wrote:
>>
>> OK. I understand now.
>>> Looking at wicket-autocomplete.js I see that it triggers "change" event
>>> after click on an entry.
>>> To support use cases like yours it has to trigger some custom event too,
>>> e.g. "itemselected.wa" ("wa" is a sample namespace for
>>> wicket-autocomplete). The you can use
>>> AjaxFormComponentUpdatingBehavior("itemselected.wa").
>>> Please create a ticket in our JIRA!
>>>
>>> Martin Grigorov
>>> Wicket Training and Consulting
>>> https://twitter.com/mtgrigorov
>>>
>>> On Thu, Jan 21, 2016 at 10:27 AM, Zbynek Vavros 
>>> wrote:
>>>
>>> What I mean by final value is value selected from list of options.
 The OnChangeAjaxBehavior you suggested will do ajax on every key stroke.
 So lets say my autocomplete display list of cities.
 I want the method called when user selects a value "London" from list.
 Not on each stoke "L", "Lo", "Lon"...

 As I said, this is because I need to use the selected value for

>>> additional
>>>
 processing.

 On Thu, Jan 21, 2016 at 9:56 AM, Martin Grigorov 
 wrote:

 Hi,
>
> How do you decide when "final" value is entered ?
> You can use Ajax throttling to avoid sending requests on every typed
> character but only after N ms after the last typed character. See
> AjaxRequestAttributes#setThrottling() for this option.
> There is no magic that will read your users' mind to tell whether an
> entered value is final or not.
>
> Martin Grigorov
> Wicket Training and Consulting
> https://twitter.com/mtgrigorov
>
> On Thu, Jan 21, 2016 at 9:48 AM, Zbynek Vavros  wrote:
>
> Hey,
>>
>> sorry for not explaining properly...
>> I already tried that and in this case the the ajax call is triggered
>> on "inputchange" as well, meaning on every key stroke.
>>
>> This is not desirable because we use the value of this autocomplete
>>
> field

> to calculate value of another fields in form. This calculation should
>> happen only
>> when "final" value is selected.
>>
>> Zbynek
>>
>> On Thu, Jan 21, 2016 at 9:27 AM, Martin Grigorov <
>>
> mgrigo...@apache.org
>>>
 wrote:
>>
>> Hi,
>>>
>>> It is not very clear what exactly is the issue.
>>> As far as I understand the problem is that the Ajax call is
>>>
>> triggered
>>>
 only
>>
>>> when you navigate to another form field. If this is the issue then
>>>
>> try

> by
>
>> using OnChangeAjaxBehavior instead of
>>>
>> AjaxFormComponentUpdatingBehavior.
>
>> Martin Grigorov
>>> Wicket Training and Consulting
>>> https://twitter.com/mtgrigorov
>>>
>>> On Wed, Jan 20, 2016 at 2:44 PM, Zbynek Vavros <
>>>
>> zbynekvav...@gmail.com

> wrote:
>>>
>>> Hi,

 in our project we have an AutoCompleteTextField with
 AjaxFormComponentUpdatingBehavior ("change" event) attached.

 Small prototype I did proves that HTTP POST is done when an item

>>> is
>>>
 selected from choices (either by mouse or keyboard). But for some

>>> reason
>>
>>> the same code doesn't work in our project. It is required to move

>>> focus
>
>> to
>>>
 another component for the POST to be send. The behavior works

>>> like
>>>
 if

> 

Re: AutoCompleteTextField and change AjaxFormComponentUpdatingBehavior

2016-01-21 Thread Sven Meier

Hi,

well, it seems you'll have to strip down your business app until it 
works as expected :P


Have fun
Sven


On 21.01.2016 11:47, Zbynek Vavros wrote:

I'm not sure we understand each other.
Such a behavior is already there using AjaxFormComponentUpdatingBehavior
("change").
This way ajax is triggered ONLY when value is selected from choices (either
by mouse or by keyboard).
= exactly what I want.

I tested this in small prototype and it works just fine.

My issue is that this doesn't work in our business app so I am trying to
find why this works in prototype app
but not in business app (as I mentioned both use wicket-core and
wicket-extensions 7.0.0).

What I found out is that in both cases (prototype and business app)
the event in line 178 in wicket-autocomplete.js is invoked as expected. The
issue is that business app does no ajax call after that.

To summarize all I would like is some help with JS debugging since I am
java-dev and js-noob :(

On Thu, Jan 21, 2016 at 10:35 AM, Martin Grigorov 
wrote:


OK. I understand now.
Looking at wicket-autocomplete.js I see that it triggers "change" event
after click on an entry.
To support use cases like yours it has to trigger some custom event too,
e.g. "itemselected.wa" ("wa" is a sample namespace for
wicket-autocomplete). The you can use
AjaxFormComponentUpdatingBehavior("itemselected.wa").
Please create a ticket in our JIRA!

Martin Grigorov
Wicket Training and Consulting
https://twitter.com/mtgrigorov

On Thu, Jan 21, 2016 at 10:27 AM, Zbynek Vavros 
wrote:


What I mean by final value is value selected from list of options.
The OnChangeAjaxBehavior you suggested will do ajax on every key stroke.
So lets say my autocomplete display list of cities.
I want the method called when user selects a value "London" from list.
Not on each stoke "L", "Lo", "Lon"...

As I said, this is because I need to use the selected value for

additional

processing.

On Thu, Jan 21, 2016 at 9:56 AM, Martin Grigorov 
wrote:


Hi,

How do you decide when "final" value is entered ?
You can use Ajax throttling to avoid sending requests on every typed
character but only after N ms after the last typed character. See
AjaxRequestAttributes#setThrottling() for this option.
There is no magic that will read your users' mind to tell whether an
entered value is final or not.

Martin Grigorov
Wicket Training and Consulting
https://twitter.com/mtgrigorov

On Thu, Jan 21, 2016 at 9:48 AM, Zbynek Vavros 

Re: Lots of files in temp folder

2016-01-21 Thread Martin Grigorov
Hi,

The folder for the session data (filestore) should be removed with the
invalidation of the user session (either expiration or explicit logout).
But there must be one such folder in /tmp with many sub-folders.
Here it looks like:
/tmp/jetty-0.0.0.0--webapp-_myapp-any-/
└── MyApplication-filestore
└── 2200
└── 5314
└── 1i0svs4a1edbvdenm01kfwyzy
└── data

Whenever a user session is invalidated a branch should be removed.

The "file-prefixtmp" file I believe is created by commons-fileupload.
It supports file cleaner which by default removes the files when the Java
process terminates, e.g. when you restart your web server.

Martin Grigorov
Wicket Training and Consulting
https://twitter.com/mtgrigorov

On Thu, Jan 21, 2016 at 10:59 AM, Manfred Bergmann 
wrote:

> Hi.
>
> I had a case where a customer had millions of file in Java tmp folder
> produced by Wicket.
> There are a lot of those folders:
> "org.apache.wicket.protocol.http.WicketServlet-128f3c8-filestore", etc.
> and
> "file-prefix59601103483491554.tmp".
>
> Most files are very small but the sheer number of them gave them a size of
> a
> couple of giga bytes.
> This is not actually a large application. It has two or three pages with
> components.
>
> The number of temp files probably has grown over a large period of time
> where the Wicket page was always open in a browser and got reloaded often.
>
> Are those files not removed from time to time, automatically?
> If not, how can I remove them programmatically?
>
> A, yeah. the Wicket version is 6.19.0. Upgrading to 6.21.0 shows the same
> behavior.
>
> Regards,
> Manfred
>
>
> --
> View this message in context:
> http://apache-wicket.1842946.n4.nabble.com/Lots-of-files-in-temp-folder-tp4673379.html
> Sent from the Users forum mailing list archive at Nabble.com.
>
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>


Re: AutoCompleteTextField and change AjaxFormComponentUpdatingBehavior

2016-01-21 Thread Zbynek Vavros
What I mean by final value is value selected from list of options.
The OnChangeAjaxBehavior you suggested will do ajax on every key stroke.
So lets say my autocomplete display list of cities.
I want the method called when user selects a value "London" from list.
Not on each stoke "L", "Lo", "Lon"...

As I said, this is because I need to use the selected value for additional
processing.

On Thu, Jan 21, 2016 at 9:56 AM, Martin Grigorov 
wrote:

> Hi,
>
> How do you decide when "final" value is entered ?
> You can use Ajax throttling to avoid sending requests on every typed
> character but only after N ms after the last typed character. See
> AjaxRequestAttributes#setThrottling() for this option.
> There is no magic that will read your users' mind to tell whether an
> entered value is final or not.
>
> Martin Grigorov
> Wicket Training and Consulting
> https://twitter.com/mtgrigorov
>
> On Thu, Jan 21, 2016 at 9:48 AM, Zbynek Vavros 
> wrote:
>
> > Hey,
> >
> > sorry for not explaining properly...
> > I already tried that and in this case the the ajax call is triggered
> > on "inputchange" as well, meaning on every key stroke.
> >
> > This is not desirable because we use the value of this autocomplete field
> > to calculate value of another fields in form. This calculation should
> > happen only
> > when "final" value is selected.
> >
> > Zbynek
> >
> > On Thu, Jan 21, 2016 at 9:27 AM, Martin Grigorov 
> > wrote:
> >
> > > Hi,
> > >
> > > It is not very clear what exactly is the issue.
> > > As far as I understand the problem is that the Ajax call is triggered
> > only
> > > when you navigate to another form field. If this is the issue then try
> by
> > > using OnChangeAjaxBehavior instead of
> AjaxFormComponentUpdatingBehavior.
> > >
> > > Martin Grigorov
> > > Wicket Training and Consulting
> > > https://twitter.com/mtgrigorov
> > >
> > > On Wed, Jan 20, 2016 at 2:44 PM, Zbynek Vavros  >
> > > wrote:
> > >
> > > > Hi,
> > > >
> > > > in our project we have an AutoCompleteTextField with
> > > > AjaxFormComponentUpdatingBehavior ("change" event) attached.
> > > >
> > > > Small prototype I did proves that HTTP POST is done when an item is
> > > > selected from choices (either by mouse or keyboard). But for some
> > reason
> > > > the same code doesn't work in our project. It is required to move
> focus
> > > to
> > > > another component for the POST to be send. The behavior works like if
> > > > "blur" type of event is set but there is "change".
> > > >
> > > > I'm quite new to Wicket so I tried to compare all HTML & JS files but
> > > they
> > > > all seem to be the same.
> > > > Is there some other debug I can use to find what is going on (I
> suspect
> > > > something in JS but JS isn't my specialty) ?
> > > >
> > > >
> > > > Oh and both wicket-core and wicket-extension is 7.0.0.
> > > >
> > > > Thanks,
> > > > Zbynek
> > > >
> > >
> >
>


Re: AutoCompleteTextField and change AjaxFormComponentUpdatingBehavior

2016-01-21 Thread Martin Grigorov
Hi,

How do you decide when "final" value is entered ?
You can use Ajax throttling to avoid sending requests on every typed
character but only after N ms after the last typed character. See
AjaxRequestAttributes#setThrottling() for this option.
There is no magic that will read your users' mind to tell whether an
entered value is final or not.

Martin Grigorov
Wicket Training and Consulting
https://twitter.com/mtgrigorov

On Thu, Jan 21, 2016 at 9:48 AM, Zbynek Vavros 
wrote:

> Hey,
>
> sorry for not explaining properly...
> I already tried that and in this case the the ajax call is triggered
> on "inputchange" as well, meaning on every key stroke.
>
> This is not desirable because we use the value of this autocomplete field
> to calculate value of another fields in form. This calculation should
> happen only
> when "final" value is selected.
>
> Zbynek
>
> On Thu, Jan 21, 2016 at 9:27 AM, Martin Grigorov 
> wrote:
>
> > Hi,
> >
> > It is not very clear what exactly is the issue.
> > As far as I understand the problem is that the Ajax call is triggered
> only
> > when you navigate to another form field. If this is the issue then try by
> > using OnChangeAjaxBehavior instead of AjaxFormComponentUpdatingBehavior.
> >
> > Martin Grigorov
> > Wicket Training and Consulting
> > https://twitter.com/mtgrigorov
> >
> > On Wed, Jan 20, 2016 at 2:44 PM, Zbynek Vavros 
> > wrote:
> >
> > > Hi,
> > >
> > > in our project we have an AutoCompleteTextField with
> > > AjaxFormComponentUpdatingBehavior ("change" event) attached.
> > >
> > > Small prototype I did proves that HTTP POST is done when an item is
> > > selected from choices (either by mouse or keyboard). But for some
> reason
> > > the same code doesn't work in our project. It is required to move focus
> > to
> > > another component for the POST to be send. The behavior works like if
> > > "blur" type of event is set but there is "change".
> > >
> > > I'm quite new to Wicket so I tried to compare all HTML & JS files but
> > they
> > > all seem to be the same.
> > > Is there some other debug I can use to find what is going on (I suspect
> > > something in JS but JS isn't my specialty) ?
> > >
> > >
> > > Oh and both wicket-core and wicket-extension is 7.0.0.
> > >
> > > Thanks,
> > > Zbynek
> > >
> >
>


Re: AutoCompleteTextField and change AjaxFormComponentUpdatingBehavior

2016-01-21 Thread Martin Grigorov
OK. I understand now.
Looking at wicket-autocomplete.js I see that it triggers "change" event
after click on an entry.
To support use cases like yours it has to trigger some custom event too,
e.g. "itemselected.wa" ("wa" is a sample namespace for
wicket-autocomplete). The you can use
AjaxFormComponentUpdatingBehavior("itemselected.wa").
Please create a ticket in our JIRA!

Martin Grigorov
Wicket Training and Consulting
https://twitter.com/mtgrigorov

On Thu, Jan 21, 2016 at 10:27 AM, Zbynek Vavros 
wrote:

> What I mean by final value is value selected from list of options.
> The OnChangeAjaxBehavior you suggested will do ajax on every key stroke.
> So lets say my autocomplete display list of cities.
> I want the method called when user selects a value "London" from list.
> Not on each stoke "L", "Lo", "Lon"...
>
> As I said, this is because I need to use the selected value for additional
> processing.
>
> On Thu, Jan 21, 2016 at 9:56 AM, Martin Grigorov 
> wrote:
>
> > Hi,
> >
> > How do you decide when "final" value is entered ?
> > You can use Ajax throttling to avoid sending requests on every typed
> > character but only after N ms after the last typed character. See
> > AjaxRequestAttributes#setThrottling() for this option.
> > There is no magic that will read your users' mind to tell whether an
> > entered value is final or not.
> >
> > Martin Grigorov
> > Wicket Training and Consulting
> > https://twitter.com/mtgrigorov
> >
> > On Thu, Jan 21, 2016 at 9:48 AM, Zbynek Vavros 
> > wrote:
> >
> > > Hey,
> > >
> > > sorry for not explaining properly...
> > > I already tried that and in this case the the ajax call is triggered
> > > on "inputchange" as well, meaning on every key stroke.
> > >
> > > This is not desirable because we use the value of this autocomplete
> field
> > > to calculate value of another fields in form. This calculation should
> > > happen only
> > > when "final" value is selected.
> > >
> > > Zbynek
> > >
> > > On Thu, Jan 21, 2016 at 9:27 AM, Martin Grigorov  >
> > > wrote:
> > >
> > > > Hi,
> > > >
> > > > It is not very clear what exactly is the issue.
> > > > As far as I understand the problem is that the Ajax call is triggered
> > > only
> > > > when you navigate to another form field. If this is the issue then
> try
> > by
> > > > using OnChangeAjaxBehavior instead of
> > AjaxFormComponentUpdatingBehavior.
> > > >
> > > > Martin Grigorov
> > > > Wicket Training and Consulting
> > > > https://twitter.com/mtgrigorov
> > > >
> > > > On Wed, Jan 20, 2016 at 2:44 PM, Zbynek Vavros <
> zbynekvav...@gmail.com
> > >
> > > > wrote:
> > > >
> > > > > Hi,
> > > > >
> > > > > in our project we have an AutoCompleteTextField with
> > > > > AjaxFormComponentUpdatingBehavior ("change" event) attached.
> > > > >
> > > > > Small prototype I did proves that HTTP POST is done when an item is
> > > > > selected from choices (either by mouse or keyboard). But for some
> > > reason
> > > > > the same code doesn't work in our project. It is required to move
> > focus
> > > > to
> > > > > another component for the POST to be send. The behavior works like
> if
> > > > > "blur" type of event is set but there is "change".
> > > > >
> > > > > I'm quite new to Wicket so I tried to compare all HTML & JS files
> but
> > > > they
> > > > > all seem to be the same.
> > > > > Is there some other debug I can use to find what is going on (I
> > suspect
> > > > > something in JS but JS isn't my specialty) ?
> > > > >
> > > > >
> > > > > Oh and both wicket-core and wicket-extension is 7.0.0.
> > > > >
> > > > > Thanks,
> > > > > Zbynek
> > > > >
> > > >
> > >
> >
>


Re: AutoCompleteTextField and change AjaxFormComponentUpdatingBehavior

2016-01-21 Thread Zbynek Vavros
Hey,

sorry for not explaining properly...
I already tried that and in this case the the ajax call is triggered
on "inputchange" as well, meaning on every key stroke.

This is not desirable because we use the value of this autocomplete field
to calculate value of another fields in form. This calculation should
happen only
when "final" value is selected.

Zbynek

On Thu, Jan 21, 2016 at 9:27 AM, Martin Grigorov 
wrote:

> Hi,
>
> It is not very clear what exactly is the issue.
> As far as I understand the problem is that the Ajax call is triggered only
> when you navigate to another form field. If this is the issue then try by
> using OnChangeAjaxBehavior instead of AjaxFormComponentUpdatingBehavior.
>
> Martin Grigorov
> Wicket Training and Consulting
> https://twitter.com/mtgrigorov
>
> On Wed, Jan 20, 2016 at 2:44 PM, Zbynek Vavros 
> wrote:
>
> > Hi,
> >
> > in our project we have an AutoCompleteTextField with
> > AjaxFormComponentUpdatingBehavior ("change" event) attached.
> >
> > Small prototype I did proves that HTTP POST is done when an item is
> > selected from choices (either by mouse or keyboard). But for some reason
> > the same code doesn't work in our project. It is required to move focus
> to
> > another component for the POST to be send. The behavior works like if
> > "blur" type of event is set but there is "change".
> >
> > I'm quite new to Wicket so I tried to compare all HTML & JS files but
> they
> > all seem to be the same.
> > Is there some other debug I can use to find what is going on (I suspect
> > something in JS but JS isn't my specialty) ?
> >
> >
> > Oh and both wicket-core and wicket-extension is 7.0.0.
> >
> > Thanks,
> > Zbynek
> >
>


Re: AutoCompleteTextField and change AjaxFormComponentUpdatingBehavior

2016-01-21 Thread Martin Grigorov
Hi,

It is not very clear what exactly is the issue.
As far as I understand the problem is that the Ajax call is triggered only
when you navigate to another form field. If this is the issue then try by
using OnChangeAjaxBehavior instead of AjaxFormComponentUpdatingBehavior.

Martin Grigorov
Wicket Training and Consulting
https://twitter.com/mtgrigorov

On Wed, Jan 20, 2016 at 2:44 PM, Zbynek Vavros 
wrote:

> Hi,
>
> in our project we have an AutoCompleteTextField with
> AjaxFormComponentUpdatingBehavior ("change" event) attached.
>
> Small prototype I did proves that HTTP POST is done when an item is
> selected from choices (either by mouse or keyboard). But for some reason
> the same code doesn't work in our project. It is required to move focus to
> another component for the POST to be send. The behavior works like if
> "blur" type of event is set but there is "change".
>
> I'm quite new to Wicket so I tried to compare all HTML & JS files but they
> all seem to be the same.
> Is there some other debug I can use to find what is going on (I suspect
> something in JS but JS isn't my specialty) ?
>
>
> Oh and both wicket-core and wicket-extension is 7.0.0.
>
> Thanks,
> Zbynek
>


Lots of files in temp folder

2016-01-21 Thread Manfred Bergmann
Hi.

I had a case where a customer had millions of file in Java tmp folder
produced by Wicket.
There are a lot of those folders:
"org.apache.wicket.protocol.http.WicketServlet-128f3c8-filestore", etc.
and
"file-prefix59601103483491554.tmp".

Most files are very small but the sheer number of them gave them a size of a
couple of giga bytes.
This is not actually a large application. It has two or three pages with
components.

The number of temp files probably has grown over a large period of time
where the Wicket page was always open in a browser and got reloaded often.

Are those files not removed from time to time, automatically?
If not, how can I remove them programmatically?

A, yeah. the Wicket version is 6.19.0. Upgrading to 6.21.0 shows the same
behavior.

Regards,
Manfred


--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Lots-of-files-in-temp-folder-tp4673379.html
Sent from the Users forum mailing list archive at Nabble.com.

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



Re: Lots of files in temp folder

2016-01-21 Thread bilguun
Hello, 

I realized those files are removed when session is expired due to the user
inactivity and main method that removes those files is a method unbind() of
static inner class
org.apache.wicket.protocol.http.pagestore.DiskPageStore.SessionEntry. But if
user explicitly logout, it does not delete those files using only
invalidateNow(). So do I have to call that unbind() method manually to
delete those files? 

Thanks,

Bill

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Lots-of-files-in-temp-folder-tp4673379p4673390.html
Sent from the Users forum mailing list archive at Nabble.com.

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



Re: Lots of files in temp folder

2016-01-21 Thread Martin Grigorov
OK.
This looks like a bug too.

grep says:
wicket-core/src/main/java/org/apache/wicket/settings/StoreSettings.java:
fileStoreFolder
= File.createTempFile("file-prefix", null).getParentFile();

So it seems Wicket creates a temporary file just to get a reference to the
/tmp folder and discards this file.
We should delete it!

Are those files empty on your system?

Martin Grigorov
Wicket Training and Consulting
https://twitter.com/mtgrigorov

On Thu, Jan 21, 2016 at 4:47 PM, Manfred Bergmann 
wrote:

> Hi.
>
> Yeah, the filestore.
> Hmm, there is no file-upload functionality in this Wicket app. I'm
> wondering
> why those file are created then?
>
> I just had a check. There were 8GB of data from those files.
>
>
> Manfred
>
> --
> View this message in context:
> http://apache-wicket.1842946.n4.nabble.com/Lots-of-files-in-temp-folder-tp4673379p4673388.html
> Sent from the Users forum mailing list archive at Nabble.com.
>
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>


Re: Lots of files in temp folder

2016-01-21 Thread Manfred Bergmann
Hi.

Yeah, the filestore.
Hmm, there is no file-upload functionality in this Wicket app. I'm wondering
why those file are created then?

I just had a check. There were 8GB of data from those files.


Manfred

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/Lots-of-files-in-temp-folder-tp4673379p4673388.html
Sent from the Users forum mailing list archive at Nabble.com.

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



Re: Lots of files in temp folder

2016-01-21 Thread Ernesto Reinaldo Barreiro
AFAIK wicket serializes old version of pages into file system

On Thu, Jan 21, 2016 at 4:47 PM, Manfred Bergmann 
wrote:

> Hi.
>
> Yeah, the filestore.
> Hmm, there is no file-upload functionality in this Wicket app. I'm
> wondering
> why those file are created then?
>
> I just had a check. There were 8GB of data from those files.
>
>
> Manfred
>
> --
> View this message in context:
> http://apache-wicket.1842946.n4.nabble.com/Lots-of-files-in-temp-folder-tp4673379p4673388.html
> Sent from the Users forum mailing list archive at Nabble.com.
>
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>


-- 
Regards - Ernesto Reinaldo Barreiro


Re: Lots of files in temp folder

2016-01-21 Thread Martin Grigorov
The "data" files with its parent folder must be deleted automatically when
a session is invalidated either by calling #invalidate[Now]() method or due
to inactivity of the user.
If the file is not removed then it is bug in Wicket that should be fixed!
Please create a quickstart application that shows the problem and attach it
to a ticket in JIRA! Thank you!

Martin Grigorov
Wicket Training and Consulting
https://twitter.com/mtgrigorov

On Thu, Jan 21, 2016 at 4:51 PM, bilguun 
wrote:

> Hello,
>
> I realized those files are removed when session is expired due to the user
> inactivity and main method that removes those files is a method unbind() of
> static inner class
> org.apache.wicket.protocol.http.pagestore.DiskPageStore.SessionEntry. But
> if
> user explicitly logout, it does not delete those files using only
> invalidateNow(). So do I have to call that unbind() method manually to
> delete those files?
>
> Thanks,
>
> Bill
>
> --
> View this message in context:
> http://apache-wicket.1842946.n4.nabble.com/Lots-of-files-in-temp-folder-tp4673379p4673390.html
> Sent from the Users forum mailing list archive at Nabble.com.
>
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>