6 Replies Latest reply on May 10, 2007 6:26 AM by ilya_shaikovsky

    RichFaces SuggestionBox cursor problem

    1kaa

      When using the suggestion box in IE 6.0, the cursor becomes stuck in the field.

      To replicate this, goto the demo:

      http://livedemo.exadel.com/richfaces-demo/richfaces/suggestionBox.jsf

      Type in 'a'

      Choose a value USING the MOUSE

      Now try to tab out of the field. (or click in another field)

      More often that not you cannot leave this field immediately. You may have to repeat the steps above a few times to see the problem.

      It doesn't seem to be a problem if you use the cursor keys. Works OK in firefox too.

      Any suggestions? (pun intended).

        • 1. Re: RichFaces SuggestionBox cursor problem

          livedemo still contains example of Richfaces 3.0.0
          I have just checked the latest snapshot. The problem is not reproducible there. Try

          • 2. Re: RichFaces SuggestionBox cursor problem
            1kaa

            Hi Sergey,

            Thanks for the advice. I've tried the latest snapshot of RichFaces and Ajax4JSF (2007/04/24). However when I try to use the SuggestionBox I get a Javascript error.

            Firebug seems to suggest that line 48 in suggestionbox.js is at fault. The variable options is undefined. Has there been a change in the component definition?

            Any suggestions gratefully received. In the meantime, I'll try a different snapshot, just in case the latest is broken.

            Line 48 is :

            Exadel.Suggestion=Class.create();Object.extend(Object.extend(Exadel.Suggestion.prototype,Suggestion.Base.prototype),
            {initialize:function(containerId,actionUrl,element,content,onsubmit,options)
            {var update=options.popup||'ac1update';
            if(!$(update))this.create(element,update,content,options);
            this.baseInitialize(element,update,options);this.options.asynchronous=true;
            this.options.onajaxcomplete=options.oncomplete;
            this.options.oncomplete=this.onComplete.bind(this);
            this.options.defaultParams=this.options.parameters||null;
            this.content=content;this.containerId=containerId;this.actionUrl=actionUrl;
            this.input=$(element);this.oldValue=$(element).value;
            if(onsubmit&&onsubmit!='null'){this.onsubmitFunction=new Function(onsubmit).bind(this.input);}

            I'm using the following jsp snippet which worked ok in 3.0.0:

            <a4j:region id="supplierAjax">
             <h:column>
             <h:inputText id="supplierCode"
             value="#{viewForecastEDIHandler.supplierCode}" maxlength="6"
             size="6">
             </h:inputText>
             </h:column>
             <rich:suggestionbox id="supplierSuggest" for="supplierCode"
             immediate="true"
             suggestionAction="#{supplierSuggestHandler.autocompleteSupplier}"
             width="330" height="150" var="sc" minChars="2"
             frequency="1" ignoreDupResponses="true" fetchValue="#{sc.supplierCode}"
             frequency="1">
             <h:column>
             <h:outputText value="#{sc.supplierCode}: #{sc.companyName}" />
             </h:column>
            </rich:suggestionbox>
            </a4j:region>



            • 3. Re: RichFaces SuggestionBox cursor problem
              1kaa

              The javascript error still appears in the builds from 2007/04/15.

              I tried the latest a4j snapshot with Richfaces 3.0.0., whilst there was no javascript error, the stuck cursor problem is still there.

              • 4. Re: RichFaces SuggestionBox cursor problem
                1kaa

                 

                "1kaa" wrote:
                ... However when I try to use the SuggestionBox I get a Javascript error...


                Scratch that. I'd overridden the Suggestion Box renderer to fix the old JDK1.5 issue and not removed this code. Sorry.

                As you noted, the cursor problem works fine in the latest code.

                Regards,

                Karl.

                • 5. Re: RichFaces SuggestionBox cursor problem
                  mirceapop

                  Hi,

                  I have a question related to suggestionBox:

                  I have 3 input fields: Country, Region and City. What I want is that if I select A country then in the region suggest only the regions for that country to suggest. Same for the City.

                  The problem what I am facing is that on the server side I don't get the value of the previous field.
                  Ex: I select USA in the first field.
                  then on the region field - on the server I don't get USA in the value of the bean.

                  I'm using request beans. Is there a way to tell suggestion to submit also the values already selected?

                  I can't use session beans.

                  Regards,
                  Mircea

                  • 6. Re: RichFaces SuggestionBox cursor problem
                    ilya_shaikovsky

                    Use ajaxSingle="false" on the suggestionBox component. So all other inputs will be submitted also.