Jump to content

Recommended Posts

Posted
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

  • Administrators
Posted

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.

Posted

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;
×
×
  • Create New...