4 Replies Latest reply on Mar 9, 2009 5:20 AM by liuliu

    a bug with 3.3.0?

    liuliu

      hi,

      I have a strange bug after updated to RF 3.3.0.

      I have a data datatable with rich:columns in a modalpanel, there is a spinner in every column. every onchange event of the spinner, i call a bean method. It worked fine,but after updated to rf 3.3.0, the method is called only once every time the datatable is rendered or rerended. in the a4j:log , i found this for the first click

      debug[16:05:04,448]: Have Event [object Object] with properties: target: [object HTMLImageElement], srcElement: undefined, type: click
      .
      but nothing similar for the log of the second click.

      here is the beginning of the logs of 2 clicks:
      log click 1 :

      debug[16:05:04,448]: Have Event [object Object] with properties: target: [object HTMLImageElement], srcElement: undefined, type: click
      debug[16:05:04,448]: Query preparation for form 'wizardSimplePrescForm' requested
      debug[16:05:04,449]: Append select-one control wizardSimplePrescForm:j_id17280:0:j_id17291 with value [-2] and value attribute [null]
      debug[16:05:04,449]: Append text control wizardSimplePrescForm:j_id17280:0:textProduit with value [FACTEUR VII LFB 500UI FV+FV] and value attribute [FACTEUR VII LFB 500UI FV+FV]
      debug[16:05:04,449]: Append hidden control wizardSimplePrescForm:j_id17280:0:sugg_selection with value [] and value attribute [null]
      debug[16:05:04,449]: Append text control wizardSimplePrescForm:j_id17280:0:j_id30865 with value [0.2] and value attribute [0.25]
      debug[16:05:04,450]: Append text control wizardSimplePrescForm:j_id17280:0:j_id30867 with value [0.50] and value attribute [0.25]
      debug[16:05:04,450]: Append text control wizardSimplePrescForm:j_id17280:0:j_id30875 with value [5.0] and value attribute [5.0]
      debug[16:05:04,450]: Append text control wizardSimplePrescForm:j_id17280:0:j_id30877 with value [5.0] and value attribute [5.0]
      debug[16:05:04,450]: Append text control wizardSimplePrescForm:j_id17280:0:j_id30885 with value [0.0] and value attribute [0.0]
      debug[16:05:04,451]: Append text control wizardSimplePrescForm:j_id17280:0:j_id30887 with value [0.0] and value attribute [0.0]
      debug[16:05:04,451]: Append select-one control wizardSimplePrescForm:j_id17280:0:j_id17393 with value [0] and value attribute [null]
      debug[16:05:04,451]: Append select-one control wizardSimplePrescForm:j_id17582 with value [periodeJourXY] and value attribute [null]
      debug[16:05:04,451]: Append select-one control wizardSimplePrescForm:j_id17588 with value [0] and value attribute [null]
      debug[16:05:04,452]: Append text control wizardSimplePrescForm:j_id17597InputDate with value [05/03/2009] and value attribute [05/03/2009]
      debug[16:05:04,452]: Append hidden control wizardSimplePrescForm:j_id17597InputCurrentDate with value [03/2009] and value attribute [03/2009]
      debug[16:05:04,452]: Append select-one control wizardSimplePrescForm:j_id17600 with value [-3] and value attribute [null]
      debug[16:05:04,452]: Append text control wizardSimplePrescForm:j_id17607 with value [6] and value attribute [7]
      debug[16:05:04,452]: Append text control wizardSimplePrescForm:j_id17612 with value [7] and value attribute [7]
      debug[16:05:04,453]: Append text control wizardSimplePrescForm:j_id17621 with value [6] and value attribute [6]
      debug[16:05:04,453]: Append select-one control wizardSimplePrescForm:j_id17623 with value [SEQUENCE] and value attribute [null]
      debug[16:05:04,453]: Append select-one control wizardSimplePrescForm:j_id17628 with value [-4] and value attribute [null]
      debug[16:05:04,454]: Append text control wizardSimplePrescForm:inputComm with value [] and value attribute []
      debug[16:05:04,454]: Append hidden control wizardSimplePrescForm:DicoCommOpenedState with value [] and value attribute [null]
      debug[16:05:04,454]: Append hidden control wizardSimplePrescForm with value [wizardSimplePrescForm] and value attribute [wizardSimplePrescForm]
      debug[16:05:04,455]: Append hidden control autoScroll with value [] and value attribute []
      debug[16:05:04,455]: Append hidden control javax.faces.ViewState with value [j_id3] and value attribute [j_id3]
      debug[16:05:04,455]: parameter wizardSimplePrescForm:j_id17280:0:j_id17390 with value wizardSimplePrescForm:j_id17280:0:j_id17390
      debug[16:05:04,455]: Look up queue with default name
      debug[16:05:04,455]: NEW AJAX REQUEST !!! with form: wizardSimplePrescForm
      debug[16:05:04,456]: Start XmlHttpRequest
      debug[16:05:04,456]: Reqest state : 1
      debug[16:05:04,456]: QueryString: AJAXREQUEST=wizardRegion&wizardSimplePrescForm%3Aj_id17274=SEJOUR&...
      debug[16:05:04,461]: Reqest state : 1
      

      log of click 2
      debug[16:06:13,437]: Query preparation for form 'wizardSimplePrescForm' requested
      debug[16:06:13,437]: Append select-one control wizardSimplePrescForm:j_id17280:0:j_id17291 with value [-2] and value attribute [null]
      debug[16:06:13,438]: Append text control wizardSimplePrescForm:j_id17280:0:textProduit with value [FACTEUR VII LFB 500UI FV+FV] and value attribute [FACTEUR VII LFB 500UI FV+FV]
      debug[16:06:13,438]: Append hidden control wizardSimplePrescForm:j_id17280:0:sugg_selection with value [] and value attribute [null]
      debug[16:06:13,438]: Append text control wizardSimplePrescForm:j_id17280:0:j_id32855 with value [0.25] and value attribute [0.25]
      debug[16:06:13,438]: Append text control wizardSimplePrescForm:j_id17280:0:j_id32857 with value [0.75] and value attribute [0.25]
      debug[16:06:13,439]: Append text control wizardSimplePrescForm:j_id17280:0:j_id32865 with value [5.0] and value attribute [5.0]
      debug[16:06:13,439]: Append text control wizardSimplePrescForm:j_id17280:0:j_id32867 with value [5.0] and value attribute [5.0]
      debug[16:06:13,439]: Append text control wizardSimplePrescForm:j_id17280:0:j_id32875 with value [0.0] and value attribute [0.0]
      debug[16:06:13,439]: Append text control wizardSimplePrescForm:j_id17280:0:j_id32877 with value [0.0] and value attribute [0.0]
      debug[16:06:13,439]: Append select-one control wizardSimplePrescForm:j_id17280:0:j_id17393 with value [0] and value attribute [null]
      debug[16:06:13,440]: Append select-one control wizardSimplePrescForm:j_id17582 with value [periodeJourXY] and value attribute [null]
      debug[16:06:13,440]: Append select-one control wizardSimplePrescForm:j_id17588 with value [0] and value attribute [null]
      debug[16:06:13,440]: Append text control wizardSimplePrescForm:j_id17597InputDate with value [05/03/2009] and value attribute [05/03/2009]
      debug[16:06:13,440]: Append hidden control wizardSimplePrescForm:j_id17597InputCurrentDate with value [03/2009] and value attribute [03/2009]
      debug[16:06:13,440]: Append select-one control wizardSimplePrescForm:j_id17600 with value [-3] and value attribute [null]
      debug[16:06:13,441]: Append text control wizardSimplePrescForm:j_id17607 with value [6] and value attribute [6]
      debug[16:06:13,441]: Append text control wizardSimplePrescForm:j_id17612 with value [7] and value attribute [7]
      debug[16:06:13,441]: Append text control wizardSimplePrescForm:j_id17621 with value [6] and value attribute [6]
      debug[16:06:13,441]: Append select-one control wizardSimplePrescForm:j_id17623 with value [SEQUENCE] and value attribute [null]
      debug[16:06:13,441]: Append select-one control wizardSimplePrescForm:j_id17628 with value [-4] and value attribute [null]
      debug[16:06:13,442]: Append text control wizardSimplePrescForm:inputComm with value [] and value attribute []
      debug[16:06:13,442]: Append hidden control wizardSimplePrescForm:DicoCommOpenedState with value [] and value attribute [null]
      debug[16:06:13,442]: Append hidden control wizardSimplePrescForm with value [wizardSimplePrescForm] and value attribute [wizardSimplePrescForm]
      debug[16:06:13,443]: Append hidden control autoScroll with value [] and value attribute []
      debug[16:06:13,443]: Append hidden control javax.faces.ViewState with value [j_id3] and value attribute [j_id3]
      debug[16:06:13,443]: parameter wizardSimplePrescForm:j_id17280:0:j_id32858 with value wizardSimplePrescForm:j_id17280:0:j_id32858
      debug[16:06:13,443]: Look up queue with default name
      debug[16:06:13,443]: NEW AJAX REQUEST !!! with form: wizardSimplePrescForm
      debug[16:06:13,444]: Start XmlHttpRequest
      debug[16:06:13,444]: Reqest state : 1
      


        • 1. Re: a bug with 3.3.0?
          nbelaevski

          Can you please provide full page code?

          • 2. Re: a bug with 3.3.0?
            liuliu

            thanks for your reply, here is the code, it can reproduce the bug. produit.prises is a hashmap



             <h:form>
            
            <rich:dataTable var="produit" value="#PrescriptionSaisieSimple.produits}"
            cellspacing="1" rowKeyVar="index" width="100%">
            
            
            <rich:columns value="#{PrescriptionSaisieSimple.headerPrises}" var="headerPrises">
             <f:facet name="header">
             <t:outputText value="#{headerPrises.code}" title="#{headerPrises.libelle}" styleClass="corpsGris"/>
             </f:facet>
             <rich:inputNumberSpinner value="#{produit.prises[headerPrises.id].value}" converter="javax.faces.Float">
             <a4j:support event="onchange" action="#{PrescriptionSaisieSimple.changeDateFinWithQuantite}" reRender="datefin,jourSemaineM,dureeM" />
             </rich:inputNumberSpinner>
            </rich:columns>
            </rich:dataTable>
            
             </h:form>
            


            • 3. Re: a bug with 3.3.0?

              Hi,

              Since 3.3.0 columns are re-created on each request. It causes the change of id of children inside the component.
              To fix the problem just assign unique id for input slider & support components.

              Example:

               <h:form>
              
              <rich:dataTable var="produit" value="#PrescriptionSaisieSimple.produits}"
              cellspacing="1" rowKeyVar="index" width="100%">
              
              
              <rich:columns value="#{PrescriptionSaisieSimple.headerPrises}" var="headerPrises"
              index="ind">
               <f:facet name="header">
               <t:outputText value="#{headerPrises.code}" title="#{headerPrises.libelle}" styleClass="corpsGris"/>
               </f:facet>
               <rich:inputNumberSpinner id="slider#{ind}" value="#{produit.prises[headerPrises.id].value}" converter="javax.faces.Float">
               <a4j:support id="support#{ind}" event="onchange" action="#{PrescriptionSaisieSimple.changeDateFinWithQuantite}" reRender="datefin,jourSemaineM,dureeM" />
               </rich:inputNumberSpinner>
              </rich:columns>
              </rich:dataTable>
              
               </h:form>


              • 4. Re: a bug with 3.3.0?
                liuliu

                hi,

                thank you very much, it works.

                by curiosity, could you tell me why this change?Does it bring some new features?

                liu