[FIXED] [#777] [3.2.0] Bug in ext:HyperlinkButton

  1. #1

    [FIXED] [#777] [3.2.0] Bug in ext:HyperlinkButton

    
    <%@ Page Language="C#" %>
    
    <!DOCTYPE html>
     
    <html>
    <head runat="server">
    
    </head>
    <body>
        <ext:ResourceManager runat="server" />
        <ext:Viewport ID="Viewport1" runat="server" Layout="fit">
            <Items>
                <ext:HyperlinkButton runat="server" Text="xxx"/>
            </Items>
        </ext:Viewport>
    </body>
    </html>
    Hello
    At the end I narrowed it down to the example above, in 3.1 throws js exception.
    (after changing layout to vbox, it works fine)

    Not a big issue, but maybe there is a way how to fix?

    Regards
    Zdenek
    Last edited by Daniil; Apr 03, 2015 at 2:07 PM. Reason: [FIXED] [3.2.0]
  2. #2
    Actually, maybe I misunderstand something, but similar issue with other controls:

    <%@ Page Language="C#" %>
    
    <!DOCTYPE html>
    
    <html>
    <head runat="server">
    
    </head>
    <body>
        <ext:ResourceManager runat="server" />
        <ext:Viewport ID="Viewport1" runat="server" >
            <LayoutConfig>
                <ext:HBoxLayoutConfig Align="Stretch"/>
            </LayoutConfig>
            <Items>
                <ext:ImageButton runat="server" Width="40" Height="40"/>
            </Items>
        </ext:Viewport>
    </body>
    </html>
    Last edited by Daniil; Apr 03, 2015 at 11:15 AM. Reason: Corrected [CODE] tags
  3. #3
    Hi @Zdenek,

    This override might be used.
    Ext.net.HyperlinkButton.override({
        onRender: function (ct, position) {
            this.callParent(arguments);
            this.btnWrap = this.el;
        }
    });
    Though, you won't get the text centralized on the screen. As far as I can see a HyperlinkButton doesn't quite support centralizing its text.

    You might want to use a CenterLayout.
    <ext:Viewport runat="server" Layout="CenterLayout">
        <Items>
            <ext:HyperlinkButton runat="server" Text="HyperlinkButton" />
        </Items>
    </ext:Viewport>
  4. #4
    Thanks
    Linkbutton problem fixed unfortunatelly the problem with ImageButton remain:
    <%@ Page Language="C#" %>
    
    <!DOCTYPE html>
     
    <html>
    <head runat="server">
    	<script>
    		Ext.net.HyperlinkButton.override({
    			onRender: function (ct, position) {
    				this.callParent(arguments);
    				this.btnWrap = this.el;
    			}
    		});
    
    		Ext.net.ImageButton.override({
    			onRender: function (ct, position) {
    				this.callParent(arguments);
    				this.btnWrap = this.el;
    			}
    		});
    
    		
    	</script>
    </head>
    <body>
        <ext:ResourceManager runat="server" />
    	<ext:Viewport ID="Viewport1" runat="server" >
    		<LayoutConfig>
    			<ext:HBoxLayoutConfig Align="Stretch"/>
    		</LayoutConfig>
    		<Items>
    			<ext:ImageButton runat="server"    ImageUrl="button.gif"  />
    		</Items>
    	</ext:Viewport>
    </body>
    </html>
    Let me know if new thread is necessary, from my perspective looks like similar issue?

    Thanks
    Zdenek
  5. #5
    Agree, the issues are similar, but HyperlinkButton and ImageButton are quite different internally. It would be nice if you start a new forum thread.
  6. #6
    Please try this override the HyperlinkButton:
    Ext.net.HyperlinkButton.override({
        privates: {
            wrapPrimaryEl: function (dom) {
                Ext.Component.prototype.wrapPrimaryEl.call(this, dom);
            }
        }
    });
  7. #7
    Ok works thanks a lot

    Will this fix become part of main branch?

    Zdenek
  8. #8
    Thank you for confirming!

    Fixed in the revision 6413 (trunk). It goes to 3.2.0.

Similar Threads

  1. Replies: 1
    Last Post: Mar 23, 2015, 1:25 PM
  2. Replies: 2
    Last Post: Mar 20, 2015, 12:45 PM

Posting Permissions