When calling serverconnectformid.reset() should the returned data/status etc. also be reset? If not, could an action be added to clear the data like the reset option does for ‘normal’ server connect calls?
If it is meant to be reset, it doesn’t seem to be working properly (PHP, W4.4.5):
As you can see data is still there after the reset
Happy to categorise under FR/bug once established…
I checked the code and I was wrong. SC form doesn’t extend SC it extends the form component which has a reset method but doesn’t clear the data unlike the SC component.
I think that would be possible. I don’t think it is a good thing to change the current reset behavior, but having a different action for it would be ok.
Decided to update the reset action, seems that the server connect component also uses reset to unset the data, so having the same behavior in the server connect form seems logical.
Seems logical but as per your first post, there is a significant risk of existing pages behaving differently for people who have SC forms already in place - I'd say it's probably a too commonly used function to be messing with. What about .reset() staying and something like .resetdata() or .cleardata()
I use a LOT of forms with hidden text inputs that have vales bound to them. Right now the reset just clears forms that do not have a value bound to them. Will this change clear my hidden form inputs as well that have a value bound to them?
The updated reset only clears the form.data, for the form fields it doesn’t change anything. I don’t think many users do even use the response data from the form submit and it seems logical that if you reset a form it should also reset the previous result.
I have used them in subsequent flows/JS - resetting all using .reset() is a significant behaviour change. If the form was set to reset before the flow/JS, they would subsequently not work following this change! I understand trying to consolidate to one consistent function but I suspect others may be in the same boat and find existing projects suddenly not working because of timing of the reset more than the reset itself.
I really look forward to and appreciate this change but just feel it could cause problems if not handled carefully