Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
1960
Additional information inside the InitializeDataSource event handler
posted

I have my webcombo configured to ComboTypeAhead = Suggest and EnaleXmlHttp = true

Inside the InitializeDataSource event handler I use the WebCombo.DisplayValue property to create the new DataSet, using a select similar to "SELECT top 10 WHERE [ColumnName1] like [WebCombo.DisplayValue]% AND [ColumnName2] = [ContextualDataValue]"

The problem is that the value of ContextualDataValue should come from the client too. Since this is an AJAX call I have no access to any information or object besides the WebCombo being passed in the event handler.

Is there a way to send more information to the server on the AJAX call that triggers the InitializeDataSource event?

Maybe there's a way to hide or append that contextual information to the WebCombo on the client side before the AJAX call takes place?

I think this is a very common scenario. Maybe the WebCombo should have a client side property "Context" and the equivalent server side property so there's more information available to the programmer when the InitializeDataSource event fires.

 

Parents
No Data
Reply
  • 28464
    posted

     Hello Oscar,

    Thanks for writing. This does not appear easy, and while I will investigate this in detail and hopefully write later, I have something that can get you started. I am looking at our Samples application, and the AJAX -> WebCombo Advanced Ajax example in particular and here is what I see in the source: 

    http://samples.infragistics.com/2008.2/webfeaturebrowser/srcview.aspx?path=WebGrid/AjaxImplementation/TypeAheadCombo.src&file=TypeAheadCombo.aspx&font=3 

        if(search!="" &&search.length==5){
    timestamp=new Date().getTime();
    oWebCombo1.getGrid().Bands[0].Columns[0].setFooterText("Loading ...");
    xmlReq.open("GET","TypeAheadCombo.aspx?rows=true&searchString="+search,true);
    //Send request.
                     xmlReq.send(null);

     I am still trying to put the pieces together since there is a lot of custom code, but I guess if you are able to get to this way, you will be able to append one addtional string to the GET request, that will later be available on the server in the Page.Request collection of server variables.

    Hope this helps. 

Children