Gelmiş geçmiş en büyük porno sitemiz olan 2pe de her zaman en kaliteli pornoları sunmayı hedefledik. Diğer video sitemiz olan vuam da ise hd porno ağırlıklı çalışmalara başladık.

  1. #1
    Sencha User
    Join Date
    Aug 2011
    Posts
    11
    Vote Rating
    0
    Blessed Geek is on a distinguished road

      0  

    Default How to bind buttons to fields in FieldSet?

    How to bind buttons to fields in FieldSet?


    My form has a few FieldSets.

    Is the formbinding capable of binding fields in those FieldSets to a button?

    Is the formbinding capable of binding fields of a certain FieldSet to a button?

    Would like to know how. Thx.

  2. #2
    Sencha User
    Join Date
    Aug 2011
    Posts
    11
    Vote Rating
    0
    Blessed Geek is on a distinguished road

      0  

    Default


    This is how I solved the deficiency. I am using gxt 2.2.5.

    Code:
    class FieldSetFriendlyFormPanel extends FormPanel
    {
      /**
       * isValid is called by FormButtonBinding
       * to dis/enable the fields in a form
       * based on the validation of member fields
       */
      @Override
      public boolean isValid(boolean preventMark) {
        boolean valid = true;
        for (Field<?> f : getFields()) {
          if (!f.isValid(preventMark)) {
            valid = false;
          }
        }
        
        for(Component c : getItems()) {
          if (c instanceof FieldSet) {
            validateFieldSet((FieldSet)c, preventMark, valid);
          }
        }
        
        return valid;
      }
    
    
      protected boolean validateFieldSet(FieldSet fieldset, boolean preventMark, boolean valid) {
        for(Component c : fieldset.getItems()) {
          if (c instanceof Field) {
            if (((Field)c).isValid(preventMark))
              valid = false;
          }
        }
        
        return valid;
      }
    }