Re: Validation

  •  09-16-2008, 1:24 PM

    Re: Validation

    Thanks!  I got tired of writing the same basic code over and over, so I packaged it up in a control.

    The control fires an event called 'ValidateWorkflowFields'  that you can handle in the page.  In the validation event, return true if you consider the data entered to be valid and the event will be actioned.  Return false and the event will not be actioned (and you could inform the user that comments are required).

    To handle this event, click the control on the canvas, then go to the Properties window.  Click the lightning bolt icon to access the events.  Type in the name of your event handler then double click.

    When you add the name and double click a method stub will be generated.  A WorkflowEventArgs is passed into the event handler as the second parameter.  This argument has a property called SelectedAction that contains the action the user selected.  From there, you could write code to validate your data, for example, you might have something like this:

    It shold be pretty straitforward.  The control also fires a couple other events you can use to load and save workflow fields.


    The statements and opinions made in my postings are my own, and do not reflect the opinions of SourceCode Technology Holdings, Inc. or its subsidiaries. All information is provided as is with no warranties, express or implied, and grants no rights or licenses.
    Filed under: , ,
View Complete Thread