Location: Resolved Issues

Discussion: How to cancel the process (deletion/rename/add page)Reported This is a featured thread

Showing 9 posts

saravannan
How to cancel the process (deletion/rename/add page)
Jun 2 2008, 10:44 AM EDT | Post edited: Jun 2 2008, 10:44 AM EDT
From the the overloaded functions, after completing the custom process what value should be provided to
the callback method (like "WPCAPI.onpagecreate_Callback( request.status == 200 );"). Tried providing "false" to the callback method, but its not working out. Following is the error message displayed, "An error occoured while rename/delete/ process."
Do you find this valuable?    
Keyword tags: None
DevinCanterberry
DevinCanterberry
1. RE: How to cancel the process (deletion/rename/add page)
Jun 2 2008, 12:52 PM EDT | Post edited: Jun 2 2008, 12:52 PM EDT
Returning false or passing false as the first parameter to the onpage*_Callback method will cancel the process, causing it to fail with an alert. The behavior you are seeing is indeed correct, though I can imagine you would prefer a more elegant failure.

Good news! If you asynchronously call the onpage*_Callback method, you have the option of passing a second parameter containing the custom error message to be displayed in this alert. For example, in the above example, you could instead call "WPCAPI.onpagecreate_Callback( request.status == 200, request.statusText );".

I hope this helps! I'll be sure update our documentation with this info.

- DC
Do you find this valuable?    

saravannan
2. RE: How to cancel the process (deletion/rename/add page)
Jun 3 2008, 2:28 AM EDT | Post edited: Jun 3 2008, 2:28 AM EDT
Hi Devin, Thanks, your reply worked out for onpagecreate_callback and onpagedelete_callback methods (i.e. passing 2 parameters).
But onpagerename_callback is still providing the error message "An error occoured while attempting to rename the page"
Do you find this valuable?    
DevinCanterberry
DevinCanterberry
3. RE: How to cancel the process (deletion/rename/add page)
Jun 3 2008, 5:10 PM EDT | Post edited: Jun 3 2008, 5:10 PM EDT
Great! Make sure you're returning null in your onpagerename() method to let your call to onpagerename_Callback have a chance to run. I suspect it may be cutting itself short with a false. Do you find this valuable?    

saravannan
4. RE: How to cancel the process (deletion/rename/add page)
Jun 4 2008, 3:04 AM EDT | Post edited: Jun 4 2008, 3:04 AM EDT
yes you are correct, the method was not returning null. Now the error message has gone but the "Rename" button is not getting enabled after cancelling the rename process. Do you find this valuable?    
devin_wetpaint
devin_wetpaint
5. RE: How to cancel the process (deletion/rename/add page)
Jun 4 2008, 3:49 PM EDT | Post edited: Jun 4 2008, 3:49 PM EDT
Ahh, I believe you have found a bug! The button does not deactivate when the process is aborted, but it should. I'll write this up and see about getting into the next hotfix. I've linked this thread to the task, so when it's fixed I'll make sure to post an update here.

Do you find this valuable?    
kristenkuhns
kristenkuhns
6. RE: How to cancel the process (deletion/rename/add page)
Jun 11 2008, 7:04 PM EDT | Post edited: Jun 11 2008, 7:04 PM EDT
hi - can you let us know when to expect this one? thanks, Kristen Do you find this valuable?    
ryan_wetpaint
ryan_wetpaint
7. RE: How to cancel the process (deletion/rename/add page)
Jun 11 2008, 7:31 PM EDT | Post edited: Jun 11 2008, 7:31 PM EDT
We're hoping to get it into next wednesday's release -- we'll post here when it's confirmed. Do you find this valuable?    
devin_wetpaint
devin_wetpaint
8. RE: How to cancel the process (deletion/rename/add page)
Jul 3 2008, 1:17 AM EDT | Post edited: Jul 3 2008, 1:17 AM EDT
Just wanted to let you know that this fix went out with tonight's release. The submit button will now deactivate and your custom error messaging will appear inline in the dialog instead of an alert box.

More information at http://www.wetpaintinjected.com/page/July+2nd+Release+Notes [WTG-677]

- DC
Do you find this valuable?