Plugin Developer Discussion

Discussion for FogBugz Plugin developers

Dialog form entry checking

Is it possible to do client side checking within a dialog to validate the items? I notice some error functions in the class, but I'm not sure where/how to use them. Is this somehow handled in the RawPageDisplay? Thanks for any help.
tracstarr Send private email
Sunday, December 13, 2009
 
 
Hi Trackstarr-
Of course there's no way for the API to limit what you can do in Javascript - you can have a look at the generated html and use raw Javascript to do any validation you like. See examples/CustomFields/Plugin.was for some JS used with CDialog. But the dialog Error methods are for setting errors via server roundtrip.
Thanks!
Brett
Brett Kiefer Send private email
Monday, December 14, 2009
 
 
Ok, fair enough. Lets say I do round trip error checking. Are there any examples of that using the dialogs? I can only assume there is some way to extract the current dialog being displayed to validate it? And either close and continue or cancel closing it to display the errors?
tracstarr Send private email
Monday, December 14, 2009
 
 
Hi Tracstarr-
The Plugins/examples/Workflow plugin is a good example. It's in Wasabi, which is really not very different from C#, if that's what you are used to. You just want to do SetError on the item where you want to display the error. This plugin defines a convenience function AddErrorToItem so that it can throw all of its errors into a dictionary and then show errors on an item if the error was found. Have a look and see if it makes sense to you.
Thanks!
Brett
Brett Kiefer Send private email
Monday, December 14, 2009
 
 
I'll take a look at it now. Is there a development environment available for wasabi code?
tracstarr Send private email
Monday, December 14, 2009
 
 
The build.bat script in the plugin directory should build it, and we have a syntax file available for Vim, if you want it. If the build script doesn't do the trick, you might need to debug into that a bit (e.g. if it isn't finding Wasabi.exe for some reason).
Thanks!
Brett
Brett Kiefer Send private email
Monday, December 14, 2009
 
 

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics
 
Powered by FogBugz