Beispiel #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
}
Beispiel #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
}