logo
down
shadow

button content and wait cursor problems


button content and wait cursor problems

By : user2949954
Date : November 17 2020, 04:28 AM
I wish did fix the issue. Your code runs on the UI thread by default, so nothing else can be executed on the UI thread (such as re-rendering the UI) until the thread finishes executing.
There are many ways of releasing control of the UI thread before the code finishes executing, but I find the simplest is to use a Task from the Task Parallel Library which can be used to run code on a separate thread.
code :
// this runs on the main UI thread
this.Cursor = Cursors.Wait;
this.btnClose.Content = "Cancel";

Task.Factory.StartNew(() =>
{
    // this code runs on a background thread

    // some long time consuming processing
})
.ContinueWith((e) =>
{
    // this code runs from the UI thread again
    this.Cursor = Cursors.Arrow;
    this.btnClose.Content = "Close";
});


Share : facebook icon twitter icon
Resetting wait cursor in browser with Content-Disposition:attachment

Resetting wait cursor in browser with Content-Disposition:attachment


By : Lorena Benitez
Date : March 29 2020, 07:55 AM
I wish did fix the issue. The problem seems to be that the EndRequest function is not being fired. Have you tried to see if the pageLoading and the pageLoaded events are firing?
I have a feeling these events are not firing because there is nothing sent back to the page (the attachment doesn't reach the page the same way an inline document does).
code :
function InitializeRequest(sender, args) {
    document.body.style.cursor = 'progress';

    var iframe = document.createElement("iframe");
    iframe.src = 'your pdf file';
    iframe.style.display = "none";
    document.body.appendChild(iframe); 
}
MVVM Wait Cursor how to set the.wait cursor during invocation of a command?

MVVM Wait Cursor how to set the.wait cursor during invocation of a command?


By : Md johirul Islam
Date : March 29 2020, 07:55 AM
this will help Scenario: User clicks a button on the View This invokes a command on the ViewModel, DoProcessing How, and where does the Wait cursor get set, considering the responsibilitues of View and ViewModel? , I am using it successfully in my application:
code :
/// <summary>
///   Contains helper methods for UI, so far just one for showing a waitcursor
/// </summary>
public static class UIServices
{
    /// <summary>
    ///   A value indicating whether the UI is currently busy
    /// </summary>
    private static bool IsBusy;

    /// <summary>
    /// Sets the busystate as busy.
    /// </summary>
    public static void SetBusyState()
    {
        SetBusyState(true);
    }

    /// <summary>
    /// Sets the busystate to busy or not busy.
    /// </summary>
    /// <param name="busy">if set to <c>true</c> the application is now busy.</param>
    private static void SetBusyState(bool busy)
    {
        if (busy != IsBusy)
        {
            IsBusy = busy;
            Mouse.OverrideCursor = busy ? Cursors.Wait : null;

            if (IsBusy)
            {
                new DispatcherTimer(TimeSpan.FromSeconds(0), DispatcherPriority.ApplicationIdle, dispatcherTimer_Tick, System.Windows.Application.Current.Dispatcher);
            }
        }
    }

    /// <summary>
    /// Handles the Tick event of the dispatcherTimer control.
    /// </summary>
    /// <param name="sender">The source of the event.</param>
    /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param>
    private static void dispatcherTimer_Tick(object sender, EventArgs e)
    {
        var dispatcherTimer = sender as DispatcherTimer;
        if (dispatcherTimer != null)
        {
            SetBusyState(false);
            dispatcherTimer.Stop();
        }
    }
}
...
UIServices.SetBusyState();
DoProcessing();
...
disable button or cursor wait icon while button click function runs

disable button or cursor wait icon while button click function runs


By : thecury
Date : March 29 2020, 07:55 AM
this one helps. Option 1: Disable the button
Define a javascript function, as follows. You have to return true or you server event will not fire:
code :
function disabledMe(btn) {
    btn.disabled = "disabled";
    return true;
}
<asp:Button ID="btnDoSomething" runat="server" Text="TEST run SSIS" 
   OnClientClick="disabledMe(this);"
   OnClick="btnDoSomething_Click" />
<div id="overlay" class="overlay"></div>
<style type="text/css">
    .overlay {
        background-color: #000;
        cursor: wait;
        display: none;
        height: 100%;
        left: 0;
        opacity: 0.4;
        position: fixed;
        top: 0;
        width: 100%;
        z-index: 9999998;
    }
</style>
<script>
    function showOverlay() {
        document.getElementById("overlay").style.display = "block";     
    }

    function hideOverlay() {
        document.getElementById("overlay").style.display = "none";
    }
</script>
<asp:Button ID="btnDoAnythingElse" runat="server"
            Text="TEST run SSIS" OnClientClick="showOverlay();"
            OnClick="btnDoAnythingElse_Click" />
protected void btnDoAnythingElse_Click(object sender, EventArgs e)
{
    Thread.Sleep(2000); // simulates a long running process
    ClientScript.RegisterStartupScript(this.GetType(), "hideOverlay", "hideOverlay();", true);
}
SVG change cursor from `cursor:wait` into e.g. `cursor:help` after hovering n seconds (loading time for tooltip) without

SVG change cursor from `cursor:wait` into e.g. `cursor:help` after hovering n seconds (loading time for tooltip) without


By : user1373709
Date : March 29 2020, 07:55 AM
With these it helps There has been a question about changing the cursor using before on this site, but it asked for a solution using Javascript, and it wasn't specific about when to trigger the action to change the cursor. , Here is a trick using transition and a hidden element.
UPDATE
code :
.hide {
  transition:1s visibility 1s;
  cursor:wait;
}
.hide:hover {
  visibility:hidden;
}

#MOUSE_OVER_THESE {
    cursor:help;
}
#MOUSE_OVER_THESE:hover + .hide {
  display:none;
}
<svg id="SVG"
  version="1.1"
  xmlns="http://www.w3.org/2000/svg"
  xmlns:xlink="http://www.w3.org/1999/xlink"
  width="250"
  height="175"
  viewBox="0 0 250 175">

<text font-size="10" x="10" y="20">
<tspan
  x="10" dy="0">Hover over the objects below. Can the cursor</tspan><tspan
  x="10" dy="12">change from "cursor:wait" into e.g. "cursor:help"</tspan><tspan
  x="10" dy="12.5">after about 1 second, (which will be right</tspan><tspan
  x="10" dy="12.5">about when the tooltip appears on certain</tspan><tspan
  x="10" dy="12.5">browsers) without using any scripting language?</tspan></text>

<g id="MOUSE_OVER_THESE">
<rect x="50" y="100" width="60" height="50" fill="red">
<title>This is a tooltip.</title>
</rect>
<rect x="150" y="100" width="60" height="50" fill="blue">
<title>This is another tooltip.</title>
</rect>
</g>
<rect class="hide" x="50" y="100" width="160" height="50" fill="transparent"></rect>

</svg>
Show wait cursor on button click before executing synchronous ajax request

Show wait cursor on button click before executing synchronous ajax request


By : rushil v
Date : March 29 2020, 07:55 AM
hope this fix your issue This is because the window.location.reload() will reload your page and the class you set using $("body").addClass("wait"); will be lost. Instead, remove that class in your success and error and make sure you are using async:true.
shadow
Privacy Policy - Terms - Contact Us © ourworld-yourmove.org