Validate in different tabs in tabsheet

jmix version: 2.1.2

I have 3 tabs
Each tab have some required fields
If I press save button then it only validate in current tab (It also happened when I use onFieldValidation, field in tab 1 change value and make fields in tab 3 required and it didnt show “requied value for tab-3-field”
how can I activate validation in all tab when I press save button / onFieldValidation.

Here’s my tabsheet

<layout>
        <formLayout id="form" dataContainer="gdSecuritiesDc"/>
        <tabSheet width="100%" classNames="flex-wrap" >
            <tab id="generalInformationTab" label="msg://generalInformationTab.label" classNames="flex-wrap">
                <vbox width="100%" alignItems="START" classNames="flex-wrap">
                    <hbox width="100%">
                        <entityComboBox id="securitiesGroupField" property="securitiesGroup"
                                        width="100%" label="msg://fis.pbcap.finexbackoffice.entity/GdSecurities.securitiesGroup"
                                        dataContainer="gdSecuritiesDc"
                                        itemsContainer="gdSecuritiesGroupsDc">
                            <actions>
                                <action id="securitiesGroup_clear" type="entity_clear"/>
                            </actions>
                        </entityComboBox>
                        <textField id="securitiesCodeField" property="securitiesCode" maxLength="30"
                                   width="100%" label="msg://fis.pbcap.finexbackoffice.entity/GdSecurities.securitiesCode"
                                   dataContainer="gdSecuritiesDc"/>
                        <textField id="securitiesNameField" property="securitiesName" maxLength="300"
                                   width="100%" label="msg://fis.pbcap.finexbackoffice.entity/GdSecurities.securitiesName"
                                   dataContainer="gdSecuritiesDc"/>
                        <textField id="vsdCodeField" property="vsdCode"
                                   width="100%" label="msg://fis.pbcap.finexbackoffice.entity/GdSecurities.vsdCode"
                                   dataContainer="gdSecuritiesDc"/>
                    </hbox>
                    <hbox id = "hbox1" width="100%">
                        <textField id="isinField" property="isin"
                                   width="100%" label="msg://fis.pbcap.finexbackoffice.entity/GdSecurities.isin"
                                   dataContainer="gdSecuritiesDc"/>
                        <select id="depositoryTypeField" property="depositoryType"
                                width="100%" label="msg://fis.pbcap.finexbackoffice.entity/GdSecurities.depositoryType"
                                dataContainer="gdSecuritiesDc"
                                itemsEnum="fis.pbcap.finexbackoffice.enumerate.common.DepositoryType"/>
                        <entityComboBox id="issuerField" property="issuer"
                                        width="100%" label="msg://fis.pbcap.finexbackoffice.entity/GdSecurities.issuer"
                                        dataContainer="gdSecuritiesDc"
                                        itemsContainer="gdIssuersesDc">
                            <actions>
                                <action id="issuer_clear" type="entity_clear"/>
                            </actions>
                        </entityComboBox>
                        <hbox id="hboxToReplaceIssuerField" width="100%" visible="false"/>
                        <entityComboBox id="securitiesTypeField" property="securitiesType"
                                        width="100%" label="msg://fis.pbcap.finexbackoffice.entity/GdSecurities.securitiesType"
                                        dataContainer="gdSecuritiesDc"
                                        itemsContainer="gdSecuritiesTypesDc">
                            <actions>
                                <action id="securitiesType_clear" type="entity_clear"/>
                            </actions>
                        </entityComboBox>
                    </hbox>
                    <hbox width="100%">
                        <entityComboBox id="currencyField" property="currency"
                                        width="100%" label="msg://fis.pbcap.finexbackoffice.entity/GdSecurities.currency"
                                        dataContainer="gdSecuritiesDc"
                                        itemsContainer="gdCurrenciesDc">
                            <actions>
                                <action id="currency_clear" type="entity_clear"/>
                            </actions>
                        </entityComboBox>
                        <textField id="issueQuantityField" property="issueQuantity" allowedCharPattern="[0-9]"
                                   width="100%" label="msg://fis.pbcap.finexbackoffice.entity/GdSecurities.issueQuantity"
                                   dataContainer="gdSecuritiesDc">
                            <validators>
                                <positive message="msg://fis.pbcap.finexbackoffice.entity/GdSecurities.issueQuantity.positive"/>
                            </validators>
                        </textField>
                        <textField id="parValueField" property="parValue" allowedCharPattern="[0-9]"
                                   width="100%" label="msg://fis.pbcap.finexbackoffice.entity/GdSecurities.parValue"
                                   dataContainer="gdSecuritiesDc">
                            <validators>
                                <positive message="msg://fis.pbcap.finexbackoffice.entity/GdSecurities.parValue.positive"/>
                            </validators>
                        </textField>
                        <select id="secStatusField" property="secStatus"
                                width="100%" label="msg://fis.pbcap.finexbackoffice.entity/GdSecurities.secStatus"
                                dataContainer="gdSecuritiesDc"
                                itemsEnum="fis.pbcap.finexbackoffice.enumerate.common.SecStatus"/>
                    </hbox>
                    <hbox width="100%">
                        <select id="interestPayMethodField" property="interestPayMethod" emptySelectionAllowed="true"
                                width="100%" label="msg://fis.pbcap.finexbackoffice.entity/GdSecurities.interestPayMethod"
                                dataContainer="gdSecuritiesDc"
                                itemsEnum="fis.pbcap.finexbackoffice.enumerate.common.InterestPayMethod"/>
                        <select id="interestBaseField" property="interestBase" emptySelectionAllowed="true"
                                width="100%" label="msg://fis.pbcap.finexbackoffice.entity/GdSecurities.interestBase"
                                dataContainer="gdSecuritiesDc"
                                itemsEnum="fis.pbcap.finexbackoffice.enumerate.common.InterestBase"/>
                        <textField id="bondPeriodField" property="bondPeriod" allowedCharPattern="[0-9]"
                                   width="100%" label="msg://fis.pbcap.finexbackoffice.entity/GdSecurities.bondPeriod"
                                   dataContainer="gdSecuritiesDc">
                            <validators>
                                <positive
                                        message="msg://fis.pbcap.finexbackoffice.entity/GdSecurities.bondPeriod.positive"/>
                            </validators>
                        </textField>
                        <select id="termUnitField" property="termUnit"
                                width="100%" label="msg://fis.pbcap.finexbackoffice.entity/GdSecurities.termUnit"
                                dataContainer="gdSecuritiesDc"
                                itemsEnum="fis.pbcap.finexbackoffice.enumerate.common.TermUnit"/>
                    </hbox>
                    <hbox width="100%">
                        <datePicker id="issueDateField" property="issueDate"
                                    width="100%" label="msg://fis.pbcap.finexbackoffice.entity/GdSecurities.issueDate"
                                    dataContainer="gdSecuritiesDc"/>
                        <datePicker id="dueDateField" property="dueDate"
                                    width="100%" label="msg://fis.pbcap.finexbackoffice.entity/GdSecurities.dueDate"
                                    dataContainer="gdSecuritiesDc"/>
                        <datePicker id="firstTradingDateField" property="firstTradingDate"
                                    width="100%" label="msg://fis.pbcap.finexbackoffice.entity/GdSecurities.firstTradingDate"
                                    dataContainer="gdSecuritiesDc"/>
                        <datePicker id="debutDateField" property="debutDate"
                                    width="100%" label="msg://fis.pbcap.finexbackoffice.entity/GdSecurities.debutDate"
                                    dataContainer="gdSecuritiesDc"/>
                    </hbox>
                    <hbox width="100%">
                        <textField id="numdayField" property="numday" allowedCharPattern="[0-9]"
                                   width="100%" label="msg://fis.pbcap.finexbackoffice.entity/GdSecurities.numday"
                                   dataContainer="gdSecuritiesDc">
                            <validators>
                                <positiveOrZero
                                        message="msg://fis.pbcap.finexbackoffice.entity/GdSecurities.numday.positiveOrZero"/>
                            </validators>
                        </textField>
                        <hbox width="100%"/>
                        <hbox width="100%"/>
                        <hbox width="100%"/>
                    </hbox>
                </vbox>
            </tab>

            <tab id="releaseInfomationTab" label="msg://releaseInfomationTab.label" >
                <vbox width="100%" alignItems="START" classNames="flex-wrap">
                    <hbox width="100%">
                        <select id="issueTypeField" property="issueType" emptySelectionAllowed="true"
                                width="100%" label="msg://fis.pbcap.finexbackoffice.entity/GdSecurities.issueType"
                                dataContainer="gdSecuritiesDc"
                                itemsEnum="fis.pbcap.finexbackoffice.enumerate.common.IssueType"/>
                        <select id="kindOfIssueField" property="kindOfIssue" emptySelectionAllowed="true"
                                width="100%" label="msg://fis.pbcap.finexbackoffice.entity/GdSecurities.kindOfIssue"
                                dataContainer="gdSecuritiesDc"
                                itemsEnum="fis.pbcap.finexbackoffice.enumerate.common.KindOfIssue"/>
                        <textField id="newIssueField" property="newIssue" allowedCharPattern="[0-9]"
                                   width="100%" label="msg://fis.pbcap.finexbackoffice.entity/GdSecurities.newIssue"
                                   dataContainer="gdSecuritiesDc">
                            <validators>
                                <positive
                                        message="msg://fis.pbcap.finexbackoffice.entity/GdSecurities.newIssue.positive"/>
                            </validators>
                        </textField>
                        <datePicker id="liquidationDateField" property="liquidationDate"
                                    width="100%" label="msg://fis.pbcap.finexbackoffice.entity/GdSecurities.liquidationDate"
                                    dataContainer="gdSecuritiesDc"/>
                    </hbox>
                    <hbox width="100%">
                        <select id="paymentGuaranteeField" property="paymentGuarantee" emptySelectionAllowed="true"
                                width="100%" label="msg://fis.pbcap.finexbackoffice.entity/GdSecurities.paymentGuarantee"
                                dataContainer="gdSecuritiesDc"
                                itemsEnum="fis.pbcap.finexbackoffice.enumerate.common.PaymentGuarantee"/>
                        <select id="kindOfSecuritiesField" property="kindOfSecurities" emptySelectionAllowed="true"
                                width="100%" label="msg://fis.pbcap.finexbackoffice.entity/GdSecurities.kindOfSecurities"
                                dataContainer="gdSecuritiesDc"
                                itemsEnum="fis.pbcap.finexbackoffice.enumerate.common.KindOfSecurities"/>
                        <textField id="issuePriceField" property="issuePrice"
                                   width="100%" label="msg://fis.pbcap.finexbackoffice.entity/GdSecurities.issuePrice"
                                   dataContainer="gdSecuritiesDc"/>
                        <hbox width="100%"/>
                    </hbox>
                </vbox>
            </tab>

            <tab id="interestRateInfomationTab" label="msg://interestRateInfomationTab.label" >
                <vbox width="100%" alignItems="START" classNames="flex-wrap">
                    <hbox width="100%">
                        <select id="interestTypeField" property="interestType" emptySelectionAllowed="true"
                                width="100%" label="msg://fis.pbcap.finexbackoffice.entity/GdSecurities.interestType"
                                dataContainer="gdSecuritiesDc"
                                itemsEnum="fis.pbcap.finexbackoffice.enumerate.common.InterestType"/>
                        <textField id="interestRateField" property="interestRate"
                                   width="100%" label="msg://fis.pbcap.finexbackoffice.entity/GdSecurities.interestRate"
                                   dataContainer="gdSecuritiesDc"/>
                        <textField id="interestPeriodField" property="interestPeriod"
                                   width="100%" label="msg://fis.pbcap.finexbackoffice.entity/GdSecurities.interestPeriod"
                                   dataContainer="gdSecuritiesDc"/>
                        <select id="interestPeriodUnitField" property="interestPeriodUnit" emptySelectionAllowed="true"
                                   width="100%" label="msg://fis.pbcap.finexbackoffice.entity/GdSecurities.interestPeriodUnit"
                                   itemsEnum="fis.pbcap.finexbackoffice.enumerate.common.InterestPeriodUnit"
                                   dataContainer="gdSecuritiesDc"/>
                    </hbox>
                    <hbox width="100%">
                        <datePicker id="firstIntDateField" property="firstIntDate" readOnly="true"
                                    width="100%" label="msg://fis.pbcap.finexbackoffice.entity/GdSecurities.firstIntDate"
                                    dataContainer="gdSecuritiesDc"/>
                        <datePicker id="lastIntDateField" property="lastIntDate"
                                    width="100%" label="msg://fis.pbcap.finexbackoffice.entity/GdSecurities.lastIntDate"
                                    dataContainer="gdSecuritiesDc"/>
                        <select id="interestRateTypeField" property="interestRateType" emptySelectionAllowed="true"
                                width="100%" label="msg://fis.pbcap.finexbackoffice.entity/GdSecurities.interestRateType"
                                dataContainer="gdSecuritiesDc"
                                itemsEnum="fis.pbcap.finexbackoffice.enumerate.common.InterestRateType"/>
                        <datePicker id="lastTradingDateField" property="lastTradingDate"
                                    width="100%" label="msg://fis.pbcap.finexbackoffice.entity/GdSecurities.lastTradingDate"
                                    dataContainer="gdSecuritiesDc"/>
                    </hbox>
                </vbox>
            </tab>
        </tabSheet>

Here’s pictures
pic 1 and 2 is after press new button and entering create view
1st pic: (Tab 1 with all field required activated)
image
2nd pic: (Tab 3 with 2 field required but not activated)
image

pic 3 (after press save button)
image
pic 4: (press save button in tab 1 but tab 3 dont have required message)
image

pic 5: after press save button in tab 3
image

Hi,

Thanks for the info, we’ve encountered this issue before
Unfortunately there is no straightforward solution as it’s based on vaadin logic of tabs validation
Tab content validation is not working

The best advice is to write your own validation logic for the fields you need

Regards,
Alex

1 Like