Ticket T747298
Visible to All Users
Duplicate

ASPxTextBox - Value is always null when text is pasted into the editor

created 6 years ago

[DevExpress Support Team: CLONED FROM T569907: ASPxMemo - How to determine when text is pasted using the context menu]
Unfortunately this doesn't work as expected, at least with an ASPxTextBox.
I'm using DevEx 18.2.x.

Attempting to get the value of the editor when text is pasted from a right click returns null.
(Assuming the editor was already empty when the text was pasted)

EG: in the example,  memo.GetValue() will return null even though the text has in fact pasted into the editor.
In my case I'm use an ASPxTextBox rather than a memo editor.

Show previous comments (1)

    Hello Paul,
    Thanks for the super fast response.

    I agree, your sample works, AND a test page in my own site works on a simple page.

    However it doesn't work on our production page which is much more complex.
    I am currently trying to isolate the issue and narrow it down so that I can provide a working example for you.

    The production page has a master page, callback panel, pagecontrol, tabcontrol with hidden tabs, and several form layouts in each tabpage, along with other editors and a couple of grids.  Ouch…

    Interestingly, the onpaste event does fire, and if I look at txFind.inputElement.value it does contain the text pasted.  However txFind.GetText() does NOT return the text that's pasted into the inputelement, UNLESS I have an alert popup before trying txFind.GetText().
    txFind is the clientinstance name of our ASPxTextbox.

    I realize you can't solve this without a working example.  I'll persevere for a few hours.  If I can't narrow it down, I'll readjust our thinking instead.

      Here's a working example.
      Based on your original sample but completely changed…

      The problem is evident when the ASPxTextbox being pasted into has the Nulltext property set.

      DevExpress Support Team 6 years ago

        Hello,
        Thank you for modifying our sample, I have successfully reproduced the issue.
        It appears that we need additional time to investigate it. We will get back to your as soon as we have any results.

        Answers approved by DevExpress Support

        created 6 years ago

        Hello,
        The issue occurs because when a text decoration (for example, a null text) is applied to an editor, a "decorated" text is inserted into an ASPxTextBox's input element.
        When an end-user changes the editor's value, the GetText will return a corresponding value only after synchronizing a new text of the input element with the editor's value.

        I have created a separate ticket on your behalf and we will consider the capability to improve the GetText method behavior in this scenario:
        ASPxTextBox - The client-side GetText method returns an empty value is a text decoration (for example, a null text) is applied to editor
        We will update the status of the mentioned ticket once we have any results.

        At present, we suggest using your current workaround with getting a new text directly from the ASPxTextBox's input element:

        JavaScript
        txFind.GetInputElement().value

        Do not hesitate to contact us if you have additional questions or need further assistance.

          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.