[CLOSED] 1.2.x to 1.5.1 Update - NumberFieldBase Input String in Wrong format + weird stracktrace path

Page 2 of 2 FirstFirst 12
  1. #11
    Does the CurrencyField class inherit from the NumberFieldBase one, right?

    The recommended approach is the following.

    1. If you don't need custom events, then please inherit from a "final" (without "Base" at the end) class. In your case, it's the NumberField class. All events should be inherited.

    2. If you do need custom events, you should inherit from a "base" class (with "Base" at the end) and define the Listeners and DirectEvents properties. Here is the example.
    http://forums.ext.net/showthread.php...ll=1#post78126
  2. #12
    Hi Daniil,

    Our currency field inherits from the final NumberField so as you say, I'd expect it to display the same events. Do you want me to attach the entire class so you could let me know if we're missing something critical?

    At the moment we've only overridden the bare minimum of properties/methods, I think we might have missed something somewhere!

    Cheers,

    Doug
  3. #13
    Yes, please let us to look at the full class sources.
  4. #14
    Hi Daniil, here's the source for the control, it's nothing more than this:

    CurrencyField.txt
  5. #15
    Thanks.

    It appears to be working for me - a Change listener defined in the Listeners is fired.

    I just used your class changing the Resources property to match my paths.

    My Resources property
    protected override List<ResourceItem> Resources
    {
        get
        {
            List<ResourceItem> opBaseList = base.Resources;
            opBaseList.Capacity += 1;
            ClientScriptItem js =
                new ClientScriptItem(
                    typeof(CurrencyField),
                    "Work.resources.js.Ext.ux.CurrencyField.js",
                    "/resources/js/Ext.ux.CurrencyField.js");
            opBaseList.Add(js);
            return opBaseList;
        }
    }
    Created the following JavaScript file.

    Ext.ux.CurrencyField.js
    Ext.ux.CurrencyField = Ext.extend(Ext.form.NumberField);
    Finally, used the custom control in this page.

    Example Page
    <%@ Page Language="C#" %>
     
    <%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>
    <%@ Register Assembly="Work" Namespace="Work" TagPrefix="cc" %>
    
    <!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" />
            <cc:CurrencyField runat="server">
                <Listeners>
                    <Change Handler="alert('Change');" />
                </Listeners>
            </cc:CurrencyField>
        </form>
    </body>
    </html>
    Could we look at your JavaScript Ext.ux.CurrencyField class?
  6. #16
    Hi Daniil,

    Certainly, one of our other devs took the JS code from a forum post on I believe one of the sencha threads.

    Ext.ux.CurrencyField.txt
  7. #17
    Thanks.

    It appears to be working fine for me with your class as well.

    Can you post the Page Sources where a Change listener is not working?
  8. #18
    Hi Daniil,

    As a sanity check I cleared my local caches, deleted my local versions of the files and re-acquired the files from source control and as you say, things do now seem to be working.

    Sorry for the hassle, I must have had some out of date kicking about on my client which I'd not realised.

    Thanks for all the help, please consider this one closed,

    Cheers,

    Doug
  9. #19
    No problem, glad to help!
Page 2 of 2 FirstFirst 12

Similar Threads

  1. [CLOSED] Wrong Date Format on the store
    By ViDom in forum 1.x Legacy Premium Help
    Replies: 2
    Last Post: Mar 25, 2011, 9:56 PM
  2. [CLOSED] Weird error since update from SVN
    By CarWise in forum 1.x Legacy Premium Help
    Replies: 1
    Last Post: Mar 18, 2011, 8:09 AM
  3. [CLOSED] String.format defined in ExtJS and in ASP.NET Ajax
    By jchau in forum 1.x Legacy Premium Help
    Replies: 9
    Last Post: May 14, 2010, 6:38 PM
  4. [CLOSED] Dynamic grid column format string and performance
    By jchau in forum 1.x Legacy Premium Help
    Replies: 6
    Last Post: Nov 16, 2009, 3:10 PM
  5. Replies: 3
    Last Post: Mar 17, 2009, 9:42 AM

Tags for this Thread

Posting Permissions