4 Replies Latest reply on Aug 21, 2007 5:03 AM by maisoft

    Rerender event not fired in Richtab panel

      Seam version: 1.2.1
      JBoss:4.0.5

      I have created a page that used the rich:tabpanel component. Inside one of the tabs I want to change a label depending upon what is selected in a radio button. To do this I added the a4j rerender attribute for the onchange event. However, the rerender does not work until something has been typed into one of the other fields. Here is the behavior I have noticed:

      Scenario A. If components are placed outside of tab panel everything works fine.

      Scenario B. If components are placed inside tabl panel...
      If you click on the radio button with the rerender event, nothing happens. That is nothing happens.
      If you click inside another text box and type something (anything) and then click on the radio buttons the reRender event starts to work.

      I have found I get the same behavior whether the switch type is ajax, server, or client.



      Here is the markup in question:

      <rich:panel>
       <rich:tabPanel switchType="ajax">
       <rich:tab label="Client">
       <s:decorate id="coveragetypeDecoration" template="layout/edit.xhtml">
       <ui:define name="label">Coverage Type</ui:define>
       <h:selectOneRadio id="coveragetype" value="#{rptphdmgbinderHome.instance.coveragetype}">
       <f:selectItem itemValue="AUTO" itemLabel="Auto"/>
       <f:selectItem itemValue="OTHER" itemLabel="Other"/>
       <a:support event="onclick" reRender="panelx"/>
       </h:selectOneRadio>
       </s:decorate>
      
       <s:div id="panelx">
       <h:panelGroup rendered="#{rptphdmgbinderHome.instance.coveragetype=='AUTO'}">
       hello!!!
       </h:panelGroup>
       <h:panelGroup rendered="#{rptphdmgbinderHome.instance.coveragetype!='AUTO'}">
       goodbye!!!
       </h:panelGroup>
       </s:div>
       </rich:tab>
      
       </rich:tabPanel>
      </rich:panel>

      Is there a better/different way I could show/hide components?

      Is this more likely a bug or something else?

      I have not looked at ICEFaces. Would I have better luck using the ICEFaces tab component? If so, can I use the same theme with ICE Faces as with Rich faces? i.e. can and mix and match richfaces with icefaces and get the same look and feel?

        • 1. Re: Rerender event not fired in Richtab panel

          Does event="onchange" work for you on the selctOneRadio?

          • 2. Re: Rerender event not fired in Richtab panel

            No, same behavior. I actually started with the onchange event, but when I ran into this problem I switched to onclick to see if it would make any difference.

            I have since found that if I add ajaxSingle="true" to the support tag, as in:

            <a:support event="onclick" reRender="panelx,panely" ajaxSingle="true" />


            Then it works. I have not had time to research why this would make a difference though.

            Now that I can get it to rerender on the event now, I am trying to make it work inside the decorator/label combination, but I am confounded again:

             <s:decorate id="deductible1Decoration" template="layout/edit.xhtml">
            
             <ui:define name="label" >
             <s:div id="panely">
             <h:panelGroup rendered="#{rptphdmgbinderHome.instance.coveragetype!='AUTO'}">Deductible</h:panelGroup>
             <h:panelGroup rendered="#{rptphdmgbinderHome.instance.coveragetype=='AUTO'}">Comp</h:panelGroup>
             </s:div>
             </ui:define>
            
             <h:inputText id="deductible1"
             size="10"
             maxlength="10"
             required="true"
             value="#{rptphdmgbinderHome.instance.deductible1}">
             <a:support event="onblur" reRender="deductible1Decoration"/>
             </h:inputText>
             </s:decorate>


            When I do this, and the text is rendered the label shows up in a different location than it is supposed to.

            • 3. Re: Rerender event not fired in Richtab panel

              Well, I've no explanation there. Why not ask on the richfaces forum? I do know that the charting demo (in the itext example app) uses a rich panel with onchange events on a wide variety of controls. I didn't experience any problems like you did.

              • 4. Re: Rerender event not fired in Richtab panel
                maisoft

                I have the same problem with tabPanel, every action inside this tag is ignored the first time, i have to click twice to run the action ...
                I tried with <a:support event="onclick" reRender="panelx,panely" ajaxSingle="true" /> but without any results ...