Problem with Parameter in Mode Raw in RemoteValidation

  1. #1

    Problem with Parameter in Mode Raw in RemoteValidation

    Hi,
    the following example causes a JS error evaluating the epressione Value="#{txtTag}.text"
    It only works if I use parameters in Mode=Value.
    I'm doing something wrong or is it a bug?


    <ext:TextField ID="txtNumero_Civ_NewItem" runat="server" Width="120" IsRemoteValidation="true" AllowBlank="false" ValidateOnBlur="false" ValidateOnChange="false" IndicatorIcon="BulletRed" IndicatorTip="It is required field">
                <RemoteValidation OnValidation="checkField_txtNumero_Civ_NewItem_DirectEvent">
                <ExtraParams>
                    <ext:Parameter Name="TAG" Value="#{txtTag}.text" Mode="Raw" />
                </ExtraParams>
          </RemoteValidation>
          <Listeners>
               <RemoteValidationValid Handler="this.setIndicatorIconCls('icon-tick');" />
               <RemoteValidationInvalid Handler="this.setIndicatorIconCls('icon-bulletcross');" />
               <Change Handler="if (newValue == '') {this.setIndicatorIconCls('icon-bulletred'); this.reset()}" />
          </Listeners>
          <DirectEvents>
               <Blur OnEvent="calculateGeolocalizationCoordinateCivico_DirectEvent" />
          </DirectEvents>
    </ext:TextField>

    protected void checkField_txtNumero_Civ_NewItem_DirectEvent(object sender, RemoteValidationEventArgs e)
    {
      TextField field = (TextField)sender;
    
       string sTAG = e.ExtraParams["TAG"]; 
    
      ...
    
      e.Success = True;
    
      ...
    }

    Tks
    Last edited by ADV; Dec 24, 2013 at 2:16 AM.
  2. #2
    Hi @ADV,

    What is "txtTag"? I don't see it in the code snippet.

    I have some guesses, but a full test case to reproduce is appreciated.
  3. #3
    Hi Daniil,
    sorry for the delay but I was on vacation, fortunately a long vacation. :-)


    I simplified the code.
    The following example causes a JS error evaluating the epressione Value="#{txtNumero_Civ_NewItem}.tag"
    It only works if I use parameters in Mode=Value and Value="111111".
    I'm doing something wrong or is it a bug?


    <ext:TextField ID="txtNumero_Civ_NewItem" runat="server" Width="120" IsRemoteValidation="true" AllowBlank="false" ValidateOnBlur="false" ValidateOnChange="false" IndicatorIcon="BulletRed" IndicatorTip="It is required field">
                <RemoteValidation OnValidation="checkField_txtNumero_Civ_NewItem_DirectEvent">
                <ExtraParams>
                    <ext:Parameter Name="TAG" Value="#{txtNumero_Civ_NewItem}.tag" Mode="Raw" />
                </ExtraParams>
          </RemoteValidation>
    </ext:TextField>

    protected void checkField_txtNumero_Civ_NewItem_DirectEvent(object sender, RemoteValidationEventArgs e)
    {
      TextField field = (TextField)sender;
     
       string sTAG = e.ExtraParams["TAG"]; 
    
      e.Success = True;
    }

    protected void Page_Load(object sender, EventArgs e)
            {
                if (!X.IsAjaxRequest)
                {
    			txtNumero_Civ_NewItem.Tag = "Test";
                }
            }

    Thanks
  4. #4
    Please use:
    <RemoteValidation OnValidation="..." Before="extraParams.tag = this.tag;">
  5. #5
    Daniil, it works perfectly.

    I had never passed ExtraParameters with this syntax.

    Thank you very much
  6. #6
    Just to clarify. This
    <ExtraParams>
        <ext:Parameter Name="TAG" Value="#{txtNumero_Civ_NewItem}.tag" Mode="Raw" />
    </ExtraParams>
    is not working, because a RemoteValidation's ExtraParams section is executed even before its owner field is rendered. So, there is "#{txtNumero_Civ_NewItem}" client side reference yet.
  7. #7
    I have understood , now the reason is clarified.

    Thanks for the help

Similar Threads

  1. parameter passing problem
    By idelacruz in forum 2.x Help
    Replies: 0
    Last Post: Aug 24, 2013, 5:19 AM
  2. [CLOSED] Parameter Problem in Ext.Net
    By vijay.sahu in forum 2.x Legacy Premium Help
    Replies: 6
    Last Post: Apr 05, 2013, 10:27 AM
  3. MVC 4 razor syntax and remotevalidation problem
    By ITReppert in forum 2.x Help
    Replies: 7
    Last Post: Sep 10, 2012, 3:05 PM
  4. Problem with mode in extraparameters data
    By feanor91 in forum 1.x Help
    Replies: 1
    Last Post: Dec 22, 2011, 7:32 AM
  5. Replies: 6
    Last Post: Aug 01, 2011, 4:53 PM

Tags for this Thread

Posting Permissions