Strange focus/data loss issue.

I’m having a strange data loss problem in a solution. I have not been able to reproduce in a small sample solution, so I haven’t posted it to the support system yet.

In certain tabs, if you are in edit mode, you click to another tab and back to the original tab, the first field is focused – but you are not in edit mode. If you change that field, then tab to the next field, the data is lost. Once a second field is focused edit mode begins and you’re fine.

It has something to do with an onShow event being attached to the form in the tab. If I set the onShow event to -none-, the problem does not occur. If I set it to any method, even a blank one, it does occur.

Entering the onShow method, the form is in edit mode. I’ve put a one liner “application.sleep(200)” in the onShow method, and you can watch the E appear when selecting the tab, then dissappear after 200 ms, while you are still left focused on the first field.

Anyone have any ideas on troubleshooting this issue?

Thanks, greg.

Hi Greg,

if you are on 3.1.x, before 3.1.7, this may possibly be a variation of a known bug. Our version of the symptoms are:

We have a script attached to the on_find_command event of the form.

  • User types into field (possibly on a related form in a panel)
  • Hits control -F (Win) or Apple-F (Mac)
  • Text vanishes

Workaround: attach a script on_data_change which sets the field to itself.

We have not seen this problem on 3.5.x

Hi Greg,

if you are on 3.1.x, before 3.1.7, this may possibly be a variation of a known bug. Our version of the symptoms are:

We have a script attached to the on_find_command event of the form.

  • User types into field (possibly on a related form in a panel)
  • Hits control -F (Win) or Apple-F (Mac)
  • Text vanishes

Workaround: attach a script on_data_change which sets the field to itself.

We have not seen this problem on 3.5.x

I’ve temporarily worked around the problem by adding the following to my global onShow method:

var en = frm.controller.enabled;
if( en )
{
    frm.controller.enabled = false;
    frm.controller.enabled = true;
}

This forces the form out of the first field then edit mode is properly established when re-entering the record.

greg.