Example #1
0
func (self *setPostValuesStructVisitor) EndIndexedFields(indexedFields *model.MetaData) error {
	if indexedFields.Kind == model.SliceKind && indexedFields.Value.CanSet() && !self.form.IsFieldExcluded(indexedFields, self.ctx) {
		indexedFields.Value.Set(utils.DeleteEmptySliceElementsVal(indexedFields.Value))
	}
	return nil
}
Example #2
0
func (self *setPostValuesStructVisitor) EndSlice(slice *model.MetaData) error {
	if slice.Value.CanSet() && !self.form.IsFieldExcluded(slice) {
		slice.Value.Set(utils.DeleteEmptySliceElementsVal(slice.Value))
	}
	return nil
}