You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We have heard some complaints about the following scenario: "I need to run an animation on a button while a postback is running".
There are a several ways how to do this in DotVVM:
create a custom postback handler and applying it to the control (universal and preferred way)
attaching to beforePostback and afterPostback events using javascript (it can disable all buttons globally, or only the button which fired the postback, when used e.g. from a custom knockout binding)
To simplify the syntax, there are also several options:
ihnerit from the default Button control and create e.g. the AnimatedButton control
create a Decorator
create an active property (which can add a custom behavior to an existing control)
using server-side styles (which are not documented yet)
However, I agree that neither of the methods is simple.
We should prefer simple solution that will not require users to write their own JavaScript. I think it's good enough to prepare some decorator or active property.
<dot:PostbackIsRunning CssClass='' - A postback handler that will attach a css to the control when the postback is running.
The PostBack.IsBusyCssClass="processing" - an active property that will attach the postback handler
_page.PostbackRunning a property that can be used in binding anywhere. We could also have _queue.PostbackRunningQueue [ == "MyPostbackGroup"] that would return a queue of the running postback.
We should have a discussion about the right solution - I like PostBack.IsBusyCssClass for simple scenarios and full postback handler for all other scenarios.
We have heard some complaints about the following scenario: "I need to run an animation on a button while a postback is running".
There are a several ways how to do this in DotVVM:
beforePostback
andafterPostback
events using javascript (it can disable all buttons globally, or only the button which fired the postback, when used e.g. from a custom knockout binding)To simplify the syntax, there are also several options:
Button
control and create e.g. theAnimatedButton
controlDecorator
However, I agree that neither of the methods is simple.
I can imagine several solutions:
PostBack.IsBusyCssClass="processing"
)The text was updated successfully, but these errors were encountered: