Ticket Q538301
Visible to All Users

How to clear dxTextBox

created 11 years ago

Hi,

We enclosed a zip folders named "TestLogout.zip ".

TestLogout folder contains "Application" and "Screenshots" folder.

Application contains code which will be used to reproduce our said problem.

Please view screeshots in order of 1,2,3.

Steps to be followed:-

  1. Login using email:x and Pwd:123 - refer (1) screenshot
  2. After login successful, you can view "start page- refer (2) screenshot.
  3. While clicking logout button in start page, it is going back to login page - refer(3) screenshot.

Now you can see old entered values in the textboxes again.

How to clear email and pwd textboxes when click on logout button. In otherwords how to refresh the page?

Please give the solution at earliest.

Best Regards
Amit Mondal.

Comments (1)

    Hi,
    Looking forward your quick reply for above problem.
    Best Regards
    Amit Mondal.

    Answers approved by DevExpress Support

    created 11 years ago (modified 11 years ago)

    Hi Amit,
    You can clear the dxTextBox value in the viewShown event handler. So, your code should be as follows:

    JavaScript
    TestLogOut.Login = function (params) { var viewModel = { // Put the binding properties here getValue: function () { var email = $("#txtemail").dxTextBox('option', 'value'); var pwd = $("#txtpwd").dxTextBox('option', 'value'); if (email == 'x' && pwd == '123') { TestLogOut.app.navigate('StartPage', { root: true }); } }, viewShown: function (e) { $("#txtemail").dxTextBox('instance').option('value', ''); $("#txtpwd").dxTextBox('instance').option('value', ''); } }; return viewModel; };

    Alternatively, disable a view cache by setting the HtmlApplication.disableViewCache option to true as shown below:

    JavaScript
    TestLogOut.app = new DevExpress.framework.html.HtmlApplication({ namespace: TestLogOut, defaultLayout: TestLogOut.config.defaultLayout, navigation: TestLogOut.config.navigation, disableViewCache: true });
      Comments (2)

        Hi Nikolai,
        Great, your solution solved our problem.
        Thanks for your valuable support and cooperation to our concerns.
        //Amit Mondal

        DevExpress Support Team 11 years ago

          Amit,
          I am glad to hear that the issue has been solved. If you have any other questions, feel free to ask.

          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.