[CLOSED] Remote Validation and Processing Time

  1. #1

    [CLOSED] Remote Validation and Processing Time

    Hello, I've implemented remote validation for one of the fields.
    Anyway it still troubles me, because user is still able to perform a quick save click and avoid the validation. Tried with disabling the 'Save' button during the validation process, but if performed real quickly can be overridden as well :-(.
    Here's the code:
    <ext:NumberField ID="nfTemplateID" runat="server" AllowDecimals="false" AllowNegative="false"
                                    IsRemoteValidation="true" MaxLength="10" Width="120">
                                    <RemoteValidation OnValidation="CheckField" />
                                    <Listeners>
                                        <BeforeRemoteValidation Handler="top.RibbonButton('save').disable()" />
                                        <RemoteValidationValid Handler="top.RibbonButton('save').enable()" />
                                    </Listeners>
                                </ext:NumberField>
    Server method:
     Protected Sub CheckField(ByVal sender As Object, ByVal e As RemoteValidationEventArgs)
            Dim field As NumberField = DirectCast(sender, NumberField)
            Dim oReq As Requirement.Requirement
            Dim ReqId As Integer
          
            If Not field.Value Is Nothing Then
                Try
                    ReqId = Convert.ToInt32(field.Value)
                    oReq = New Requirement.Requirement(ReqId)
    
                    If oReq Is Nothing OrElse oReq.ReqId = 0 Then
                        e.Success = False
                        e.ErrorMessage = "Requsition with the ID: " & ReqId & " does not exist!"
                    Else
                        e.Success = True
    
                    End If
    
                Catch ex As ReqNotFoundException
                    e.Success = False
                    e.ErrorMessage = "Requsition with the ID: " & ReqId & " does not exist!"
                End Try
            Else
                e.Success = True
            End If
    
        End Sub
    Last edited by Daniil; Jun 20, 2012 at 10:55 AM. Reason: [CLOSED]
  2. #2
    Hi,

    I think the button should be disabled by default and enable it if everything is valid only.
  3. #3
    Quote Originally Posted by Daniil View Post
    Hi,

    I think the button should be disabled by default and enable it if everything is valid only.
    Well maybe it should, but this is not the case with a couple of hundreds of other pages in this app, so it should not be with this one either.
    Especially that this field is not a required field.

    Any other idea?


    Thanks.
  4. #4
    Please update from SVN and set up:
    <RemoteValidation Delay="0">
    Does it help?

Similar Threads

  1. [OPEN] [#100] Validation - Remote/Client
    By adelaney in forum 2.x Legacy Premium Help
    Replies: 7
    Last Post: Dec 29, 2012, 6:12 AM
  2. [CLOSED] Remote validation question
    By bogc in forum 1.x Legacy Premium Help
    Replies: 11
    Last Post: May 09, 2012, 2:16 PM
  3. Replies: 3
    Last Post: Jul 11, 2011, 9:43 AM
  4. [CLOSED] Remote validation initial value
    By Leonid_Veriga in forum 1.x Legacy Premium Help
    Replies: 3
    Last Post: Dec 27, 2010, 7:37 AM
  5. Remote Validation
    By olimpia in forum 1.x Help
    Replies: 0
    Last Post: Jun 12, 2009, 7:39 PM

Tags for this Thread

Posting Permissions