[Seaside] add parameter to settings onAjaxError/ajaxErrorHandler

Johan Brichau johan at inceptive.be
Sat Feb 11 14:37:31 UTC 2017

Hi Sabine,

The ‘suppressErrors’ setting is added only to the ajax request in your code snippet.
Do you mean the callbacks generated inside RKADeletedAccountView are missing the ‘supressErrors’ setting?

Since it’s a setting of an individual ajax request, my understanding is you need to add it to every ajax request you need it.
Maybe I’m not entirely understanding what you mean with "the supressErrors variable would be available” ? 
Do you mean on the client-side or on the server-side?

The way you work with replacing a page using an ajax request is certainly viable. 
What element of the page is your pageID attached to? <body>?


> On 11 Feb 2017, at 12:25, Sabine Manaa <manaa.sabine at gmail.com> wrote:
> Hi Johan,
> thank you for your answer! (I saw that you answered Joachims very
> interesting question and was hoping that you would come to mine, too, and,
> yeah, I have an answer :-))
> I tried it with a simple example and can reproduce it.
> Unfortunately, my case has one more problem/step where I ask you for help. 
> The situation is: My user decided to delete its account by click on a
> button. Then I delete the user from database, remove his session and
> transfer him to a page where I ask for the reason why he wants to leave (I
> hope this will be needed never haha). In this situation, there is no session
> anymore and normally, my error handler dialog (onAjaxError) would pop up
> ("There is no session, please log in again bla bla").
> I do it as suggested by you:
> onClick:
> 	(html jQuery ajax
> 		optionAt: 'supressErrors' put: 'true';
> 		script: [ :script | 
> 			"delete user, session etc "
> 			script << (script jQuery id: self pageID) replaceWith: [ :h |
> RKADeletedAccountView new renderContentOn: h ] ]);
> with: 'Ja'.
> If I would not transfer the user to the RKADeletedAccountView but would stay
> at the current page, the supressErrors variable would be available.
> But within the RKADeletedAccountView, the variable is not visible. Is there
> a way to have this information also in the new rendered
> RKADeletedAccountView/avoid that the Ajax error handler pops up? 
> (BTW: I render the RKADeletedAccountView within the existing html head by
> replacing my node "pageID" by the form for requesting the info from the
> user. So, I save loading all css etc head stuff again, this is how my whole
> application works. If there is no other alternative, I think I could also
> load all and do not register the error handler. But having the 
> "supressErrors" solution seems to be smarter to me.) 
> Regards 
> Sabine
> --
> View this message in context: http://forum.world.st/add-parameter-to-settings-onAjaxError-ajaxErrorHandler-tp4933109p4933917.html
> Sent from the Seaside General mailing list archive at Nabble.com.
> _______________________________________________
> seaside mailing list
> seaside at lists.squeakfoundation.org
> http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside

More information about the seaside mailing list