Search code examples
javajsfrichfaces

Data model is not updated when submitting form with RichFaces tabpanel


I have the following layout in my page (simplified)

<h:form>
    <h:commandButton action="#{bean.save} value="Save"/>

    <rich:tabPanel switchType="ajax">
        <rich:tab name="one" switchType="client">

        </rich:tab>

        <rich:tab name="two" switchType="ajax">

        </rich:tab>

        <rich:tab name="three" switchType="client">

        </rich:tab>

    </rich:tabPanel>
</h:form>

Tabs "one" and "three" have switchType="client", there are some inputs on them, bound to a bean properties. When "Save" is pressed, I expect that bean properties will updated from input in both tabs. However, the properties are updated only from the inputs on the current tab. Values from another tab are lost, though the whole form is submitted (I have checked it in HTTP watcher). So the user has to input data in one tab, press "Save", then update values on another tab and press "Save" in order to save all changes made. How it is possible to propagate values from all tabs at once?


Solution

  • The solution has been found: I have changed switchType of the tabpanel from "ajax" to "client". Thanks all for your proposals!