Loading ...
Sorry, an error occurred while loading the content.

DWR and Autocomplete

Expand Messages
  • cy_doyle
    Has anyone integrated these together? I am looking at the Autocomplete documentation and it looks like it is ideal to use the XHRDataSource. However, it wants
    Message 1 of 8 , Jan 31, 2007
    • 0 Attachment
      Has anyone integrated these together? I am looking at the Autocomplete
      documentation and it looks like it is ideal to use the XHRDataSource.
      However, it wants to send a URL like this: http://url?query=foo. This
      is not be compatible with DWR. I see in the documentation that I can
      send other parameters with the query, but the problem is the term
      "foo" which represents a string a user has put in a textbox that will
      be used to drive results from a datasource to populate the
      autocomplete drop down(phew, that was a mouthful). I looked at the
      request that DWR sends through its engine and the term that is sent to
      DWR needs to be prefixed with "string:". Do I have to customize the
      yahoo library for autocomplete to append this? Is their a better approach?

      Another approach is to build the YAHOO.widget.AutoComplete object
      after a call to DWR has been made. But it seems I loose the benefit of
      some of the features in auto complete. For instance, I would have to
      write code to detect when to retrieve a new query, whereas
      XHRDataSource will do this automatically.

      Thanks for any help,
      Dan
    • jennykhan
      Hi Dan, By setting the following value: myXHRDataSource.scriptQueryParam = string ; the URL sent will be http://url?string=foo Hope that helps, Jenny ...
      Message 2 of 8 , Jan 31, 2007
      • 0 Attachment
        Hi Dan,

        By setting the following value:

        myXHRDataSource.scriptQueryParam = "string";

        the URL sent will be

        http://url?string=foo



        Hope that helps,
        Jenny



        --- In ydn-javascript@yahoogroups.com, "cy_doyle" <dan.c.doyle@...> wrote:
        >
        > Has anyone integrated these together? I am looking at the Autocomplete
        > documentation and it looks like it is ideal to use the XHRDataSource.
        > However, it wants to send a URL like this: http://url?query=foo. This
        > is not be compatible with DWR. I see in the documentation that I can
        > send other parameters with the query, but the problem is the term
        > "foo" which represents a string a user has put in a textbox that will
        > be used to drive results from a datasource to populate the
        > autocomplete drop down(phew, that was a mouthful). I looked at the
        > request that DWR sends through its engine and the term that is sent to
        > DWR needs to be prefixed with "string:". Do I have to customize the
        > yahoo library for autocomplete to append this? Is their a better
        approach?
        >
        > Another approach is to build the YAHOO.widget.AutoComplete object
        > after a call to DWR has been made. But it seems I loose the benefit of
        > some of the features in auto complete. For instance, I would have to
        > write code to detect when to retrieve a new query, whereas
        > XHRDataSource will do this automatically.
        >
        > Thanks for any help,
        > Dan
        >
      • dan.doyle@cexp.com
        Thank you for the reply. So, I saw this in the documentation, but that is not exactly the problem. The problem is that I need to append string: in front of
        Message 3 of 8 , Jan 31, 2007
        • 0 Attachment

          Thank you for the reply. So, I saw this in the documentation, but that is not exactly the problem. The problem is that I need to append “string:” in front of the term.

           

          So, if I take your example, the URL should look like

          http://url?query=string:foo

           

          Whereas, it looks like XHRDatasource will automagically give me the URL

          http://url?query=foo

           

          with no option to modify the term. I realize this is a strange request as normally we would just append the term, but DWR doesn’t work its magic that way. Matter of fact, DWR wants the user to use the DWREngine object to perform the AJAX call so creating a URL is a workaround because of the mismatch between the two tools.

           

          It would be better if I could assign a custom AJAX call to a XHRDatasource object and assign the callback to that object. Since this is JS, I imagine I can reassign some properties in the AutoComplete object to do this. Does anyone know which properties in the object perform the call and are used for the callback? If this was the case, then XHRDatasource could drive the custom function that performs the AJAX call whenever an event occurs in the textbox that is providing the autocomplete. As it is, it looks like I have to use the AJAX functionality built into the XHRDatasource. There are plenty of AJAX frameworks around and I imagine this would make the AutoComplete library even more useful. As it is, I have to leave the AJAX calls up to the XHRDatasource object.

           

          Thanks again for the suggestion,

          Dan

           


          From: ydn-javascript@yahoogroups.com [mailto:ydn-javascript@yahoogroups.com] On Behalf Of jennykhan
          Sent: Wednesday, January 31, 2007 2:21 PM
          To: ydn-javascript@yahoogroups.com
          Subject: [ydn-javascript] Re: DWR and Autocomplete

           

          Hi Dan,

          By setting the following value:

          myXHRDataSource. scriptQueryParam = "string";

          the URL sent will be

          http://url?string= foo

          Hope that helps,
          Jenny

          --- In ydn-javascript@ yahoogroups. com, "cy_doyle" <dan.c.doyle@ ...> wrote:

          >
          > Has anyone integrated these together? I am looking at the Autocomplete
          > documentation and it looks like it is ideal to use the XHRDataSource.
          > However, it wants to send a URL like this: http://url?query= foo.
          This
          > is not be compatible with DWR. I see in the documentation that I can
          > send other parameters with the query, but the problem is the term
          > "foo" which represents a string a user has put in a textbox that
          will
          > be used to drive results from a datasource to populate the
          > autocomplete drop down(phew, that was a mouthful). I looked at the
          > request that DWR sends through its engine and the term that is sent to
          > DWR needs to be prefixed with "string:". Do I have to customize
          the
          > yahoo library for autocomplete to append this? Is their a better
          approach?
          >
          > Another approach is to build the YAHOO.widget. AutoComplete object
          > after a call to DWR has been made. But it seems I loose the benefit of
          > some of the features in auto complete. For instance, I would have to
          > write code to detect when to retrieve a new query, whereas
          > XHRDataSource will do this automatically.
          >
          > Thanks for any help,
          > Dan
          >

        • jennykhan
          Hi Dan, In that case, you might want to try customizing the following function from YAHOO.widget.AutoComplete.prototype.sendQuery = function(sQuery) {
          Message 4 of 8 , Feb 1, 2007
          • 0 Attachment
            Hi Dan,

            In that case, you might want to try customizing the following function
            from

            YAHOO.widget.AutoComplete.prototype.sendQuery = function(sQuery) {
            this._sendQuery(sQuery);
            };

            to

            YAHOO.widget.AutoComplete.prototype.sendQuery = function(sQuery) {
            this._sendQuery("string:"+sQuery);
            };

            Regards,
            Jenny






            --- In ydn-javascript@yahoogroups.com, <dan.doyle@...> wrote:
            >
            > Thank you for the reply. So, I saw this in the documentation, but that
            > is not exactly the problem. The problem is that I need to append
            > "string:" in front of the term.
            >
            >
            >
            > So, if I take your example, the URL should look like
            >
            > http://url?query=string:foo <http://url/?query=string:foo>
            >
            >
            >
            > Whereas, it looks like XHRDatasource will automagically give me the URL
            >
            > http://url?query=foo <http://url/?query=foo>
            >
            >
            >
            > with no option to modify the term. I realize this is a strange request
            > as normally we would just append the term, but DWR doesn't work its
            > magic that way. Matter of fact, DWR wants the user to use the DWREngine
            > object to perform the AJAX call so creating a URL is a workaround
            > because of the mismatch between the two tools.
            >
            >
            >
            > It would be better if I could assign a custom AJAX call to a
            > XHRDatasource object and assign the callback to that object. Since this
            > is JS, I imagine I can reassign some properties in the AutoComplete
            > object to do this. Does anyone know which properties in the object
            > perform the call and are used for the callback? If this was the case,
            > then XHRDatasource could drive the custom function that performs the
            > AJAX call whenever an event occurs in the textbox that is providing the
            > autocomplete. As it is, it looks like I have to use the AJAX
            > functionality built into the XHRDatasource. There are plenty of AJAX
            > frameworks around and I imagine this would make the AutoComplete library
            > even more useful. As it is, I have to leave the AJAX calls up to the
            > XHRDatasource object.
            >
            >
            >
            > Thanks again for the suggestion,
            >
            > Dan
            >
            >
            >
            > ________________________________
            >
            > From: ydn-javascript@yahoogroups.com
            > [mailto:ydn-javascript@yahoogroups.com] On Behalf Of jennykhan
            > Sent: Wednesday, January 31, 2007 2:21 PM
            > To: ydn-javascript@yahoogroups.com
            > Subject: [ydn-javascript] Re: DWR and Autocomplete
            >
            >
            >
            > Hi Dan,
            >
            > By setting the following value:
            >
            > myXHRDataSource.scriptQueryParam = "string";
            >
            > the URL sent will be
            >
            > http://url?string=foo <http://url?string=foo>
            >
            > Hope that helps,
            > Jenny
            >
            > --- In ydn-javascript@yahoogroups.com
            > <mailto:ydn-javascript%40yahoogroups.com> , "cy_doyle" <dan.c.doyle@>
            > wrote:
            > >
            > > Has anyone integrated these together? I am looking at the Autocomplete
            > > documentation and it looks like it is ideal to use the XHRDataSource.
            > > However, it wants to send a URL like this: http://url?query=foo.
            > <http://url?query=foo.> This
            > > is not be compatible with DWR. I see in the documentation that I can
            > > send other parameters with the query, but the problem is the term
            > > "foo" which represents a string a user has put in a textbox that will
            > > be used to drive results from a datasource to populate the
            > > autocomplete drop down(phew, that was a mouthful). I looked at the
            > > request that DWR sends through its engine and the term that is sent to
            > > DWR needs to be prefixed with "string:". Do I have to customize the
            > > yahoo library for autocomplete to append this? Is their a better
            > approach?
            > >
            > > Another approach is to build the YAHOO.widget.AutoComplete object
            > > after a call to DWR has been made. But it seems I loose the benefit of
            > > some of the features in auto complete. For instance, I would have to
            > > write code to detect when to retrieve a new query, whereas
            > > XHRDataSource will do this automatically.
            > >
            > > Thanks for any help,
            > > Dan
            > >
            >
          • dan.doyle@cexp.com
            Thank you for the help. I will try it out and get back to the list. Dan ________________________________ From: ydn-javascript@yahoogroups.com
            Message 5 of 8 , Feb 1, 2007
            • 0 Attachment

              Thank you for the help. I will try it out and get back to the list.

               

              Dan

               


              From: ydn-javascript@yahoogroups.com [mailto: ydn-javascript@yahoogroups.com ] On Behalf Of jennykhan
              Sent: Thursday, February 01, 2007 2:52 PM
              To: ydn-javascript@yahoogroups.com
              Subject: [ydn-javascript] Re: DWR and Autocomplete

               

              Hi Dan,

              In that case, you might want to try customizing the following function
              from

              YAHOO.widget. AutoComplete. prototype. sendQuery = function(sQuery) {
              this._sendQuery( sQuery);
              };

              to

              YAHOO.widget. AutoComplete. prototype. sendQuery = function(sQuery) {
              this._sendQuery( "string:" +sQuery);
              };

              Regards,
              Jenny

              --- In ydn-javascript@ yahoogroups. com, <dan.doyle@. ..> wrote:

              >
              > Thank you for the reply. So, I saw this in the documentation, but that
              > is not exactly the problem. The problem is that I need to append
              > "string:" in front of the term.
              >
              >
              >
              > So, if I take your example, the URL should look like
              >
              > http://url?query= string:foo
              <http://url/? query=string: foo>
              >
              >
              >
              > Whereas, it looks like XHRDatasource will automagically give me the URL
              >
              > http://url?query= foo <
              href="http://url/?query=foo">http://url/? query=foo>
              >
              >
              >
              > with no option to modify the term. I realize this is a strange request
              > as normally we would just append the term, but DWR doesn't work its
              > magic that way. Matter of fact, DWR wants the user to use the DWREngine
              > object to perform the AJAX
              call so creating a URL is a workaround
              > because of the mismatch between the two tools.
              >
              >
              >
              > It would be better if I could assign a custom
              w:st="on">AJAX call to a
              > XHRDatasource object and assign the callback to that object. Since this
              > is JS, I imagine I can reassign some properties in the AutoComplete
              > object to do this. Does anyone know which properties in the object
              > perform the call and are used for the callback? If this was the case,
              > then XHRDatasource could drive the custom function that performs the
              > AJAX call
              whenever an event occurs in the textbox that is providing the
              > autocomplete. As it is, it looks like I have to use the
              w:st="on">AJAX
              > functionality built into the XHRDatasource. There are plenty of
              w:st="on"> AJAX
              > frameworks around and I imagine this would make the AutoComplete library
              > even more useful. As it is, I have to leave the
              w:st="on">AJAX calls up to the
              > XHRDatasource object.
              >
              >
              >
              > Thanks again for the suggestion,
              >
              > Dan
              >
              >
              >
              > ____________ _________ _________ __
              >
              > From: ydn-javascript@ yahoogroups. com
              > [mailto:ydn-javascript@ yahoogroups. com]
              On Behalf Of jennykhan
              > Sent: Wednesday, January 31, 2007 2:21 PM
              > To: ydn-javascript@ yahoogroups. com
              > Subject: [ydn-javascript] Re: DWR and Autocomplete
              >
              >
              >
              > Hi Dan,
              >
              > By setting the following value:
              >
              > myXHRDataSource. scriptQueryParam = "string";
              >
              > the URL sent will be
              >
              > http://url?string= foo <
              href="http://url?string=foo">http://url?string= foo>
              >
              > Hope that helps,
              > Jenny
              >
              > --- In ydn-javascript@ yahoogroups. com
              > <mailto:ydn- javascript% 40yahoogroups. com> ,
              "cy_doyle" <dan.c.doyle@ >
              > wrote:
              > >
              > > Has anyone integrated these together? I am looking at the
              Autocomplete
              > > documentation and it looks like it is ideal to use the XHRDataSource.
              > > However, it wants to send a URL like this:
              href="http://url?query=foo.">http://url?query= foo.
              > <http://url?query= foo.>
              This
              > > is not be compatible with DWR. I see in the documentation that I can
              > > send other parameters with the query, but the problem is the term
              > > "foo" which represents a string a user has put in a textbox
              that will
              > > be used to drive results from a datasource to populate the
              > > autocomplete drop down(phew, that was a mouthful). I looked at the
              > > request that DWR sends through its engine and the term that is sent
              to
              > > DWR needs to be prefixed with "string:". Do I have to
              customize the
              > > yahoo library for autocomplete to append this? Is their a better
              > approach?
              > >
              > > Another approach is to build the YAHOO.widget. AutoComplete
              object
              > > after a call to DWR has been made. But it seems I loose the benefit
              of
              > > some of the features in auto complete. For instance, I would have to
              > > write code to detect when to retrieve a new query, whereas
              > > XHRDataSource will do this automatically.
              > >
              > > Thanks for any help,
              > > Dan
              > >
              >

            • dan.doyle@cexp.com
              Update: I have not bridged Yahoo and DWR yet. It seems like it should be straightforward, but I have not had the time to delve into the details of either
              Message 6 of 8 , Feb 6, 2007
              • 0 Attachment

                Update:

                 

                I have not bridged Yahoo and DWR yet. It seems like it should be straightforward, but I have not had the time to delve into the details of either library and work must go on. From what I can tell, bridging the two is not as simple as having Yahoo generate the proper query. DWR generates a unique token that I believe it uses to match up returns. In addition, DWR attempts to bridge the Java world with the Javascript world by trying to generate the notion of a bean on the client. I suspect that the callback from DWR is more complicated than a JSON or an array or just plain XML as the information returned from DWR has to create the pseudo-bean.

                 

                Nevertheless, I am going to implement a servlet that receives a query term as the Yahoo library prescribes for the time being. I will resume looking into both javascript libraries to see how I can make an adapter Yahoo will make AJAX calls through to DWR and DWR callbacks feed back into Yahoo. There is value in having a framework that is flexible enough to allow a developer to plugin their preferred AJAX framework. I think that it is a shortcoming for the Yahoo library to couple features to a specific implementation of AJAX . After all, Yahoo’s library is has many great features, is maturing or is mature (I can’t tell at this point), and it has excellent community support and those are huge plusses for me as a developer.

                 

                Dan

                 

                 

                 


                From: ydn-javascript@yahoogroups.com [mailto: ydn-javascript@yahoogroups.com ] On Behalf Of jennykhan
                Sent: Thursday, February 01, 2007 2:52 PM
                To: ydn-javascript@yahoogroups.com
                Subject: [ydn-javascript] Re: DWR and Autocomplete

                 

                Hi Dan,

                In that case, you might want to try customizing the following function
                from

                YAHOO.widget. AutoComplete. prototype. sendQuery = function(sQuery) {
                this._sendQuery( sQuery);
                };

                to

                YAHOO.widget. AutoComplete. prototype. sendQuery = function(sQuery) {
                this._sendQuery( "string:" +sQuery);
                };

                Regards,
                Jenny

                --- In ydn-javascript@ yahoogroups. com, <dan.doyle@. ..> wrote:

                >
                > Thank you for the reply. So, I saw this in the documentation, but that
                > is not exactly the problem. The problem is that I need to append
                > "string:" in front of the term.
                >
                >
                >
                > So, if I take your example, the URL should look like
                >
                > http://url?query= string:foo
                <http://url/? query=string: foo>
                >
                >
                >
                > Whereas, it looks like XHRDatasource will automagically give me the URL
                >
                > http://url?query= foo <
                href="http://url/?query=foo">http://url/? query=foo>
                >
                >
                >
                > with no option to modify the term. I realize this is a strange request
                > as normally we would just append the term, but DWR doesn't work its
                > magic that way. Matter of fact, DWR wants the user to use the DWREngine
                > object to perform the AJAX
                call so creating a URL is a workaround
                > because of the mismatch between the two tools.
                >
                >
                >
                > It would be better if I could assign a custom
                w:st="on">AJAX call to a
                > XHRDatasource object and assign the callback to that object. Since this
                > is JS, I imagine I can reassign some properties in the AutoComplete
                > object to do this. Does anyone know which properties in the object
                > perform the call and are used for the callback? If this was the case,
                > then XHRDatasource could drive the custom function that performs the
                > AJAX call
                whenever an event occurs in the textbox that is providing the
                > autocomplete. As it is, it looks like I have to use the
                w:st="on">AJAX
                > functionality built into the XHRDatasource. There are plenty of
                w:st="on"> AJAX
                > frameworks around and I imagine this would make the AutoComplete library
                > even more useful. As it is, I have to leave the
                w:st="on">AJAX calls up to the
                > XHRDatasource object.
                >
                >
                >
                > Thanks again for the suggestion,
                >
                > Dan
                >
                >
                >
                > ____________ _________ _________ __
                >
                > From: ydn-javascript@ yahoogroups. com
                > [mailto:ydn-javascript@ yahoogroups. com]
                On Behalf Of jennykhan
                > Sent: Wednesday, January 31, 2007 2:21 PM
                > To: ydn-javascript@ yahoogroups. com
                > Subject: [ydn-javascript] Re: DWR and Autocomplete
                >
                >
                >
                > Hi Dan,
                >
                > By setting the following value:
                >
                > myXHRDataSource. scriptQueryParam = "string";
                >
                > the URL sent will be
                >
                > http://url?string= foo <
                href="http://url?string=foo">http://url?string= foo>
                >
                > Hope that helps,
                > Jenny
                >
                > --- In ydn-javascript@ yahoogroups. com
                > <mailto:ydn- javascript% 40yahoogroups. com> ,
                "cy_doyle" <dan.c.doyle@ >
                > wrote:
                > >
                > > Has anyone integrated these together? I am looking at the
                Autocomplete
                > > documentation and it looks like it is ideal to use the XHRDataSource.
                > > However, it wants to send a URL like this:
                href="http://url?query=foo.">http://url?query= foo.
                > <http://url?query= foo.>
                This
                > > is not be compatible with DWR. I see in the documentation that I can
                > > send other parameters with the query, but the problem is the term
                > > "foo" which represents a string a user has put in a textbox
                that will
                > > be used to drive results from a datasource to populate the
                > > autocomplete drop down(phew, that was a mouthful). I looked at the
                > > request that DWR sends through its engine and the term that is sent
                to
                > > DWR needs to be prefixed with "string:". Do I have to
                customize the
                > > yahoo library for autocomplete to append this? Is their a better
                > approach?
                > >
                > > Another approach is to build the YAHOO.widget. AutoComplete
                object
                > > after a call to DWR has been made. But it seems I loose the benefit
                of
                > > some of the features in auto complete. For instance, I would have to
                > > write code to detect when to retrieve a new query, whereas
                > > XHRDataSource will do this automatically.
                > >
                > > Thanks for any help,
                > > Dan
                > >
                >

              • Nige White
                We use DWR, but I didn t bother when I implemented autocomplete. You d have to imlpement your own DataSource with the correct interface but using DWR under the
                Message 7 of 8 , Feb 7, 2007
                • 0 Attachment
                  We use DWR, but I didn't bother when I implemented autocomplete. You'd
                  have to imlpement your own DataSource with the correct interface but
                  using DWR under the surface. I thought it was just too much work, and
                  used a standard DS_XHR DataSource of type YAHOO.widget.DS_XHR.TYPE_JSON,
                  and wrote a little servlet to do the query and generate the JSON. Took 1
                  day.

                  Implementing a new DataSource would have taken longer.

                  dan.doyle@... wrote:

                  > Update:
                  >
                  > I have not bridged Yahoo and DWR yet. It seems like it should be
                  > straightforward, but I have not had the time to delve into the details
                  > of either library and work must go on. From what I can tell, bridging
                  > the two is not as simple as having Yahoo generate the proper query.
                  > DWR generates a unique token that I believe it uses to match up
                  > returns. In addition, DWR attempts to bridge the Java world with the
                  > Javascript world by trying to generate the notion of a bean on the
                  > client. I suspect that the callback from DWR is more complicated than
                  > a JSON or an array or just plain XML as the information returned from
                  > DWR has to create the pseudo-bean.
                  >
                  > Nevertheless, I am going to implement a servlet that receives a query
                  > term as the Yahoo library prescribes for the time being. I will resume
                  > looking into both javascript libraries to see how I can make an
                  > adapter Yahoo will make AJAX calls through to DWR and DWR callbacks
                  > feed back into Yahoo. There is value in having a framework that is
                  > flexible enough to allow a developer to plugin their preferred AJAX
                  > framework. I think that it is a shortcoming for the Yahoo library to
                  > couple features to a specific implementation of AJAX. After all,
                  > Yahoo’s library is has many great features, is maturing or is mature
                  > (I can’t tell at this point), and it has excellent community support
                  > and those are huge plusses for me as a developer.
                  >
                  > Dan
                  >
                  > ------------------------------------------------------------------------
                  >
                  > *From:* ydn-javascript@yahoogroups.com
                  > [mailto:ydn-javascript@yahoogroups.com] *On Behalf Of *jennykhan
                  > *Sent:* Thursday, February 01, 2007 2:52 PM
                  > *To:* ydn-javascript@yahoogroups.com
                  > *Subject:* [ydn-javascript] Re: DWR and Autocomplete
                  >
                  > Hi Dan,
                  >
                  > In that case, you might want to try customizing the following function
                  > from
                  >
                  > YAHOO.widget.AutoComplete.prototype.sendQuery = function(sQuery) {
                  > this._sendQuery(sQuery);
                  > };
                  >
                  > to
                  >
                  > YAHOO.widget.AutoComplete.prototype.sendQuery = function(sQuery) {
                  > this._sendQuery("string:"+sQuery);
                  > };
                  >
                  > Regards,
                  > Jenny
                  >
                  > --- In ydn-javascript@yahoogroups.com
                  > <mailto:ydn-javascript%40yahoogroups.com>, <dan.doyle@...> wrote:
                  >>
                  >> Thank you for the reply. So, I saw this in the documentation, but that
                  >> is not exactly the problem. The problem is that I need to append
                  >> "string:" in front of the term.
                  >>
                  >>
                  >>
                  >> So, if I take your example, the URL should look like
                  >>
                  >> http://url?query=string:foo <http://url?query=string:foo>
                  > <http://url/?query=string:foo <http://url/?query=string:foo>>
                  >>
                  >>
                  >>
                  >> Whereas, it looks like XHRDatasource will automagically give me the URL
                  >>
                  >> http://url?query=foo <http://url?query=foo> <http://url/?query=foo
                  > <http://url/?query=foo>>
                  >>
                  >>
                  >>
                  >> with no option to modify the term. I realize this is a strange request
                  >> as normally we would just append the term, but DWR doesn't work its
                  >> magic that way. Matter of fact, DWR wants the user to use the DWREngine
                  >> object to perform the AJAX call so creating a URL is a workaround
                  >> because of the mismatch between the two tools.
                  >>
                  >>
                  >>
                  >> It would be better if I could assign a custom AJAX call to a
                  >> XHRDatasource object and assign the callback to that object. Since this
                  >> is JS, I imagine I can reassign some properties in the AutoComplete
                  >> object to do this. Does anyone know which properties in the object
                  >> perform the call and are used for the callback? If this was the case,
                  >> then XHRDatasource could drive the custom function that performs the
                  >> AJAX call whenever an event occurs in the textbox that is providing the
                  >> autocomplete. As it is, it looks like I have to use the AJAX
                  >> functionality built into the XHRDatasource. There are plenty of AJAX
                  >> frameworks around and I imagine this would make the AutoComplete library
                  >> even more useful. As it is, I have to leave the AJAX calls up to the
                  >> XHRDatasource object.
                  >>
                  >>
                  >>
                  >> Thanks again for the suggestion,
                  >>
                  >> Dan
                  >>
                  >>
                  >>
                  >> ________________________________
                  >>
                  >> From: ydn-javascript@yahoogroups.com
                  > <mailto:ydn-javascript%40yahoogroups.com>
                  >> [mailto:ydn-javascript@yahoogroups.com
                  > <mailto:ydn-javascript%40yahoogroups.com>] On Behalf Of jennykhan
                  >> Sent: Wednesday, January 31, 2007 2:21 PM
                  >> To: ydn-javascript@yahoogroups.com
                  > <mailto:ydn-javascript%40yahoogroups.com>
                  >> Subject: [ydn-javascript] Re: DWR and Autocomplete
                  >>
                  >>
                  >>
                  >> Hi Dan,
                  >>
                  >> By setting the following value:
                  >>
                  >> myXHRDataSource.scriptQueryParam = "string";
                  >>
                  >> the URL sent will be
                  >>
                  >> http://url?string=foo <http://url?string=foo> <http://url?string=foo
                  > <http://url?string=foo>>
                  >>
                  >> Hope that helps,
                  >> Jenny
                  >>
                  >> --- In ydn-javascript@yahoogroups.com
                  > <mailto:ydn-javascript%40yahoogroups.com>
                  >> <mailto:ydn-javascript%40yahoogroups.com> , "cy_doyle" <dan.c.doyle@>
                  >> wrote:
                  >> >
                  >> > Has anyone integrated these together? I am looking at the Autocomplete
                  >> > documentation and it looks like it is ideal to use the XHRDataSource.
                  >> > However, it wants to send a URL like this: http://url?query=foo.
                  > <http://url?query=foo.>
                  >> <http://url?query=foo. <http://url?query=foo.>> This
                  >> > is not be compatible with DWR. I see in the documentation that I can
                  >> > send other parameters with the query, but the problem is the term
                  >> > "foo" which represents a string a user has put in a textbox that will
                  >> > be used to drive results from a datasource to populate the
                  >> > autocomplete drop down(phew, that was a mouthful). I looked at the
                  >> > request that DWR sends through its engine and the term that is sent to
                  >> > DWR needs to be prefixed with "string:". Do I have to customize the
                  >> > yahoo library for autocomplete to append this? Is their a better
                  >> approach?
                  >> >
                  >> > Another approach is to build the YAHOO.widget.AutoComplete object
                  >> > after a call to DWR has been made. But it seems I loose the benefit of
                  >> > some of the features in auto complete. For instance, I would have to
                  >> > write code to detect when to retrieve a new query, whereas
                  >> > XHRDataSource will do this automatically.
                  >> >
                  >> > Thanks for any help,
                  >> > Dan
                  >> >
                  >>
                  >
                  >
                  > - -
                  > Scanned for viruses.



                  - -
                  Forward Computers Limited is a company registered in England and Wales with company number 3249628, VAT Number 416458349. Registered office address : Forward House, 161 Glaisdale Drive West, Nottingham, NG8 4GY

                  This email has been scanned for viruses by Messagelabs.
                • dan.doyle@cexp.com
                  Yeah, implementing a servlet is easy and I already did the work last night. However, my concern is creating too many vectors that an attacker can use to do
                  Message 8 of 8 , Feb 7, 2007
                  • 0 Attachment
                    Yeah, implementing a servlet is easy and I already did the work last
                    night. However, my concern is creating too many vectors that an attacker
                    can use to do whatever. The more openings I create either through DWR or
                    a special servlet is more opportunity. So, it seems it is best to keep
                    it to as few as attack vectors as possible.

                    Thanks for relating your experience. At least I know I am not alone in
                    thinking that several AJAX frameworks will exist if a person uses Yahoo
                    and that this is not the ideal.

                    Dan

                    -----Original Message-----
                    From: ydn-javascript@yahoogroups.com
                    [mailto:ydn-javascript@yahoogroups.com] On Behalf Of Nige White
                    Sent: Wednesday, February 07, 2007 1:26 AM
                    To: ydn-javascript@yahoogroups.com
                    Subject: Re: [ydn-javascript] Re: DWR and Autocomplete

                    We use DWR, but I didn't bother when I implemented autocomplete. You'd
                    have to imlpement your own DataSource with the correct interface but
                    using DWR under the surface. I thought it was just too much work, and
                    used a standard DS_XHR DataSource of type YAHOO.widget.DS_XHR.TYPE_JSON,

                    and wrote a little servlet to do the query and generate the JSON. Took 1

                    day.

                    Implementing a new DataSource would have taken longer.

                    dan.doyle@... wrote:

                    > Update:
                    >
                    > I have not bridged Yahoo and DWR yet. It seems like it should be
                    > straightforward, but I have not had the time to delve into the details

                    > of either library and work must go on. From what I can tell, bridging
                    > the two is not as simple as having Yahoo generate the proper query.
                    > DWR generates a unique token that I believe it uses to match up
                    > returns. In addition, DWR attempts to bridge the Java world with the
                    > Javascript world by trying to generate the notion of a bean on the
                    > client. I suspect that the callback from DWR is more complicated than
                    > a JSON or an array or just plain XML as the information returned from
                    > DWR has to create the pseudo-bean.
                    >
                    > Nevertheless, I am going to implement a servlet that receives a query
                    > term as the Yahoo library prescribes for the time being. I will resume

                    > looking into both javascript libraries to see how I can make an
                    > adapter Yahoo will make AJAX calls through to DWR and DWR callbacks
                    > feed back into Yahoo. There is value in having a framework that is
                    > flexible enough to allow a developer to plugin their preferred AJAX
                    > framework. I think that it is a shortcoming for the Yahoo library to
                    > couple features to a specific implementation of AJAX. After all,
                    > Yahoo's library is has many great features, is maturing or is mature
                    > (I can't tell at this point), and it has excellent community support
                    > and those are huge plusses for me as a developer.
                    >
                    > Dan
                    >
                    >
                    ------------------------------------------------------------------------
                    >
                    > *From:* ydn-javascript@yahoogroups.com
                    > [mailto:ydn-javascript@yahoogroups.com] *On Behalf Of *jennykhan
                    > *Sent:* Thursday, February 01, 2007 2:52 PM
                    > *To:* ydn-javascript@yahoogroups.com
                    > *Subject:* [ydn-javascript] Re: DWR and Autocomplete
                    >
                    > Hi Dan,
                    >
                    > In that case, you might want to try customizing the following function
                    > from
                    >
                    > YAHOO.widget.AutoComplete.prototype.sendQuery = function(sQuery) {
                    > this._sendQuery(sQuery);
                    > };
                    >
                    > to
                    >
                    > YAHOO.widget.AutoComplete.prototype.sendQuery = function(sQuery) {
                    > this._sendQuery("string:"+sQuery);
                    > };
                    >
                    > Regards,
                    > Jenny
                    >
                    > --- In ydn-javascript@yahoogroups.com
                    > <mailto:ydn-javascript%40yahoogroups.com>, <dan.doyle@...> wrote:
                    >>
                    >> Thank you for the reply. So, I saw this in the documentation, but
                    that
                    >> is not exactly the problem. The problem is that I need to append
                    >> "string:" in front of the term.
                    >>
                    >>
                    >>
                    >> So, if I take your example, the URL should look like
                    >>
                    >> http://url?query=string:foo <http://url?query=string:foo>
                    > <http://url/?query=string:foo <http://url/?query=string:foo>>
                    >>
                    >>
                    >>
                    >> Whereas, it looks like XHRDatasource will automagically give me the
                    URL
                    >>
                    >> http://url?query=foo <http://url?query=foo> <http://url/?query=foo
                    > <http://url/?query=foo>>
                    >>
                    >>
                    >>
                    >> with no option to modify the term. I realize this is a strange
                    request
                    >> as normally we would just append the term, but DWR doesn't work its
                    >> magic that way. Matter of fact, DWR wants the user to use the
                    DWREngine
                    >> object to perform the AJAX call so creating a URL is a workaround
                    >> because of the mismatch between the two tools.
                    >>
                    >>
                    >>
                    >> It would be better if I could assign a custom AJAX call to a
                    >> XHRDatasource object and assign the callback to that object. Since
                    this
                    >> is JS, I imagine I can reassign some properties in the AutoComplete
                    >> object to do this. Does anyone know which properties in the object
                    >> perform the call and are used for the callback? If this was the case,
                    >> then XHRDatasource could drive the custom function that performs the
                    >> AJAX call whenever an event occurs in the textbox that is providing
                    the
                    >> autocomplete. As it is, it looks like I have to use the AJAX
                    >> functionality built into the XHRDatasource. There are plenty of AJAX
                    >> frameworks around and I imagine this would make the AutoComplete
                    library
                    >> even more useful. As it is, I have to leave the AJAX calls up to the
                    >> XHRDatasource object.
                    >>
                    >>
                    >>
                    >> Thanks again for the suggestion,
                    >>
                    >> Dan
                    >>
                    >>
                    >>
                    >> ________________________________
                    >>
                    >> From: ydn-javascript@yahoogroups.com
                    > <mailto:ydn-javascript%40yahoogroups.com>
                    >> [mailto:ydn-javascript@yahoogroups.com
                    > <mailto:ydn-javascript%40yahoogroups.com>] On Behalf Of jennykhan
                    >> Sent: Wednesday, January 31, 2007 2:21 PM
                    >> To: ydn-javascript@yahoogroups.com
                    > <mailto:ydn-javascript%40yahoogroups.com>
                    >> Subject: [ydn-javascript] Re: DWR and Autocomplete
                    >>
                    >>
                    >>
                    >> Hi Dan,
                    >>
                    >> By setting the following value:
                    >>
                    >> myXHRDataSource.scriptQueryParam = "string";
                    >>
                    >> the URL sent will be
                    >>
                    >> http://url?string=foo <http://url?string=foo> <http://url?string=foo
                    > <http://url?string=foo>>
                    >>
                    >> Hope that helps,
                    >> Jenny
                    >>
                    >> --- In ydn-javascript@yahoogroups.com
                    > <mailto:ydn-javascript%40yahoogroups.com>
                    >> <mailto:ydn-javascript%40yahoogroups.com> , "cy_doyle" <dan.c.doyle@>
                    >> wrote:
                    >> >
                    >> > Has anyone integrated these together? I am looking at the
                    Autocomplete
                    >> > documentation and it looks like it is ideal to use the
                    XHRDataSource.
                    >> > However, it wants to send a URL like this: http://url?query=foo.
                    > <http://url?query=foo.>
                    >> <http://url?query=foo. <http://url?query=foo.>> This
                    >> > is not be compatible with DWR. I see in the documentation that I
                    can
                    >> > send other parameters with the query, but the problem is the term
                    >> > "foo" which represents a string a user has put in a textbox that
                    will
                    >> > be used to drive results from a datasource to populate the
                    >> > autocomplete drop down(phew, that was a mouthful). I looked at the
                    >> > request that DWR sends through its engine and the term that is sent
                    to
                    >> > DWR needs to be prefixed with "string:". Do I have to customize the
                    >> > yahoo library for autocomplete to append this? Is their a better
                    >> approach?
                    >> >
                    >> > Another approach is to build the YAHOO.widget.AutoComplete object
                    >> > after a call to DWR has been made. But it seems I loose the benefit
                    of
                    >> > some of the features in auto complete. For instance, I would have
                    to
                    >> > write code to detect when to retrieve a new query, whereas
                    >> > XHRDataSource will do this automatically.
                    >> >
                    >> > Thanks for any help,
                    >> > Dan
                    >> >
                    >>
                    >
                    >
                    > - -
                    > Scanned for viruses.



                    - -
                    Forward Computers Limited is a company registered in England and Wales
                    with company number 3249628, VAT Number 416458349. Registered office
                    address : Forward House, 161 Glaisdale Drive West, Nottingham, NG8 4GY

                    This email has been scanned for viruses by Messagelabs.



                    Yahoo! Groups Links
                  Your message has been successfully submitted and would be delivered to recipients shortly.