Re: Wicket.Event.subscribe - how to get a response header
On Mon, Apr 2, 2018 at 3:53 PM, Entropy wrote: > Actually, yes, on some of our pages. That might explain it. So then in > that > case, how would I add a request header or check a response header from the > server? > As far as I know you cannot read the response headers from request made with IFrame. In Wicket 8.x this IFrame has been removed and now it uses Ajax APIs to upload files, so it should always pass non-null jqXHR. But you are on Wicket 6.x ... > > -- > 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 > >
Re: Wicket.Event.subscribe - how to get a response header
Actually, yes, on some of our pages. That might explain it. So then in that case, how would I add a request header or check a response header from the server? -- 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
Re: Wicket.Event.subscribe - how to get a response header
Are you trying to submit a multipart form via Ajax? Wicket uses an iframe for that case and jqXHR is will be null in case of a failure. Have fun Sven Am 30.03.2018 um 16:36 schrieb Entropy: Okay, but I am at a breakpoint and it definitely is null. This is in chrome and IE11. We use jQuery v1.12.4 if that makes a difference (I don't think it does). I'm sure I must be doing something to cause the issue, but I've no idea what. -- 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 - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Wicket.Event.subscribe - how to get a response header
Okay, but I am at a breakpoint and it definitely is null. This is in chrome and IE11. We use jQuery v1.12.4 if that makes a difference (I don't think it does). I'm sure I must be doing something to cause the issue, but I've no idea what. -- 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
Re: Wicket.Event.subscribe - how to get a response header
Hi, we have a unit test for that. Here's the line for Wicket 6: https://github.com/apache/wicket/blob/548e1c090bc67d2e36308beaca9243b48aaaf613/wicket-core/src/test/js/ajax.js#L564 Sven Am 30.03.2018 um 01:20 schrieb Entropy: For some reason, jqXHR is null when I run subscribe a failure listener. It's the third parameter, correct? function onFailure(jqEvent, attributes, jqXHR, errorThrown, textStatus) { var value = jqXHR.getResponseHeader('myHeader'); if('true' == value) //do something } Wicket.Event.subscribe('/ajax/call/failure', onFailure); -- 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 - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Wicket.Event.subscribe - how to get a response header
For some reason, jqXHR is null when I run subscribe a failure listener. It's the third parameter, correct? function onFailure(jqEvent, attributes, jqXHR, errorThrown, textStatus) { var value = jqXHR.getResponseHeader('myHeader'); if('true' == value) //do something } Wicket.Event.subscribe('/ajax/call/failure', onFailure); -- 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
Re: Wicket.Event.subscribe - how to get a response header
jqXHR.getResponseHeader("Foo"); Have fun Sven Am 26. März 2018 14:23:32 MESZ schrieb Entropy : >I've defined a javascript event handler using Wicket.Event.subscribe. >How >would I get a response header in that callback? According to docs I >saw, >the parameters are: attrs, jqXHR, textStatus, jqEvent, errorThrown. I >set a >breakpoint and inspected each and didn't see a response header >collection >that was obvious to me. > >This is Wicket 6. > >-- >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
Wicket.Event.subscribe - how to get a response header
I've defined a javascript event handler using Wicket.Event.subscribe. How would I get a response header in that callback? According to docs I saw, the parameters are: attrs, jqXHR, textStatus, jqEvent, errorThrown. I set a breakpoint and inspected each and didn't see a response header collection that was obvious to me. This is Wicket 6. -- 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