    /**
     * Represents a clause
     *
     * @author ELO Digital Office GmbH
     *
     * @elowf
     * @requires sol.common.forms.FormWrapper
     */

    sol.define("sol.contract.forms.CreateClause", {
      extend: "sol.common.forms.FormWrapper",
      prefix: "CONTRACT",
      defaultState: "defaultState",

      onSaveRules: {
      },

      AfterOnInitAndTabChange: function() {
        var me = this,
            author,
            categories,
            types;

        author = me.fields.IX_GRP_CLAUSE_AUTHOR.value();
        if (!author) {
          me.fields.IX_GRP_CLAUSE_AUTHOR.set(ELO_PARAMS.ELO_CONNECTUSERNAME);
        }

        categories = me.fields.IX_MAP_CONTRACT_CATEGORIES_ALLTOGGLE.value();
        if (!categories) {
          me.fields.IX_MAP_CONTRACT_CATEGORIES_ALLTOGGLE.set("sol.contract.clause.form.categoriesAll");
        }

        types = me.fields.IX_MAP_CONTRACT_TYPES_ALLTOGGLE.value();
        if (!types) {
          me.fields.IX_MAP_CONTRACT_TYPES_ALLTOGGLE.set("sol.contract.clause.form.typesAll");
        }
      },

      AfterOnSave: function () {
        var me = this;

        if (me.fields.IX_MAP_CONTRACT_CATEGORIES_ALLTOGGLE.value() == "sol.contract.clause.form.categoriesAll") {
          me.fields.IX_GRP_CONTRACT_CATEGORIES.set("ALL");
        } else {
          me.updateMultiIndexFromMapTableColumn(me.fields.IX_GRP_CONTRACT_CATEGORIES, "IX_MAP_CONTRACT_CATEGORY");
        }

        if (me.fields.IX_MAP_CONTRACT_TYPES_ALLTOGGLE.value() == "sol.contract.clause.form.typesAll") {
          me.fields.IX_GRP_CONTRACT_TYPES.set("ALL");
        } else {
          me.updateMultiIndexFromMapTableColumn(me.fields.IX_GRP_CONTRACT_TYPES, "IX_MAP_CONTRACT_TYPE");
        }
      },

      states: {
        stateInit: {
          fieldProperties: {
            IX_MAP_CONTRACT_CATEGORIES_ALLTOGGLE: {
              template: {
                name: "toggle",
                config: {
                  toggleOptionFieldName: "IX_MAP_CONTRACT_CATEGORIES_ALLTOGGLE",
                  onValue: "sol.contract.clause.form.categoriesSelected",
                  offValue: "sol.contract.clause.form.categoriesAll",
                  onState: {
                    tabProperties: {
                      all: {
                        _221_clause_categories: {
                          hidden: false
                        }
                      }
                    }
                  },
                  offState: {
                    tabProperties: {
                      all: {
                        _221_clause_categories: {
                          hidden: true
                        }
                      }
                    }
                  },
                  defaultState: {
                    tabProperties: {
                      all: {
                        _221_clause_categories: {
                          hidden: true
                        }
                      }
                    }
                  }
                }
              }
            },
            IX_MAP_CONTRACT_TYPES_ALLTOGGLE: {
              template: {
                name: "toggle",
                config: {
                  toggleOptionFieldName: "IX_MAP_CONTRACT_TYPES_ALLTOGGLE",
                  onValue: "sol.contract.clause.form.typesSelected",
                  offValue: "sol.contract.clause.form.typesAll",
                  onState: {
                    tabProperties: {
                      all: {
                        _231_clause_types: {
                          hidden: false
                        }
                      }
                    }
                  },
                  offState: {
                    tabProperties: {
                      all: {
                        _231_clause_types: {
                          hidden: true
                        }
                      }
                    }
                  },
                  defaultState: {
                    tabProperties: {
                      all: {
                        _231_clause_types: {
                          hidden: true
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        },
        defaultState: {
          bodyClasses: [
            "default"
          ],
          fieldProperties: {}
        }
      }
    });