[OPEN] [4.7.1] [#1621] setNote JS function broken

  1. #1

    [OPEN] [4.7.1] [#1621] setNote JS function broken

    Support,

    see simple example. before alert fires. after alert does not since we have JS error in ext.

    thanks,
    /Z.

    <%@ Language="C#"  %>
    
    
    
    
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" 
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
    
    
    <html lang="en" xmlns="http://www.w3.org/1999/xhtml">
    <head runat="server">
        <title>Test</title>
    
    
    </head>
    
    
    <ext:ResourcePlaceHolder ID="ResourcePlaceHolder1" runat="server" />
    
    
    <body>
        <form runat="server" onsubmit="return false;">
            <ext:ResourceManager ID="ResourceManager1" runat="server" Theme="Neptune">
                <Listeners>
                    <DocumentReady Handler="alert('before');App.test.setNote('test');alert('after');" />
                </Listeners>
            </ext:ResourceManager>
    
    
            <ext:Viewport ID="ViewPortMain" runat="server" Layout="BorderLayout">
                <Items>
    
    
    
    
                    <ext:DateField ID="test" runat="server" Text="blah" />
    
    
                </Items>
            </ext:Viewport>
    
    
        </form>
    </body>
    </html>
  2. #2
    Hello @Z!

    Thanks for raising this up! The method is really broken. It should be instantiating the note's DOM elements when called to a field without an initially set note.

    We've created github issue #1621 to track & fix this defect; we'll post back here when we have it fixed.

    As a quick way to fix this, what you can do is, make a blank field note at define time (add Note="&nbsp;" for instance, to the field), so that when the method is called, it does work.

    Notice that setting a field note with any text would allocate space for the field, so you should notice extra padding below the field; this may be undesirable, but it allows the whole form not to "jump around" when a note is set/changed to a field. Hiding the note (App.test.hideNote()) doesn't wipe the allocated space below the field.

    In case the extra allocated space is not wanted, you can set the note with just a whitespace (Note=" "). This won't allocate the space, but setting the note may overlap with content right below the field note, so you should test which approach works best for you.

    This issue has already been raised in the past, but I believe it would deserve being logged as an improvement now, as it has affected more people in the past. Here's one thread covering the subject: Error setting Checkbox Note property.

    Hope this helps!
    Fabrício Murta
    Developer & Support Expert

Similar Threads

  1. Replies: 5
    Last Post: Aug 07, 2018, 7:41 PM
  2. Replies: 6
    Last Post: Oct 26, 2016, 7:45 PM
  3. Replies: 3
    Last Post: Apr 15, 2016, 11:28 AM
  4. Replies: 19
    Last Post: Jun 23, 2015, 1:07 PM
  5. Replies: 1
    Last Post: Feb 20, 2015, 6:05 PM

Posting Permissions