AjaxProxy ExtraParams doesn't work

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1

    AjaxProxy ExtraParams doesn't work

    I have a combobox which fills it's data through an ASMX Web Service and I would like to pass an Extra Param (the country) in order to show only that country's cities. Country name must come from another Ext.NET control, a Cycle button's text. But the page cannot even load because it says it can't find the cycle button control. Following are the CycleButton's, the ComboBox's and the Web service's code.
    <ext:CycleButton MinWidth="197" Width="197" ID="MyCycleButton" runat="server" ShowText="true">
                                            <Menu>
                                                <ext:Menu runat="server" MaxHeight="200">
                                                    <Items>
                                                    </Items>
                                                </ext:Menu>
                                            </Menu>
                                            <Listeners>
                                                <Click Handler="MyApp.sampleFunction(this,e)" />
                                            </Listeners>
                                        </ext:CycleButton>
    <ext:ComboBox
                                            ID="ComboBoxCitySelection"
                                            runat="server"
                                            AllowBlank="false"
                                            DisplayField="CityName"
                                            ValueField="CityName"
                                            TypeAhead="false"
                                            Hidden="true"
                                            LabelCls="x-form-item-label"
                                            AutoFocus="true"
                                            PageSize="5"
                                            HideBaseTrigger="true"
                                            MinChars="0"
                                            LabelStyle="margin-left: 85px;"
                                            TriggerAction="Query">
                                            <ListConfig LoadingText="Searching...">
                                                <ItemTpl runat="server">
                                                    <Html>
                                                        <div style="font-weight: normal;">
    							                                        <span>{CityName}</span>
                                                                        </div>
                                                    </Html>
                                                </ItemTpl>
                                            </ListConfig>
                                            <Store>
                                                <ext:Store ID="StoreSearchCities" runat="server" AutoLoad="false" PageSize="5" RemoteFilter="true">
                                                    <Proxy>
                                                        <ext:AjaxProxy Url="../../Services/UserService.asmx/GetCountryCities" " FilterParam="CityName">
                                                            <ActionMethods Read="POST" />
                                                            <Reader>
                                                                <ext:JsonReader Root="data" />
                                                            </Reader>
                                                            <ExtraParams>
                                                                <ext:Parameter Name="Country" Value="#{MyCycleButton}.getText()" Mode="Raw" />
                                                            </ExtraParams>
                                                        </ext:AjaxProxy>
                                                    </Proxy>
                                                    <Model>
                                                        <ext:Model runat="server" IDProperty="CityName" AutoDataBind="true">
                                                            <Fields>
                                                                <ext:ModelField Name="CityName" />
                                                            </Fields>
                                                        </ext:Model>
                                                    </Model>
                                                </ext:Store>
                                            </Store>
                                        </ext:ComboBox>
    [WebMethod(EnableSession = true)]
            public void GetCountryCities(string country)
            {
                HttpContext.Current.Response.ContentType = "application/json";
                var requestParams = new StoreRequestParameters(HttpContext.Current);
                int start = requestParams.Start;
                int limit = requestParams.Limit;
                string filter = !string.IsNullOrEmpty(requestParams.Query) ? requestParams.Query : "";
                if (filter == "*")
                    filter = "";
                Paging<City> resultCities = UserDataAccess.GetCountryCities(start, limit, filter, country);
                HttpContext.Current.Response.Write(JSON.Serialize(resultCities));
            }
    When I use the following Extra Params the ASMX country paramater is filled correctly, but I just want to be dynamic..
    This works:
    <ExtraParams>
              <ext:Parameter Name="Country" Value="Greece" Mode="Value" />
     </ExtraParams>
    So the question is, how i can pass every time the CycleButton's text as an extra parameter to my ASMX service?

    Kind regards,
    C.S
  2. #2

Similar Threads

  1. [CLOSED] RemoteValidation with ExtraParams not work
    By trePjt in forum 2.x Legacy Premium Help
    Replies: 2
    Last Post: Apr 03, 2014, 1:26 AM
  2. [CLOSED] DirectMethod doesn't work
    By Geenin in forum 2.x Legacy Premium Help
    Replies: 4
    Last Post: Jan 16, 2014, 6:42 AM
  3. Project Ext.Net.UX doesn't work.
    By flaviodamaia in forum 2.x Help
    Replies: 6
    Last Post: Nov 01, 2012, 1:41 PM
  4. [1.0RC]MultiHeader doesn't work.
    By firebank in forum 1.x Help
    Replies: 1
    Last Post: Nov 11, 2010, 4:06 PM
  5. Keymap doesn't work
    By Kamal in forum 1.x Help
    Replies: 2
    Last Post: Aug 13, 2009, 10:49 AM

Posting Permissions