6 Replies Latest reply on Sep 13, 2013 5:31 AM by liumin hu

    why rich:autocomplete has not execute attribute?

    liumin hu Master

      hi,

       

      i am using the rich:autocomplete with some filters, but i cant find execute attribute for rich:autocomplete, is it normal?

       

      thanks in advance

       

      liu

        • 1. Re: why rich:autocomplete has not execute attribute?
          Lukáš Fryč Master

          rich:autocomplete does not expose @execute attribute, because it uses JSF ajax only for updating list of suggestions. This operation should not execute any other logic on the server.

           

          If you want autocomplete to execute something on server, let's do some JSF ajax as callback to some action, e.g.:

           

          <rich:autocomplete mode="ajax" autocompleteMethod="...">

              <a4j:ajax event="change" execute="..." render="..." />

          </rich:autocomplete>

          • 2. Re: why rich:autocomplete has not execute attribute?
            liumin hu Master

            the onchange event is not fired when auto suggestion fired. I tried onkeypress,onkeyup and onkeydown too, none of them works. what i want is some other values are submited the same time as auto suggestion fired, i need them to construct the suggesiton liste. even thought i can submit these values in separate ajax request, i think it is a little regretful to not have execute on autosuggestion.

            • 3. Re: why rich:autocomplete has not execute attribute?
              Brian Leathem Master

              What version of RichFaces are you using?  Try something current, as ajax not firing on autocomplete events was addressed a while back (RF-12114).

              • 4. Re: why rich:autocomplete has not execute attribute?
                liumin hu Master

                hi,

                 

                i am using latest RF4.3.3. those events are fired well. but its not what i need. i need autocomplete submit some others values than his input.

                • 5. Re: why rich:autocomplete has not execute attribute?
                  Brian Leathem Master

                  Sorry, I misunderstood.

                   

                  So I understand the use case, you want to use the state of other page inputs in populating the suggestion list of the autocomplete component, right?  So a user changes the value of a page input (say inputA), then goes to the autocomplete method, and starts typing.  You want the ajax request fired to populate the suggestion list to execute inputA with the ajax request to populate the suggestion list?

                   

                  To me this seems in-efficient, as the value of inputA would be executed and included in the request with every keypress, while the value of inputA will not have changed between sequential keypresses.  Seems like executing an ajax call when the autocomplete receives focus would be most desirable here.  If not, please expand on your use case, and correct me where my assumptions are wrong.

                  1 of 1 people found this helpful
                  • 6. Re: why rich:autocomplete has not execute attribute?
                    liumin hu Master

                    hi,

                    yes your understanding is correct. I am migrating a RF3 projet to RF4, it worked like this. For me, an ajax request is a request, it could be slow even it is small. and I think it is not very costful to add 1 or 2 values in submit.

                     

                    anyway, what i did is add a ajax on the others input's onchange event.

                     

                    thanks

                     

                    liu