2 Replies Latest reply on Aug 3, 2010 4:09 PM by iraheta

    problem with suggestionbox and list selection from click event

    iraheta

      Hi, im using richfaces 3.3.3.final, and i got a problem with suggestionbox, if i scroll the resulting list using the mouse cursor, and try to select an item from that list it stucks and nothing happens, the firefox console returns me this error:

       

      console.JPG

       

      the code from the entry is undefined line is:

       

      Element.addClassName(entry,this.options.selectedClasses[i]);var cells=entry.select(".rich-sb-cell-padding");for(var i=0;i<cells.length;i++){Element.addClassName(cells[i],this.options.selectValueClass);}

       

       

       

      if  i scroll down with the up/down arrows and select it with enter, works fine, the problem comes using the mouse to select from the list

       

       

       

      here's the source:

       

      <t:inputText id="txtSuggestedProduct" style="width:400px;" title="(Alt + Shift + b)"  onkeypress="return(event.keyCode != 13);" >
      <rich:effect for="txtSuggestedProduct" event="onfocus" type="Highlight" params="duration:1.0"/>
      </t:inputText>
      <rich:suggestionbox var="v" id="suggestionProduct" nothingLabel="No se encontró ningún producto" ajaxSingle="true"
      for="txtSuggestedProduct" suggestionAction="#{VentasController.selectProducts_suggestion}"
      fetchValue="#{v}" width="700" height="500" cellpadding="0" cellspacing="0"
      ignoreDupResponses="true" requestDelay="400">
      <a4j:support event="onselect" action="#{VentasController.selectProducts_valueChanged}"
      reRender="pnlTransactionItems" ajaxSingle="true"
      oncomplete="#{rich:element(VentasController.selectedTransactionItem.product.material.unitary ? 'txtItemQuantity' : 'txtItemNumberOfPieces')}.focus();">
      <f:setPropertyActionListener value="#{v}" target="#{VentasController.selectedTransactionItem.product}"/>
      </a4j:support>
      <f:facet name="header">
      <h:outputText value="material"/>
      <h:outputText value="Medidas"/>
      </f:facet>
      <t:column>

      ...

      <t:column>

      </rich:suggestionbox>

       

       

       

      any idea? thanks.

        • 1. Re: problem with suggestionbox and list selection from click event
          ilya_shaikovsky

          seems you using tomahawk library with different version of prototype.js than in RichFaces. That causes conflicts. You could check the version with siilar prototype.js or just patch the tomahawk with our version. Patching RF with another prototype.js  - could cause issues in popups and other relativelly positioned components (not RF issue but just prototype.js issues which fixed in our built-in version)

          • 2. Re: problem with suggestionbox and list selection from click event
            iraheta

            thanks for the reply, first i patch the prototype.js on tomahawk12-1.1.9\org\apache\myfaces\custom\prototype\resource with the one on richfaces-impl-3.3.3.Final\org\ajax4jsf\javascript\scripts but still i got the problem, so i also patch the other files of the same folder, controls.js, dragdrop.js and effects.js (everything on the prototype\resource folder) and didnt work, but i realized and strage behavior, if i move the coursor too fast, the selected row of the list is left behind where the coursor actually is, and as i select the new row, the exception occurs (also after this fast movement the up/down arrows doesnt respond), but if i go slow and select the same selected row, or use the up/down arrow without the use of the mouse, works neat.