Bug Report T313017
Visible to All Users

ASPxButton - The "Unable to set property 'value' of undefined or null reference" error occurs when calling the client-side SetText method if the UseSubmitBehavior and AllowFocus properties are set to false

created 9 years ago (modified 9 years ago)

A change in the javascript from 15.1.7 to 15.1.8 is causing a javascript error to be generated.
   My javascript debugger is saying the value being returned by  this.GetInternalButton() is null.

ASPxClientButton SetText method for 15.1.7 is:

JavaScript
function (text){ this.isTextEmpty = (text == null || text == ""); var textContainer = this.GetTextContainer(); if(textContainer){ if(this.isNative) textContainer.value = (text != null) ? text : ""; else { textContainer.innerHTML = this.isTextEmpty ? " " : text; if(this.clientVisible && ASPx.Browser.IE && ASPx.Browser.Version >= 9) ASPx.SetElementDisplay(this.GetMainElement(), true); } this.UpdateSize(); } }

ASPxClientButton SetText method for 15.1.8 is:

JavaScript
function (text){ this.isTextEmpty = (text == null || text == ""); var textContainer = this.GetTextContainer(); if(textContainer){ if(this.isNative) textContainer.value = (text != null) ? text : ""; else { var value = this.isTextEmpty ? " " : text; textContainer.innerHTML = value; this.GetInternalButton().value = value; if(this.clientVisible && ASPx.Browser.IE && ASPx.Browser.Version >= 9) ASPx.SetElementDisplay(this.GetMainElement(), true); } this.UpdateSize(); } }

The aspx for the button is:

ASPx
<dx:ASPxButton ID="btContact" runat="server" ClientInstanceName="btContact" AutoPostBack="False" CausesValidation="False" EnableClientSideAPI="True" UseSubmitBehavior="False" AllowFocus="False" Text="Contact Details" CssClass="Button100" CssPostfix="None" EnableTheming="false"> <Paddings Padding="0px" /> <Border BorderStyle="None" BorderWidth="0px" /> </dx:ASPxButton>

I am going to override the 15.1.8 javascript with 15.1.7 javascript as I need to be able to change the button text at the client side.

Comments (1)
Lanette (DevExpress Support) 9 years ago

    Hello,

    I was able to reproduce the issue on my side. We need some additional time to investigate the cause of this issue. We will update this thread once we have results to report.

    Answers approved by DevExpress Support

    created 9 years ago

    We have fixed the issue described in this ticket and will include the fix in our next maintenance update. To apply this solution before the official update, request a hotfix by clicking the corresponding link for product versions you require.

    Note: Hotfixes may be unavailable for beta versions and updates that are about to be released.

      Disclaimer: The information provided on DevExpress.com and affiliated web properties (including the DevExpress Support Center) is provided "as is" without warranty of any kind. Developer Express Inc disclaims all warranties, either express or implied, including the warranties of merchantability and fitness for a particular purpose. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.

      Confidential Information: Developer Express Inc does not wish to receive, will not act to procure, nor will it solicit, confidential or proprietary materials and information from you through the DevExpress Support Center or its web properties. Any and all materials or information divulged during chats, email communications, online discussions, Support Center tickets, or made available to Developer Express Inc in any manner will be deemed NOT to be confidential by Developer Express Inc. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.