Jump to content

TuniFormattedNumberEdit.onchange is not executed correctly


Roberto Nicchi

Recommended Posts

The onchange event of the TuniFormattedNumberEdit class is not executed correctly.

Look at the demo app i have attached to this post.

In the form there are 4 components. One is a TuniFormattedNumberEdit component.

The value of the component is changed in the form.oncreate event.

When the focus is moved into the component the onchage event is executed. It's shouldn't. This doesn't happens for the TuniNumberEdit class.

IMPORTANT: Use the tab key to change the focus.

thanks

Roberto

Project1.zip

Link to comment
Share on other sites

  • Roberto Nicchi changed the title to TuniFormattedNumberEdit.onchange is not executed correctly
30 minutes ago, Roberto Nicchi said:

waiting for a fix

For now you can try this workaround...

procedure TMainForm.UniFormCreate(Sender: TObject);
begin
  field2.Value:=10;
  field3.Value:=10;

  field3.JSInterface.JSAddListener('change', 'function(sender, newVal, oldVal){if (sender.rawValue==oldVal) return false}')
end;

 

Link to comment
Share on other sites

1 hour ago, Sherzod said:

For now you can try this workaround...

procedure TMainForm.UniFormCreate(Sender: TObject);
begin
  field2.Value:=10;
  field3.Value:=10;

  field3.JSInterface.JSAddListener('change', 'function(sender, newVal, oldVal){if (sender.rawValue==oldVal) return false}')
end;

 

Hello, you code seems to work fine. Anyway i have to correct what i have said before; seems the problem happens also with the TuniNumberEdit class.

I have used your code also for that class and seems to solve the problem.

I have attached to this post an example that shows the problem with a TuniNumberEdit  component also. 

Let my know if you can't reproduce the problem running the app.

thanks

Project1.zip

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...