How to implement simple error/exception handling

2013-08-22 Thread nn kk
 Hi,
I read about exceptions and error handling in tapestry, but still can not find 
the best way, to send messages to front-end. I want to be able to send 
exception messages and error codes, as I can do it in jquary ajax success or 
error blocks. When I throw some custom exception I don't want to redirect to 
the exception page, but to show the message in pop-up to the user. Or to send 
different completion messages and to display them in dialogs. I managed to open 
dialogs with callbacks of ajax object as here:
 ajaxResponseRenderer.addCallback(new JavaScriptCallback() {

@Override
public void run(JavaScriptSupport 
javaScriptSupport) {

javaScriptSupport.addScript(showErrorModal(););
}
})

, but still can not make it enough generic. And it is not working working when 
I submit the whole page.

-
Само сега спечели смартфон SAMSUNG и още много награди!виж
http://www.specheli.eu/specheli-textgbg.php

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



Re: How to implement simple error/exception handling

2013-08-22 Thread Martin Kersten
This is outside the scope of Tapestry (or at least as far as I am aware
off). Take a look at this example:

http://jumpstart.doublenegative.com.au/jumpstart/together/easycrud/persons

If you hit the Delete on any row it opens a modal dialog asking you whether
or not the item should be really deleted. In your case you need a info box
with a meaningful Information message explaining the error to the user.

You can use jQuery UI for this (check the jQuery for Tapestry modul) or use
what they used in the above example. The Keypart is confirm.js here.

If you need a tapestry only usage you might want to consider a component /
mixin that is returned in case of a XHR request (ajax) and opens the
infobox and vanishes (removes itself from the DOM) after the ok button was
clicked. I dont know if such a component exist and the use would be limited
to zone updates and alike. Also I am not aware of Tapestry providing such a
component (or something similar).

Lets wait what the Tapestry Pros come up with.


2013/8/22 nn kk inv...@abv.bg

  Hi,
 I read about exceptions and error handling in tapestry, but still can not
 find the best way, to send messages to front-end. I want to be able to send
 exception messages and error codes, as I can do it in jquary ajax success
 or error blocks. When I throw some custom exception I don't want to
 redirect to the exception page, but to show the message in pop-up to the
 user. Or to send different completion messages and to display them in
 dialogs. I managed to open dialogs with callbacks of ajax object as here:
  ajaxResponseRenderer.addCallback(new
 JavaScriptCallback() {

 @Override
 public void run(JavaScriptSupport
 javaScriptSupport) {

 javaScriptSupport.addScript(showErrorModal(););
 }
 })

 , but still can not make it enough generic. And it is not working working
 when I submit the whole page.

 -
 Само сега спечели смартфон SAMSUNG и още много награди!виж
 http://www.specheli.eu/specheli-textgbg.php

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