Hi all!

I've two tabs like in the example below. If I press the ok-Button and the
first tab is shown, the field on the second tab is not validated.
If I switch to the second Tab and back to the first tab, both fields will
be validated. It seems the fields are in the component tree after they are
the first time rendered. Has everyone an idea for a workaround??

<f:view>
        <h:messages styleClass="errors" showSummary="true" showDetail="true"/>
        <h:form>
                <x:panelTabbedPane binding="#{visit.positionenTabPane}">
                        <x:panelTab id="tab1" label="#{bundle.kopfdaten}">
                                <h:panelGrid columns="3" border="0" 
cellpadding="5" cellspacing="3">
                                        <h:outputLabel for="Positionsnummer">
                                                <h:outputText 
value="#{bundle.posNr}" />
                                        </h:outputLabel>
                                        <h:inputText id="Positionsnummer" 
size="10" maxlength="10"
                                                required="true" 
value="#{visit.currentPosition.posNr}">
                                                <f:validateLength minimum="1" 
maximum="10" />
                                        </h:inputText>
                                        <h:message for="Positionsnummer" 
styleClass="errors" />
                                </h:panelGrid>
                        </x:panelTab>
                        <x:panelTab id="tab2" label="#{bundle.operation}">
                                <h:panelGrid columns="3" border="0" 
cellpadding="5" cellspacing="3">
                                        <h:outputLabel 
for="op_Bewertungsfaktor">
                                                <h:outputText 
value="#{bundle.bewertungsfaktor}" />
                                        </h:outputLabel>
                                        <h:inputText id="op_Bewertungsfaktor" 
size="10" maxlength="10"
                                                required="true"
                                                
value="#{visit.currentPosition.op.bewertungsfaktor}">
                                                <f:validateDoubleRange 
minimum="0" maximum="1" />
                                        </h:inputText>
                                        <h:message for="op_Bewertungsfaktor" 
styleClass="errors" />
                                </h:panelGrid>
                        </x:panelTab>
                   </x:panelTabbedPane>

                <h:commandButton value="#{bundle.ok}"
                        action="#{visit.currentPosition.ok}" />

        </h:form>
</f:view>

Regards,
Philipp

Reply via email to