[CLOSED] RemoteValidation ExtraParams are ignored

  1. #1

    [CLOSED] RemoteValidation ExtraParams are ignored

    Looking at the HTTP trace, I see that the extra params aren't included in the request at all:
    submitDirectEventConfig={"config":{"serviceParams":"{\"id\":\"Registration\",\"value\":510}"}}
    &__EVENTTARGET=ResourceManager1
    &__EVENTARGUMENT=Registration|postback|remotevalidation
    &Registration_Value=510
    &Registration=Euronext
    &Registration_SelIndex=9
    Here's the form markup:
        <form id="form1" runat="server">
        <ext:ResourceManager ID="ResourceManager1" runat="server">
        </ext:ResourceManager>
    <ext:Store runat="server" ID="StoreRegistration">
      <Reader>
        <ext:JsonReader>
          <Fields>
            <ext:RecordField Name="RegistrationId" Type="Int" />
            <ext:RecordField Name="RegistrationName" />
          </Fields>
        </ext:JsonReader>
      </Reader>
    </ext:Store>
    <ext:FormPanel ID="FormPanel1" 
                runat="server" 
                Title="Remote Validation Form" 
                Padding="5"
                Frame="true"
                LabelWidth="250"
                Width="500"             
                DefaultAnchor="-20">
                <Items>
                                <ext:ComboBox runat="server" ID="Registration" DataIndex="RegistrationId" FieldLabel="Registration name" StoreID="StoreRegistration"
                  ValueField="RegistrationId" DisplayField="RegistrationName" Editable="false" AllowBlank="false" IsRemoteValidation="true">
                        <Listeners>
                          <Select Handler="this.remoteValidate();"/>
                          <AfterRender Handler="this.rvConfig.remoteValidated = true;this.rvConfig.remoteValid = true;" />
                        </Listeners>
                          <RemoteValidation OnValidation="CheckDuplicateRegistration">
                              <ExtraParams>
                                <ext:Parameter Name="PersonRegId" Value="400" />
                                <ext:Parameter Name="PersonId" Value="4164" />
                              </ExtraParams>
                          </RemoteValidation>
                </ext:ComboBox>
         </ext:FormPanel>
    </form>
    And the code for the event handler:
            protected void CheckDuplicateRegistration(object sender, RemoteValidationEventArgs e)
            {
                if (e.Value != null)
                {
                    if (e.ExtraParams.Count > 0)
                    {
    .
    .
    .
    .
                    }
                }
           }
    I can see from the page source that the extraparams are included in the combo's config:
    {
       id:"Registration",
       xtype:"combo",
       fieldLabel:"Registration name",
       dataIndex:"RegistrationId",
       isRemoteValidation:true,
       remoteValidationOptions:{
          extraParams:{
             "PersonRegId":"400",
             "PersonId":"4164"
          }
       },
       allowBlank:false,
       editable:false,
       displayField:"RegistrationName",
       hiddenName:"Registration_Value",
       triggerAction:"all",
       valueField:"RegistrationId",
       store:StoreRegistration,
       submitValue:true,
       listeners:{
          select:{
             fn:function(item,
             record,
             index)         {
                this.remoteValidate();
             }
          }
       }
    }
    But for some strange reason they don't get included in the request.

    Is this a bug or am I missing something?
    Last edited by Daniil; Mar 11, 2011 at 3:44 PM. Reason: [CLOSED]
  2. #2
    Hi,

    I have tried to reproduce the issue using the code you provided with no success, the extraParams are passed.

    I used the following code:

    Example
    <%@ Page Language="C#" %>
    
    <%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>
    
    <script runat="server">
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!X.IsAjaxRequest)
            {
                Store store = this.ComboBox1.GetStore();
                store.DataSource = new object[] 
                { 
                    new object[] { 1, "item1" },
                    new object[] { 2, "item2" },
                    new object[] { 3, "item3" }
                };
                store.DataBind();
            }
        }
    
        protected void CheckDuplicateRegistration(object sender, RemoteValidationEventArgs e)
        {
            e.ErrorMessage = "No ExtraParams";
            if (e.Value != null)
            {
                if (e.ExtraParams.Count > 0)
                {
                    X.Msg.Alert("ExtraParams", e.ExtraParams.Count).Show();
                    e.Success = true;
                }
            }
        }
    </script>
    
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head runat="server">
        <title>Ext.Net Example</title>
    </head>
    <body>
        <form runat="server">
        <ext:ResourceManager runat="server" />
        <ext:FormPanel runat="server" Title="Remote Validation Form">
            <Items>
                <ext:ComboBox 
                    runat="server" 
                    ID="ComboBox1" 
                    FieldLabel="Registration name"
                    ValueField="RegistrationId" 
                    DisplayField="RegistrationName"
                    Editable="false" 
                    IsRemoteValidation="true">
                    <Store>
                        <ext:Store runat="server">
                            <Reader>
                                <ext:ArrayReader>
                                    <Fields>
                                        <ext:RecordField Name="RegistrationId" Type="Int" />
                                        <ext:RecordField Name="RegistrationName" />
                                    </Fields>
                                </ext:ArrayReader>
                            </Reader>
                        </ext:Store>
                    </Store>
                    <Listeners>
                        <Select Handler="this.remoteValidate();" />
                        <AfterRender Handler="this.rvConfig.remoteValidated = true;
                                              this.rvConfig.remoteValid = true;" />
                    </Listeners>
                    <RemoteValidation OnValidation="CheckDuplicateRegistration">
                        <ExtraParams>
                            <ext:Parameter Name="PersonRegId" Value="400" />
                            <ext:Parameter Name="PersonId" Value="4164" />
                        </ExtraParams>
                    </RemoteValidation>
                </ext:ComboBox>
            </Items>
        </ext:FormPanel>
        </form>
    </body>
    </html>
  3. #3
    I used your code and modified it to use code-behind and it still doesn't work.
    Can you try it with the attached VS2008 project?

    Btw, my version of the Ext.Net assembly is 1.0.3960.36328 according to the reference properties
    Attached Files
    Last edited by daneel; Mar 11, 2011 at 2:44 PM. Reason: Added more info
  4. #4
    Yes, it works fine with the latest code, but doesn't work with RC1.

    There are two options:

    1. Updating from the SVN
    2. Waiting RC1. It should come soon.
  5. #5
    Quote Originally Posted by Daniil View Post
    Yes, it works fine with the latest code, but doesn't work with RC1.

    There are two options:

    1. Updating from the SVN
    2. Waiting RC1. It should come soon.
    Okay, not a problem, I've worked around the issue by saving the parameter values (they're only set once) in Viewstate and then reading from that in the remote validation method.

    Thanks

Similar Threads

  1. Replies: 6
    Last Post: Aug 01, 2011, 4:53 PM
  2. [1.1] RemoteValidation
    By Timothy in forum 1.x Legacy Premium Help
    Replies: 1
    Last Post: Jul 12, 2011, 7:44 AM
  3. RemoteValidation ?
    By nanlinfeixue in forum 1.x Help
    Replies: 0
    Last Post: Jun 20, 2011, 10:49 AM
  4. [CLOSED] [1.0] RemoteValidation Question
    By Timothy in forum 1.x Legacy Premium Help
    Replies: 1
    Last Post: Dec 25, 2010, 4:13 PM
  5. [CLOSED] [1.0] RemoteValidation
    By Timothy in forum 1.x Legacy Premium Help
    Replies: 25
    Last Post: Dec 25, 2010, 1:07 PM

Tags for this Thread

Posting Permissions