Hello, I know this is a very old thread, but I would like to mention our
similar problem and the solution.

In our case, we had a DataTable and a textbox to filter items in the table.
When a user types in text in the textbox, items in the table are filtered.
We accomplish this with an OnChangeAjaxBehavior.

We had an issue where the user would type something into the filter box such
as "foo". As each letter is typed, an onChange ajax event would be sent to
the server, and our simple onchange handler *always* added the table
component to the ajax response. 

The problem is, when we clicked outside of the filter textbox after typing
something into it, and we clicked on a table row - no table row click ajax
event would be fired due to the "Ajax request stopped because of
precondition check" issue. 

Here's what happens in that case:

a) user clicks outside of filter textbox on table row, an onchange event for
the filter ajax event fires, and a table click event is queued to fire next
b) the onchange filter textbox event adds the table to the response
c) the browser updates the DOM with the new table component
d) the ajax engine in the browser checks to see if it should fire the table
clicked event that was queued
e) the table's html has changed due to step "c" above, and so cancels firing
the event.

Our fix for this was really easy in our case - we know that a click outside
of the filter box won't actually change the textbox's contents at all, so we
added a check in our update handler that compares the filter box's current
value with the last value - if the value has changed, add the table to the
event, if the value hasn't changed, don't add the table. This way the click
on the table outside of the box doesn't have the table DOM change on it
before the event can fire.

I hope this helps. 

We're on Wicket 7.x, so it's possible this issue has been fixed somehow, but
if not, that's how we solved it.

Jason

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

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

Reply via email to