• (nodebb)

    Neglecting the duplication and other things... server-side requires a round trip. Client script does not. There are valid reasons for doing both in the same app (not at the tame time).

  • I Read The Comments (unregistered)

    But... can there even be more than one focused field?

  • Tinkle (unregistered)

    Setting the value property to the value property smells of the property setter doing more than it should.

  • Duston (unregistered) in reply to I Read The Comments

    There can be three Boolean values, so why not?

  • Sole Purpose Of Visit (unregistered)

    Genuinely interested here. Here's a dumb question. Ignoring whatever WTF usage is apparent in this example, what precisely is the architectural difference that distinguishes the server-client round trip in WebForms from the server-client round trip in, say, Node.js?

  • (nodebb) in reply to Sole Purpose Of Visit

    The key aspect of WebForms is that controls and the page output scripts which know how to submit a special form which can be parsed and translated into a server side event. I'm not sure about Node but in general, in most other frameworks the client script is more decoupled from the server; in theory, you can have a .NET MVC view render the HTML, which uses Javascript to make HTTP calls handled by a PHP endpoint. In WebForms, everything works together.

  • Carl Witthoft (google) in reply to Duston

    But not at the same time. ( Paulbooli Exclusion Principle)

  • (nodebb) in reply to Mr. TA

    "The key aspect of WebForms is that controls and the page output scripts which know how to submit a special form which can be parsed and translated into a server side event." - Basically that can be done in any language.

    What was key (and fairly unique) to WebForms was that it attempted to allow people to keep the "desktop paradigm" rather than moving to the new "web paradigm".... Arguments can be held for decades about it this was good (at least as an initial move) or bad (from the get go). For a reasonable fee, I will argue either side.

  • (nodebb)

    The funny part is that it convinced some people so well that they started questioning why they can't do things like keystroke events, or in-page navigation in this model. Microsoft even added crazy features like the "MaintainScrollPositionOnPostBack" property which led many people to build pages that "lost" a few keystrokes because the page posted back in such an invisible manner that the user didn't realize that they were typing into nowhere for a second or two.

  • Laggard (unregistered) in reply to Jaime

    I think many websites so heavily record/analyze activity in a web browser via javascript that you can barely use some websites on an older computer. It doesn't have the horrendous round trip lag issue that this would have, though.

  • Vilx- (unregistered)

    Having extensively worked with the nightmare that is WebForms in the past, I have another possible explanation - this could be a form of cargo cult programming. You see, WebForms tried hard to hide all kinds of details from the programmer, all to better create the illusion of "desktop programming" and hiding the true request-response nature of the web. The result was an environment that very few people fully understood, and even seasoned veterans were regularly caught off guard by some weird edge cases and side effects. Thus often the only recourse was to try various things to see what sticks, without really comprehending what's going on. Often also copy-pasting code from other places that had similar problems in the past.

    And this place smells like one of them. Here's my guess: It all started with a simple server-side .Focus() call, but that didn't work for some inexplicable reason. Then the client-side .focus() invocation was invented, but that only worked sometimes, depending on the order the scripts happened to be loaded or whatever. It was then discovered that adding a second client-side .focus() sometimes helps too (because it creates a separate SCRIPT tag). I don't know about setting the .value, but I suspect that it might affect the selection in the textbox. Again, invoked several times, because just once was sometimes not enough.

  • Hasseman (unregistered) in reply to Carl Witthoft

    Is Schrödinger's cat dead?

  • (nodebb) in reply to Vilx-

    Cargo cult programming sounds really likely. I've worked with hide-the-details frameworks before, and while it's really quite nice when it Just Works... you end up lost when it Just Doesn't Work. I ended up using a proprietary JS-based framework for phones at one point, and there were moments where you just had to call the next function after a short delay, and let the call stack unwind, to get the thing to work properly.

  • (nodebb) in reply to TheCPUWizard

    Yes but only WebForms gave it an all out try. If there's another such framework, let me know.

Leave a comment on “Unable to Focus”

Log In or post as a guest

Replying to comment #:

« Return to Article