Code Monkey home page Code Monkey logo

Comments (4)

tomasherceg avatar tomasherceg commented on May 27, 2024

There are several solutions and I don't know which one is the best.

  1. Prevent the postback when another postback is active. The advantage is that this behavior also helps to prevent e.g. creating duplicate items in the DB when the user double clicks the button. In combination with some UpdateProgress control which displays some loading icon, this is my favorite.
  2. Allow the second postback and when the response comes from the first one, drop it because it is outdated. This is the way ASP.NET WebForms behave.
  3. Put the postback in some queue and post it to the server when the current postback is finished. I don't think this is suitable for most scenarios however I can imagine this solution for e.g. the Timer control which posts back each minute - in case there is some postback, the Timer will wait until it is finished. But we can implement this behavior directly in the Timer control, it does not have to be the framework feature.

from dotvvm.

exyi avatar exyi commented on May 27, 2024

Maybe we can queue postbacks internaly but disable all controls performing actions. This will prevent user enqueuing many unwanted requests (and creating duplicates in db) and make posting back in any time possible.

from dotvvm.

tomasherceg avatar tomasherceg commented on May 27, 2024

If you prevent the user to use the controls during the postback, it is the solution 1 and there is no need for the queue at all.

from dotvvm.

tomasherceg avatar tomasherceg commented on May 27, 2024

For the milestone 0.5 I have decided that it will be enough to create the UpdateProgress control that can display an overlay with a loading animation.
If the developer decides not to use it, then the user will be able to create multiple postbacks but it is his problem.

from dotvvm.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.