Interface FormActionApi
- All Superinterfaces:
FormInputBuilderApi
FormActionApi is exposed to form logics through the form binding
during the action mode.
This phase is triggered when a user changes the value of an input. The logic can react by updating other inputs (e.g., setting values, labels, read-only state), inserting new inputs, or modifying the layout.
Extends FormInputBuilderApi so that input builder methods (e.g. create*) are
available for creating inputs to pass to insertAfter(String, ContextParameter...).
- Since:
- 17.0 - Paloma
-
Method Summary
Modifier and TypeMethodDescriptioninsertAfter(String inputName, ContextParameter... inputsToAdd) Inserts one or more new input definitions after the specified existing input.voidRequests a full recalculation of the parent document (Quote, Agreement/Promotion, Rebate Agreement, Compensation Plan) once the frontend applies the changes of this form execution.voidRequests a recalculation of the changes of the parent document (Quote, Agreement/Promotion, Rebate Agreement, Compensation Plan) once the frontend applies the changes of this form execution, that is only the changed line items are recalculated, the same way as when the user clicks Recalculate Changes.Returns the name of the input that triggered the current form execution.updateInput(String inputName) Returns aFormChangeobject for the specified input, allowing modification of its properties such as value, label, read-only state, or validity.Methods inherited from interface FormInputBuilderApi
createAnyUserEntry, createBooleanUserEntry, createButtonEntry, createConfigurationWizardPopup, createCustomerEntry, createCustomerEntry, createCustomerGroupEntry, createCustomerGroupEntry, createCustomFormListPopup, createCustomFormPopup, createDashboardInputs, createDashboardPopup, createDateRangeUserEntry, createDateTimeUserEntry, createDateUserEntry, createDMField, createDMFields, createDmFilter, createDmFilterBuilder, createDmFilterBuilderMultiple, createDmQueryBuilder, createDmQueryBuilderDimOption, createDmQueryFilterBuilder, createDMSource, createFilterBuilder, createHiddenEntry, createInputMatrix, createIntegerUserEntry, createMultiTierEntryInputBuilder, createOptionEntry, createOptionsEntry, createParsableInputTypeFile, createProductEntry, createProductEntry, createProductGroupEntry, createProductGroupEntry, createQuoteType, createRadioEntry, createRangeSliderEntry, createRebateAgreement, createResultMatrixFilterBuilder, createSellerEntry, createSellerEntry, createSellerGroupEntry, createSellerGroupEntry, createSliderEntry, createStringUserEntry, createTextUserEntry, createTimeUserEntry, createTreeEntry, createUserEntry, createVLookup
-
Method Details
-
sourceInputName
String sourceInputName()Returns the name of the input that triggered the current form execution. This is typically the input whose value changed.Example:
if (form.sourceInputName() == "country") { form.updateInput("city").setValue(null) }- Returns:
- The name of the source input.
- Since:
- 17.0 - Paloma
-
updateInput
Returns aFormChangeobject for the specified input, allowing modification of its properties such as value, label, read-only state, or validity. If noFormChangeexists yet for the given input name, a new one is created. Subsequent calls with the same input name return the same instance.Example:
form.updateInput("total") .setValue(input.quantity * input.price) .setReadOnly(true)- Parameters:
inputName- The name of the input to update. Must not benull.- Returns:
- A
FormChangeinstance for the specified input. - Throws:
NullPointerException- ifinputNameisnull.- Since:
- 17.0 - Paloma
-
insertAfter
Inserts one or more new input definitions after the specified existing input. This allows dynamically adding inputs to the form during custom action (onValueChange, onClick...) mode execution. Multiple calls for the same input name accumulate the inputs to be inserted.Example:
def newInput = form.createStringUserEntry("notes") .setLabel("Notes") .buildFormInput() form.insertAfter("quantity", newInput)- Parameters:
inputName- The name of the existing input after which new inputs will be inserted. Must not benull.inputsToAdd- The input definitions to insert as ContextParameter instances.- Returns:
- A
FormChangeinstance for the specified input, with the new inputs queued for insertion. - Throws:
NullPointerException- ifinputNameisnull.- Since:
- 17.0 - Paloma
-
recalculateParent
void recalculateParent()Requests a full recalculation of the parent document (Quote, Agreement/Promotion, Rebate Agreement, Compensation Plan) once the frontend applies the changes of this form execution. It is the Forms equivalent of the configurator flagrecalculateParentEntityOnConfirm.The recalculation runs the same way as when the user clicks Recalculate. It is requested by this execution only, so the logic calls the method again whenever another change needs it. It has no effect when the form is not attached to a document header or line item. When
recalculateParentChanges()is called in the same execution as well, the full recalculation wins.The action phase runs only for the inputs registering a value change or click event, e.g. with
onValueChange().Example:
if (form.sourceInputName() == "Currency") { form.recalculateParent() }- Since:
- 18.0 - Painkiller
-
recalculateParentChanges
void recalculateParentChanges()Requests a recalculation of the changes of the parent document (Quote, Agreement/Promotion, Rebate Agreement, Compensation Plan) once the frontend applies the changes of this form execution, that is only the changed line items are recalculated, the same way as when the user clicks Recalculate Changes.It is requested by this execution only and has no effect when the form is not attached to a document header or line item. When
recalculateParent()is called in the same execution as well, the full recalculation wins.Example:
if (form.sourceInputName() == "Plant") { form.recalculateParentChanges() }- Since:
- 18.0 - Painkiller
-