Hybrid View

    Wait! Looks like we don't have enough information to add this to bug database. Please follow this template bug format.
  1. #1
    Sencha User
    Join Date
    Jun 2013
    Posts
    14
    Vote Rating
    0
    sunafi is on a distinguished road

      0  

    Default DateField.setAutoValidate

    DateField.setAutoValidate


    Description of setAutoValidate() is that it validate on each key press but I see red mark only once user move out of the datefield cell... Is it a bug? or my assumption is wrong?


    void com.sencha.gxt.widget.core.client.form.Field.setAutoValidate(boolean autoValidate)


    Sets whether the value is validated on each key press (defaults to false).

    ----
    OS - Windows XP
    GXT - 3.0.1 free
    Browser - IE/ Chrome / Firefox

    Regards,
    saunafi.

  2. #2
    Sencha - GXT Dev Team
    Join Date
    Feb 2009
    Location
    Minnesota
    Posts
    2,717
    Vote Rating
    88
    Colin Alworth is a glorious beacon of light Colin Alworth is a glorious beacon of light Colin Alworth is a glorious beacon of light Colin Alworth is a glorious beacon of light Colin Alworth is a glorious beacon of light

      0  

    Default


    The design of autovalidate is to not deal with parse errors, but only to look at legal values - for a datefield, this means that it should try to read the text and turn it into a date, then see if that date matches the validation rules (allowblank, min date, max date, etc). If it does not, then it should automatically display the message, etc.

    Parse errors are (currently, for better or worse) assumed to be the result of the user not having finished typing - once they leave the field, we know they are done, and can tell them that a mistake was made.

    Is this the behavior you are seeing? If not, can you please follow the bug format to give us a test sample that we can reproduce?

  3. #3
    Sencha User
    Join Date
    Jun 2013
    Posts
    14
    Vote Rating
    0
    sunafi is on a distinguished road

      0  

    Default Thanks for your reply.

    Thanks for your reply.


    Hello Colin ,

    Thanks for your reply.

    1) Problem I am facing is that I am not getting error message while typing, even if I type special char like !@#$%.
    and see red mark next to box only when mouse is out of the edit cell (lost focus from date cell).

    2) I am using Max-length validator for text-box; in that case if length is more than max-length; and on lost focus
    - typed value remains in that edit cell
    - red-mark becomes visible next to that cell
    - (Critical) "Accept" button becomes disable - so user can't say "Accept" and is forced to correct invalid value.

    But in case of date cell, it shows red mark (clears value - which can be set not to clear), but Critical is "Accept" button is not disable...

    I have large number of columns and date columns are out of screen, so when user enters invalid value in date cell and uses bottom scroll-bar to go back on left hand side (beginning of screen); user miss to notice red mark for wrong value and "Accept" button is not disabled.

    ---
    Code:
            
    
    GridRowEditing<Store> editableGrid = new GridRowEditing<Store>(null);
            editableGrid.setMessages(new RowEditorMessages() {
                @Override
                public String cancelText() {
                    return constants.rowCancel();
                }
                @Override
                public String dirtyText() {
                    return constants.rowDirty();
                }
                @Override
                public String errorTipTitleText() {
                    return constants.rowErrorTipTitleText();
                }
                @Override
                public String saveText() {
                    return constants.rowUpdate();
                }
            });
            editableGrid.setClicksToEdit(ClicksToEdit.TWO);
    
    
    
    
    
    
    
    
    
    
    ColumnConfig<Store, Date> dateClosed = new ColumnConfig<Store, Date>(properties.dateClosed(), COL_SIZE_8, getSafeHtml(constants.dateClosed()));
            dateClosed.setCell(new DateCell(format));
            
    
            dateField = new DateField(new DateTimePropertyEditor(DateTimeFormat.getFormat(PredefinedFormat.DATE_SHORT)));
            dateField.setAutoValidate(true);
            editableGrid.addEditor(dateClosed, dateField);




Thread Participants: 1