masterdeveloper Posted June 12, 2018 Posted June 12, 2018 Good Morning, We recently encountered a possible bug in the "OnExit" event of the TUniEdit component. If you have 2 TUniEdit components bound to the same "OnExit" event, UNIGUI is calling this event 2 times when exiting the field, once for each TUniEdit. In the appendix I will leave a test case, where the 2 edit's are linked to the same OnExit event, to test just exit from edit1 and then exit from edit2, at this point the message with the component name is displayed 2 times, 1 for each TUniEdit . UNIGUI version: 1464
Sherzod Posted June 12, 2018 Posted June 12, 2018 Hi, Please report to support portal with a simple testcase
masterdeveloper Posted June 12, 2018 Author Posted June 12, 2018 Good morning, test case attached. Thank you. exemplos.rar
Administrators Farshad Mohajeri Posted June 12, 2018 Administrators Posted June 12, 2018 This is the natural behavior. When you move from Edit1 to Edit2 first OnExit event is fired. At this moment Message window is not displayed yet and cursor is in Edit2. When Message window is displayed focus transfers from Edit2 to message window. i.e. cursor exits from Edit2 and 2nd OnExit will be fired.
masterdeveloper Posted June 12, 2018 Author Posted June 12, 2018 Hello Farshad Mohajeri, Thank you for your feedback. In this case, is there anything I can do to fix this?
Sherzod Posted June 12, 2018 Posted June 12, 2018 Hello, In this case, you can try to use this approach, but test this approach before "using" it procedure TMainForm.UniFormCreate(Sender: TObject); begin UniEdit1.JSInterface.JSCode(#1'.addBeforeListener("blur", function(){return !(Ext.get(Ext.Element.getActiveElement()).up("#messagebox-1001"))});'); UniEdit2.JSInterface.JSCode(#1'.addBeforeListener("blur", function(){return !(Ext.get(Ext.Element.getActiveElement()).up("#messagebox-1001"))});'); end;
masterdeveloper Posted June 18, 2018 Author Posted June 18, 2018 Thanks for the feedback Delphi Developer, problem solved.
Recommended Posts