1

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!

graven
  • 13
  • 3

1 Answers1

2

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.

Dmitry Pikhulya
  • 446
  • 2
  • 6
  • Hi Dmitry.. thanks i remove all the inside forms like you said.. but the problem persist.. i have a inside of every , the first one works... but the others doesnt reach the bean... just refresh the page... is a problem with having multiples submits? – graven Dec 19 '11 at 15:48
  • Did you consider a possible validation error on those pages? Add somewhere outside of to see if there are any errors... – Dmitry Pikhulya Dec 19 '11 at 16:56
  • Hi.. thanks! i used the inmediate = "true" on the commandButton and it works.. I tried before with the nested forms and nothing... thank you very much! u know if there is a way to go to the bean with a button without the submit action... just the ajax... and then move to other panel? because i have one form separated on 4 pages... and i need to keep that info on the inputs fields while the user go through the four subPanels and when the commandButton goes to the bean and change the subPanel some info is lost.. Thanks ! – graven Dec 19 '11 at 21:22
  • I'm not sure about stackoverflow rules, this must probably have been another question as it's a different issue... Anyway, what do you mean by saying "to go to the bean ... using Ajax"? Should anything be reloaded with Ajax, just submitted, or something else? Anyway, it should be possible to use the usual Ajax capabilities like the render/execute attributes in , or you can use / on you existing to implement both of the mentioned cases... – Dmitry Pikhulya Dec 20 '11 at 13:12