Prev | Current Page 541 | Next

Frank Zammetti

"Practical DWR 2 Projects"

Remember
that we configured a global exception handler earlier, so there??™s no need to do anything more in any of these
methods. Any exception thrown by the server will be handled generically, no questions asked.
It??™s my opinion that if you can design your applications such that a single global exception handler can
do the trick for you, that??™s definitely a Good Thing?„? since it will greatly simplify the code throughout the
application. Of course, such a single generic function might not always be appropriate; but if you start out
that way, you can still configure a handler for a specific call that needs to handle things a little differently, and
it will override the global handler. You may even want to do your call-specific work, and then call the generic
handler yourself. That would be a good, extensible design for sure.
doNewDirectory() Method
Creating a new directory is only slightly more involved than creating a new file, due to the
need to update the directory tree as well as the file grid.
this.doNewDirectory = function(inSelectedDirectory) {
// Only do something if a directory is selected.
if (inSelectedDirectory == null || inSelectedDirectory == "") {
alert("Please select a directory to create new directory in");
return;
}
// Get directory path where the new directory will be created.


Pages:
529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553