Package org.cxbox.core.dto.rowmeta
Class RowDependentFieldsCommonMeta<T extends org.cxbox.api.data.dto.DataResponseDTO>
java.lang.Object
org.cxbox.api.data.dto.rowmeta.FieldsDTO
org.cxbox.core.dto.rowmeta.RowDependentFieldsCommonMeta<T>
- All Implemented Interfaces:
Iterable<org.cxbox.api.data.dto.rowmeta.FieldDTO>
- Direct Known Subclasses:
RowDependentFieldsDictionaryDeprecatedMeta
public class RowDependentFieldsCommonMeta<T extends org.cxbox.api.data.dto.DataResponseDTO>
extends org.cxbox.api.data.dto.rowmeta.FieldsDTO
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final com.fasterxml.jackson.databind.ObjectMapperFields inherited from class org.cxbox.api.data.dto.rowmeta.FieldsDTO
fields -
Constructor Summary
ConstructorsConstructorDescriptionRowDependentFieldsCommonMeta(com.fasterxml.jackson.databind.ObjectMapper objectMapper) -
Method Summary
Modifier and TypeMethodDescriptionfinal voidaddConcreteValue(DtoField<? super T, ?> field, org.cxbox.api.data.dictionary.SimpleDictionary dictDTO) Adds a value to an existing list of selectable valuesfinal voidfinal voidorg.cxbox.api.data.dto.rowmeta.FieldDTO<F> @NonNull Optional<F>getCurrentValue(@NonNull DtoField<? super T, F> field) final void<V> booleanisFieldChangedNow(RowDependentFieldsMeta<T> fields, DtoField<? super T, V> field) Сhecks whether the specified field was modified by the user in the UI (Frontend) during the current iteration.final voidfinal voidsetConcreteValues(DtoField<? super T, ?> field, Collection<org.cxbox.api.data.dictionary.SimpleDictionary> dictDtoList) final <V> voidsetCurrentValue(DtoField<? super T, V> field, V value) voidsetDisabled(List<String> fields) final voidsetDisabled(DtoField<? super T, ?>... fields) final voidsetDrilldown(DtoField<? super T, ?> field, DrillDownTypeSpecifier drillDownType, String drillDown) final voidsetDrilldowns(List<FieldDrillDown> drillDowns) final voidsetDrilldownWithFilter(DtoField<? super T, ?> field, DrillDownTypeSpecifier drillDownType, String drillDown, Consumer<FC> fc) Sets drill-down functionality with filter capabilities for a specific field.final voidsetEnabled(DtoField<? super T, ?>... fields) final voidfinal voidsetNotHidden(DtoField<? super T, ?>... fields) final voidsetNotRequired(DtoField<? super T, ?>... fields) final voidsetPlaceholder(DtoField<? super T, ?> field, String placeholder) final voidsetRequired(DtoField<? super T, ?>... fields) Methods inherited from class org.cxbox.api.data.dto.rowmeta.FieldsDTO
add, get, iterator, ofMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface java.lang.Iterable
forEach, spliterator
-
Field Details
-
objectMapper
@Qualifier("cxboxObjectMapper") protected final com.fasterxml.jackson.databind.ObjectMapper objectMapper
-
-
Constructor Details
-
RowDependentFieldsCommonMeta
public RowDependentFieldsCommonMeta(@Qualifier("cxboxObjectMapper") com.fasterxml.jackson.databind.ObjectMapper objectMapper)
-
-
Method Details
-
get
-
getCurrentValue
@NonNull public <F> @NonNull Optional<F> getCurrentValue(@NonNull @NonNull DtoField<? super T, F> field) - Type Parameters:
F- field type- Parameters:
field- field ref- Returns:
- currentValue of field. Optional.empty() if value is null or field is not present.
-
addConcreteValue
public final void addConcreteValue(DtoField<? super T, ?> field, org.cxbox.api.data.dictionary.SimpleDictionary dictDTO) Adds a value to an existing list of selectable values- Parameters:
field- widget field with type dictionarydictDTO- DTO with dictionary value
-
setRequired
-
setNotRequired
-
required
-
setHidden
-
setNotHidden
-
disableFields
public final void disableFields() -
setDisabled
-
setEnabled
-
disable
-
setDisabled
-
setConcreteValues
public final void setConcreteValues(DtoField<? super T, ?> field, Collection<org.cxbox.api.data.dictionary.SimpleDictionary> dictDtoList) -
setDrilldown
public final void setDrilldown(DtoField<? super T, ?> field, DrillDownTypeSpecifier drillDownType, String drillDown) -
setDrilldownWithFilter
public final void setDrilldownWithFilter(DtoField<? super T, ?> field, DrillDownTypeSpecifier drillDownType, String drillDown, Consumer<FC> fc) Sets drill-down functionality with filter capabilities for a specific field.This method configures a drill-down URL with optional filtering parameters for a DTO field. It retrieves the
PlatformDrilldownServiceto generate URL filter parameters and applies them to the field's drill-down configuration.Example: fields.setDrilldownWithFilter( MyDTO_.value, DrillDownType.INNER, "screen/myscreen/view/myview", fc -> fc // add with default builder .add(RestController.myBc, MyDefaultDTO.class, fb -> fb .dictionaryEnum(MyDefaultDTO_.status, getStatusFilterValues(id)) .multiValue(MyDefaultDTO_.multivalueField, myMultivalueField)) // add with custom filter builders .add(RestController.myBc, MyDefaultDTO.class, new TypeToken<MyCustomFilterBuilder<MyCustomDTO>>() { }, fb -> fb .dictionaryEnum(MyDTO_.status, getStatusFilterValues(id)) .multiValue(MyDTO_.multivalueField, myMultivalueFilterField) .myCustomFields(MyDTO_.customField, myCustomFieldFilterValue );- Parameters:
field- the DTO field to configure drill-down for. Can be null, in which case no configuration will be applieddrillDownType- the type specifier that defines the drill-down behaviordrillDown- the base drill-down URL stringfc- a consumer that accepts and configures the filter configuration object. This allows customization of filtering parameters that will be appended to the drill-down URL
-
setDrilldowns
-
setCurrentValue
-
setPlaceholder
-
isFieldChangedNow
Сhecks whether the specified field was modified by the user in the UI (Frontend) during the current iteration.- Parameters:
fields- Current state of field metadata.field- DTO field to check- Returns:
- boolean. true – If the field was changed in the UI during the current iteration. false – If the field remains unchanged.
This method differs from
isFieldChangedin that it specifically checks whether the field was changed right now, during the current client-side action. It does this by checking thechangedNowParamtag.In contrast,
isFieldChangedchecks for any change to the field, based on thedatatag, which accumulates all changes over time (especially during force active), and may include fields that were changed earlier not necessarily in the current iteration.
-