[CLOSED] possible reason for this behavior?

  1. #1

    [CLOSED] possible reason for this behavior?

    I have a form with a Add button and Textbox1.
    There are 2 things i am trying to do on this form

    1. When I click add button, through direct method Textbox1 is cleared.
    Textbox1.setValue('');
    2. I have another method to populate Textbox1.
    so the code is:

    Populate -directmethod
     btnAdd.setDisabled(true)
    what it is happening is,
    when btnAdd.setDisabled(true), Textbox1.setValue('') also gets fired which i don't understand. I didn't posted any sample code, because it works normal on my local machine, it doesn't work on production server.

    Please advice you can see the potential cause of this issue. Thank you.
    Last edited by geoffrey.mcgill; Dec 01, 2010 at 4:24 PM. Reason: [CLOSED], please use [CODE] tags
  2. #2
    Hi,

    Please clarify what do you mean "direct method"? Just I see JavaScript code in samples that you posted.
  3. #3
    In your Page_Load event, are you setting the .Text property of the Field? If yes, please ensure it is wrapped in the following:

    Example

    if (!X.IsAjaxRequest) 
    { 
        ...
    }
    Geoffrey McGill
    Founder
  4. #4
    Thanks for the replies. I think i wasn't digonose the problem right and not asking the right question.
    Please bear with me. let me try again.

    Basically in Rowselect, i am calling 2 javascript functions and each funtion has a directmethod in it.

    The order I am calling the function is
    reset() and then populate().

    But sometimes not all the time. reset() gets executed after populate(). so everything gets reset after it is populated.
    am i doing something wrong here? is there way I can fix this? Thanks you so much for your help.

     
    var reset = function()
    {
     
    Ext.net.DirectMethods.Reset(
    {
    success: function (servicetype) {
     
    try
    {
    }
    ....
    ...
    }
    ....
     
    var populate = function()
    {
     
    Ext.net.DirectMethods.Reset(
    {
    success: function (servicetype) {
     
    try
    {
    }
    ....
    ...
    }
    ....
  5. #5
    Hi,

    DirectMethod doesn't stop JavaScript execution, in other words - asynchronous. It means that both requests are sent one after another.

    Please place the second DirectMethod in the success Handler of the first one.
    Last edited by Daniil; Dec 01, 2010 at 4:29 PM. Reason: Minor correction
  6. #6
    I see. Thank you So much!!!

Similar Threads

  1. [CLOSED] Behavior javascript
    By rnfigueira in forum 1.x Legacy Premium Help
    Replies: 4
    Last Post: Aug 18, 2011, 2:43 PM
  2. [1.0]Smaller font for no reason, strange
    By zgzxsoft in forum 1.x Help
    Replies: 2
    Last Post: Oct 12, 2010, 2:57 AM
  3. DateField behavior
    By Krisller in forum 1.x Help
    Replies: 1
    Last Post: Aug 23, 2010, 11:09 PM
  4. Replies: 4
    Last Post: Apr 09, 2010, 1:07 PM
  5. Replies: 0
    Last Post: Jun 08, 2009, 10:51 AM

Posting Permissions