Results 1 to 3 of 3

Thread: [GXT 3.0.5] Radio and validation mark

  1. #1
    Sencha Premium Member
    Join Date
    Nov 2012
    Location
    Cremona Italy
    Posts
    37

    Default [GXT 3.0.5] Radio and validation mark

    Hi forum,

    this time my issue is about the Radio (and CheckBox) validation. I want to achieve a sort of "EmptyValidator" behaviour for my radio group but the problem is that there is no "red attention mark" even if I specifically call "markInvalid()". Actually such method is coded empty for the RadioButton.
    So first of all I'm looking for some hints for a solution and eventually an implementation request.

    Kind regards,
    Marcello

  2. #2
    Sencha Sr Product Manager
    Join Date
    Jan 2012
    Location
    Arlington, WA
    Posts
    1,178

    Default

    Heres how you could show the side error handler with the checkbox and radio. Override the checkbox or radio class and then override the markInvalid. I didn't provide any validator magic here but this shows how to display the side error handler.

    Code:
    public class CheckBoxExt extends CheckBox {
        @Override
        protected void markInvalid(List<EditorError> msg) {
          // do some validator magic if need be or just show the error
          getErrorSupport().markInvalid(msg);
        }
      }
      
      public class RadioExt extends Radio {
        @Override
        protected void markInvalid(List<EditorError> msg) {
          // do some validator magic if need be or just show the error
          getErrorSupport().markInvalid(msg);
        }
      }
      
      @Override
      public void onModuleLoad() {
        CheckBoxExt cb = new CheckBoxExt();
        RootPanel.get().add(cb);
        
        RadioExt r = new RadioExt();
        RootPanel.get().add(r);
        
        cb.markInvalid("Show error");
        r.markInvalid("Show error");
      }

  3. #3
    Sencha Premium Member
    Join Date
    Nov 2012
    Location
    Cremona Italy
    Posts
    37

    Default

    Thank you so much for the hint. I see it doesn't render perfectly (the red attention mark is not alligned with the chech/radio, that's probably why is still not officially developed) but i can work on this.
    Thanks again!
    Regards.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •