tags:

views:

34

answers:

2

Hi, Good evening.

I'm facing the following error: I have a selectOneRadio in one file that uses the a4:support to call something in the serverside. The problem is that I need to reRender a tab component that is in the outmost files in a series of includes. The reRender apparently doesn´t work in this case. here are the codes: My MBean:

public String mudarForcaTrabalho(){
 InstrutorBaseVO instrutor = getDados();
 setDados(ManterInstrutorHelper.transformarInstrutor(instrutor));
 setInterno(!isInterno());
 return null;
}

My outermost file : manter.xhtml

<h:panelGroup id="pnMaster">
-<h:outputText id="txForca2" value="#{instrutorMB.dados.forcaDeTrabalho}"  />-
<rich:tabPanel switchType="client" id="painelTabs">
       <rich:tab id="tabBasicas" label="#{msg.INFO_BASICAS}">
  <div style="padding:5px;"><ui:include src="informacoesBase.xhtml"/></div>
       </rich:tab>
       <rich:tab id="tabLocal" label="#{msg.INFO_LOCALIZACAO}" rendered="#{instrutorMB.dados.forcaDeTrabalho == 'N'}">
        <div style="padding:5px;"><ui:include src="informacoesLocalizacao.xhtml"/></div>
    </rich:tab>
       <rich:tab id="tabDetalhe" label="#{msg.INFO_DETALHADAS}">
           <div style="padding:5px;"><ui:include src="informacoesDetalhadas.xhtml"/></div>
       </rich:tab>
</rich:tabPanel>
</h:panelGroup>

My inner file : informacoesBase.xhtml

 <h:panelGroup id="painelPai">
 <fieldset>

  <h:panelGroup id="pnTeste">
  -<h:outputText id="txForca" value="#{instrutorMB.dados.forcaDeTrabalho}"  />-
  </h:panelGroup> 
  <legend>#{msg.MSG_PERTENCE_FORCA}*</legend>

   <h:selectOneRadio id="rdForcaTrabalho" value="#{instrutorMB.dados.forcaDeTrabalho}" disabled="#{instrutorMB.visualizar}">
   <f:selectItem itemValue="S" itemLabel="#{msg.SIM}"/>
   <f:selectItem itemValue="N" itemLabel="#{msg.NAO}"/>
   <a4j:support ajaxSingle="true" event="onchange" immediate="true" reRender="pnMaster" action="#{instrutorMB.mudarForcaTrabalho}"/>
   </h:selectOneRadio>

 </fieldset>

 </h:panelGroup>

Any help is appreciated. Thank you.

+1  A: 

I guess that your files are not under the same h:form or aj4:form

ReRender works for components under the same form.

Odelya
A: 

ReRender works for components under the same form.

When using reRender the components don't need to be in the same form. They can be anywhere. Try pointing reRender by adding formId:

reRender=":formId:componentId"
Max Katz