PDA

View Full Version : Help with onchange event with tree and form.



Reimius
23 Jul 2010, 1:45 PM
Hi guys,

We are developing a tree in which people can navigate through which has a form on the right of it with fields people can edit using a card panel. The tree itself has nodes people can move around add and remove, and each node corresponds to a certain type of form on the right. Right now we are having a big issue with event firing. It seems as though when you edit a field on the form on the right and lose focus of that field by clicking an item in the tree, the onchange for that field is not firing before the new form is loaded on the right. This results in the value not getting set properly because the onchange event fires way to late and the field it is referencing already has a different value. Does anyone know how to make sure the onchange happens before the form is reloaded?

Condor
25 Jul 2010, 5:47 AM
That only happens with triggerfields (comboboxes, datefields etc.).

You can work around it by focusing the node before getting the form values.

Reimius
26 Jul 2010, 11:48 AM
It's happening to all fields, doesn't seem to make a difference. We originally noticed it on a text field. I wish I could provide some source code for this, but this out of order event firing only seems to happen with our real-life example, and if we try to make a mock up one it doesn't happen.