what UI interaction you are trying to achieve, from the end user's perspective.
There are a bunch of formItems that rely on the blur event to do formatting/validation. When I put forms in windows with a submit button, clicking the submit button should cause blur on whichever field had focus and perform any corresponding formatting/validation.
what you expected to happen
[FONT=Arial, Verdana, sans-serif]After adding an invalid date into a DateItem, I clicked my submit button which calls DynamicForm.validate() and saves if validate() returns true. Even with the dateitem having a value 12/12/asdf, form.validate() returned true. This prompted me to do some further investigation and found that blur doesn't happen when the button is an autochild and ends with the word "Button". Doesn't seem to matter if the button is a member of a VLayout within the window, or directly on the Window items. In my example you can see that the blur event only happens when you click the button which does not end in "Button".[/FONT]
browser(s) and platform(s) where you see the problem
Google Chrome Version 56.0.2924.87
contents of the SmartClient Developer Console "Log messages" area, with appropriate log categories set to DEBUG or INFO level
N/A
stack traces from either IE (in the Developer Console) or Firebug (in the Firebug console) for any JavaScript errors that have occurred.
N/A
sample code and sample data (tip:enclosing code snippets in [ code] ...[/ code] tags will format them as code, making your report much more readable)
SmartClient version (available on lower left of Developer Console)
SmartClient Version: v11.0p_2017-02-16/Pro Development Only (built 2017-02-16)
There are a bunch of formItems that rely on the blur event to do formatting/validation. When I put forms in windows with a submit button, clicking the submit button should cause blur on whichever field had focus and perform any corresponding formatting/validation.
what you expected to happen
[FONT=Arial, Verdana, sans-serif]After adding an invalid date into a DateItem, I clicked my submit button which calls DynamicForm.validate() and saves if validate() returns true. Even with the dateitem having a value 12/12/asdf, form.validate() returned true. This prompted me to do some further investigation and found that blur doesn't happen when the button is an autochild and ends with the word "Button". Doesn't seem to matter if the button is a member of a VLayout within the window, or directly on the Window items. In my example you can see that the blur event only happens when you click the button which does not end in "Button".[/FONT]
browser(s) and platform(s) where you see the problem
Google Chrome Version 56.0.2924.87
contents of the SmartClient Developer Console "Log messages" area, with appropriate log categories set to DEBUG or INFO level
N/A
stack traces from either IE (in the Developer Console) or Firebug (in the Firebug console) for any JavaScript errors that have occurred.
N/A
sample code and sample data (tip:enclosing code snippets in [ code] ...[/ code] tags will format them as code, making your report much more readable)
Code:
isc.Window.create({ height: 500, width: 500, initWidget: function () { this.Super("initWidget", arguments); this.addItem(this.addAutoChild("someForm")); this.addItem(this.addAutoChild("asdfasdfButton")); this.addItem(this.addAutoChild("asdfasdfBtn")); }, someFormDefaults: { _constructor: isc.DynamicForm, fields: [ { name: "Field 1", editorEnter: function(form, item, value){ item.setValue(""); }, blur: function (form, item) { item.setValue("Focus Left"); } } ] }, asdfasdfButtonDefaults: { _constructor: isc.Button, width: 200, title: "will NOT cause blur" }, asdfasdfBtnDefaults: { _constructor: isc.Button, width: 200, title: "will cause blur" } });
SmartClient Version: v11.0p_2017-02-16/Pro Development Only (built 2017-02-16)
Comment