JSF o:tabbedPane issue changing SelectedIndex

喜欢而已 提交于 2019-12-11 10:48:36

问题


im working with JSF 2.0 and the OpenFaces <o:tabbedPane>

im having some troubles changing the tabs.. i have an index with four jsf pages includes.

like this

<o:tabbedPane  loadingMode="client" tabGapWidth="3"  id="pestana"
                    tabClass="tab_form" rolloverTabClass="tab_form2" selectedTabClass="tab_form3"
                    tabAlignment="bottomOrRight" 
                    style="width:100%;" binding="#{GeneralBean.panelTabs}">
      <o:subPanel caption="1" styleClass="pestanas">
        <ui:include src="/datosDeLaCotizacion.jsf"/>

      </o:subPanel>
      <o:subPanel caption="2" styleClass="pestanas" disabled="true">
        <ui:include src="/datosDelProducto.jsf"/>    

      </o:subPanel>
      <o:subPanel caption="3" styleClass="pestanas" disabled="true">
          <ui:include src="/coberturas.jsf"/>

      </o:subPanel>

      <o:subPanel caption="4" styleClass="pestanas" disabled="true">
        <ui:include src="/confirmacion.jsf"/>

      </o:subPanel>
    </o:tabbedPane>

inside the jsf pages.. i have forms with their <h:commandButton> like this

<h:commandButton value="Continuar" id="botonContinuar"
                             actionListener="#{GeneralBean.continuarCotizacionPaso1}"
                             action='Forms!form.Refresh'>
            </h:commandButton> 

when its goes to the actionListener on the Bean the first time works fine... and changes the <o:tabbedPane> to the second <o:subPanel> but! when i use the <h:commandButton> of the second <o:subPanel> does not work... is not reaching the actionListener on the Bean...

Please help me if you know what im doing wrong... Thanks!


回答1:


First, note that <o:tabbedPane> should be placed inside of a form (and I suppose that it is inside a form in your case). Second, you're mentioning that you have forms with buttons inside of JSF pages. Are these the pages that are included into <o:subPanel> of your tabbed pane?

If so, then you actually have nested forms as a result on your page, which is not allowed. If this is true, then the solution in this case can be as easy as removing the form tags from the included sub-pages.



来源:https://stackoverflow.com/questions/8537369/jsf-otabbedpane-issue-changing-selectedindex

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!