Discussion:
Ajax request stopped because of precondition check
Oliver Krohne
2013-01-14 06:53:13 UTC
Permalink
Hi,

I am using jquery ui menu widget and AjaxLink for the menu items. The click event fails because of a precondition error:
Ajax request stopped because of precondition check, url: ./publisher?1-1.IBehaviorListener.0-publisher-outerSplitter-left-publisher


I saw similar issues in the archive but the solutions seems not match my issue.

Any idea how I can nail down the problem?

This is with wicket 6.4.0 and jQuery 1.8.23.

Thanks,
Oliver
Andrea Del Bene
2013-01-14 11:45:20 UTC
Permalink
AJAX precodintions are handled with interface IAjaxCallListener. Check
if your AjaxLink overrides method updateAjaxAttributes and if it adds
one or more IAjaxCallListener
Post by Oliver Krohne
Hi,
Ajax request stopped because of precondition check, url: ./publisher?1-1.IBehaviorListener.0-publisher-outerSplitter-left-publisher
I saw similar issues in the archive but the solutions seems not match my issue.
Any idea how I can nail down the problem?
This is with wicket 6.4.0 and jQuery 1.8.23.
Thanks,
Oliver
--
Andrea Del Bene

Abaco Informatica S.r.l.
Via Montegrappa, 3
61121 Pesaro (IT)

Tel. +39 0721 35425 Fax. +39 0721 32967
P.IVA 00933130411

Associato AssoProvider
CISCO Systems Partner PREMIER Certified
ABANET is associated to RIPE (AS 12468)
Http://www.abanet.it

Questa é una email privata ad uso confidenziale; é proibito ogni uso non autorizzato.
This message is confidential; any unauthorised use is forbidden.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-***@wicket.apache.org
For additional commands, e-mail: users-***@wicket.apache.org
Oliver Krohne
2013-01-14 15:55:59 UTC
Permalink
Hi,

I am not overriding updateAjaxAttributes, I am just implementing onClick. The AjaxLink is working fine outside the jquery ui menu. It seems to be a problem with the events of the menu widget.

Can I somehow disable the precondition on the AjaxLink?

Thanks,
Oliver
AJAX precodintions are handled with interface IAjaxCallListener. Check if your AjaxLink overrides method updateAjaxAttributes and if it adds one or more IAjaxCallListener
Post by Oliver Krohne
Hi,
Ajax request stopped because of precondition check, url: ./publisher?1-1.IBehaviorListener.0-publisher-outerSplitter-left-publisher
I saw similar issues in the archive but the solutions seems not match my issue.
Any idea how I can nail down the problem?
This is with wicket 6.4.0 and jQuery 1.8.23.
Thanks,
Oliver
--
Andrea Del Bene
Abaco Informatica S.r.l.
Via Montegrappa, 3
61121 Pesaro (IT)
Tel. +39 0721 35425 Fax. +39 0721 32967
P.IVA 00933130411
Associato AssoProvider
CISCO Systems Partner PREMIER Certified
ABANET is associated to RIPE (AS 12468)
Http://www.abanet.it
Questa é una email privata ad uso confidenziale; é proibito ogni uso non autorizzato.
This message is confidential; any unauthorised use is forbidden.
---------------------------------------------------------------------
---------------------------------------------------------------------
To unsubscribe, e-mail: users-***@wicket.apache.org
For additional commands, e-mail: users-***@wicket.apache.org
Martin Grigorov
2013-01-15 07:05:30 UTC
Permalink
Hi,

There is a default precondition that checks that the HTML element (the link
in this case) on which the event ('click') listens is still in the current
DOM document.
But I don't see how it will return false - if it wasn't in the document
then you wont be able to click on it.

If you are able to create a quickstart please attach it to Jira so we can
debug it.
Post by Oliver Krohne
Hi,
I am not overriding updateAjaxAttributes, I am just implementing onClick.
The AjaxLink is working fine outside the jquery ui menu. It seems to be a
problem with the events of the menu widget.
Can I somehow disable the precondition on the AjaxLink?
Thanks,
Oliver
Post by Andrea Del Bene
AJAX precodintions are handled with interface IAjaxCallListener. Check
if your AjaxLink overrides method updateAjaxAttributes and if it adds one
or more IAjaxCallListener
Post by Andrea Del Bene
Post by Oliver Krohne
Hi,
I am using jquery ui menu widget and AjaxLink for the menu items. The
./publisher?1-1.IBehaviorListener.0-publisher-outerSplitter-left-publisher
Post by Andrea Del Bene
Post by Oliver Krohne
I saw similar issues in the archive but the solutions seems not match
my issue.
Post by Andrea Del Bene
Post by Oliver Krohne
Any idea how I can nail down the problem?
This is with wicket 6.4.0 and jQuery 1.8.23.
Thanks,
Oliver
--
Andrea Del Bene
Abaco Informatica S.r.l.
Via Montegrappa, 3
61121 Pesaro (IT)
Tel. +39 0721 35425 Fax. +39 0721 32967
P.IVA 00933130411
Associato AssoProvider
CISCO Systems Partner PREMIER Certified
ABANET is associated to RIPE (AS 12468)
Http://www.abanet.it
Questa é una email privata ad uso confidenziale; é proibito ogni uso non
autorizzato.
Post by Andrea Del Bene
This message is confidential; any unauthorised use is forbidden.
---------------------------------------------------------------------
---------------------------------------------------------------------
--
Martin Grigorov
jWeekend
Training, Consulting, Development
http://jWeekend.com <http://jweekend.com/>
onejasonforsale
2018-10-05 23:08:46 UTC
Permalink
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-***@wicket.apache.org
For additional commands, e-mail: users-***@wicket.apache.org

Loading...