Hello everyone,
this is a continuation of this Problem: https://wisej.com/support/question/modifiedchanged-of-imodified
It’s the same program but with Version 3.0.9
As I said in the other Question, I would prefer if the controls worked similar.
Thanks in advance.
Please retest this issue with our latest Wisej release (3.0.10)
Best regards
Frank
To update this thread, I think I see the source of the confusion. Property changes events fire when the property changes. In the case of TextChanged it is not directly related to tabbing out of the control. The text is considered changed the moment the user types in the textbox – as it should because the user could click on a button that doesn’t take the focus away, or there can be a timer, or a keyboard accelerator, etc.
As soon as there is an event of any kind that is fired to the server, Wisej updates the state of all controls – as it should since an event of any control expects to find the correct value on any other control.
In this case, when attaching the ModifiedChanged event, Wisej fires it the moment the user modifies the text in the TextBox (by design and as required by most apps to enable save buttons, for example). However, since this event fires all the times the user types (as if it was a KeyDown handler) it also causes the TextChanged event to fire. Which is technically correct but can be confusing. It is the identical behavior as if KeyDown was attached.
The only improvement I can see here is not to fire ModifiedChanged from the client after the first time it’s fired and until the text is reset. I will log as an enhancement request.
Hi Luca,
I attached a video of me using the TextChanged Event which fires when tabbing but not before. You can see all the code in the video.
ModifiedChanged fires on KeyDown.
Greetings
edit: added the small project as a zip as well.
Hi Sascha
Thanks for write us
The way how its work is the following
When ModifiedChanged is attached to an handler (lazy event) it is fired immediately when typing for both TextBox and DateTimePicker (works the same way and it’s by design).
When ModifiedChanged is not attached, it’s not fired immediately (because of the lazy event system) but OnModifiedChanged is invoked when there is an event back from the browser.
The Modified property is automatically reset when assigning the Text property even with the same value.
Both work the same way,
Hope to be helpful