e.Success = False not working.

  1. #1

    How to clear value from afteredit validation server

    This is my code to validate that if I enter incorrect values in column 1 and column2 of a gridpanel, these are erased and present a message. but it does not work:

    Protected Sub grd1_AfterEdit(ByVal sender As Object, ByVal e As DirectEventArgs)
            Dim Column1 As String = e.ExtraParams("column1")
            Dim Column2 As String = e.ExtraParams("column2")
    
            If Column1 <> "" And Column2 <> "" Then
                If Validate1 = True Then
                   e.Success = False
                   cls.ShowMessage("Test", "Erro1.", MessageBox.Button.OK, MessageBox.Icon.INFO)
                ElseIf Validate2 = False Then
                    e.Success = False
                    clsl.ShowMessage("Test", "Error2.", MessageBox.Button.OK, MessageBox.Icon.INFO)
                End If
            End If
        End Sub
    <AfterEdit OnEvent="grdDevolucion_AfterEdit"
                                   Before="return (e.field == 'column1' || e.field == 'column2);"
    Failure="e.record.set('column1',''); e.record.set('column2','');">
                            <ExtraParams>
                                <ext:Parameter Name="column1" Value="e.record.data.column1" Mode="Raw" ></ext:Parameter>
                                <ext:Parameter Name="column2" Value="e.record.data.column2" Mode="Raw" ></ext:Parameter>
                            </ExtraParams>
                        </AfterEdit>
    Regards.
    Last edited by Lisseth; May 18, 2015 at 4:52 PM.
  2. #2
    Basically the problem is that if I comment this line e.Success = False the message is presented, and if I comment the line of message, the fields are cleared, but I need to be deleted if they are incorrect and submitted the message.
    Last edited by Lisseth; May 15, 2015 at 10:55 PM.
  3. #3

    Support someone?

    Please your urgent assistance...

Similar Threads

  1. Replies: 24
    Last Post: Dec 19, 2015, 11:01 AM
  2. MessageBus and DirectEvent.Success = false
    By Spamme in forum 2.x Help
    Replies: 1
    Last Post: Aug 13, 2013, 12:24 PM
  3. Replies: 3
    Last Post: Jan 03, 2013, 6:57 PM
  4. Replies: 3
    Last Post: Jul 16, 2012, 7:36 AM
  5. Replies: 1
    Last Post: Jun 07, 2010, 7:19 AM

Posting Permissions