简体   繁体   中英

rich faces server switch type

Rich tab panel has a server switch mode, when using this mode what is goings on ,that is if i put a form in each tab i expect only this form posted and no action called .But action= "#{licenseIMC.downloadRequest}" called .And what will happen if i put all tab panel inside a single form.

<rich:tab id="updateLicensesTab" label="Update licences">
                    <h:form id="updateLicensesForm">              


                                <h:outputText value="Request file" />
                                <a4j:htmlCommandLink id="request"
                                                     action="#{licenseIMC.downloadRequest}"
                                                     value="Generate License Request"
                                                     title="Generate License Request" />

The switch mode only has an effect on whats happens if you switch from one tab to another. The server mode means that it will reload the tab (and page) everytime you switch to it. The ajax mode means it will reload the tab but not the page. And the client mode means it will not reload data from the server. The server and ajax mode only make sense if your underlying data might have changed and you want to reflect this changes when the tab is switched.

If you put all tabs in one form all tabs will be submitted if you do a form submit (eg execute the htmlCommandLink).

In response to your question and your comment on morja's ans: The individual actions of command buttons and links inside the tabs will not be fired . However, the action that is specified in the tab tag will be fired .

In your example htmlCommandLink will not be fired and downloadRequest() not called, but if you were to have:

<rich:tab id="updateLicensesTab" label="Update licences" action="#{licenseIMC.tabChange}">
                    <h:form id="updateLicensesForm">      

then the tabChange function would be called.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM