Troubleshooting self-clearing form fields

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

Post Reply
jimboston
Posts: 3
Joined: Mon Apr 23, 2012 11:25 pm

Troubleshooting self-clearing form fields

Post by jimboston » Mon Apr 23, 2012 11:33 pm

So I've been playing with livecode, and am very impressed, I have found a mystery, or made a mistake though that I can't seem to solve.

I have a group of fields (text input and one scrolling text box). The fields get populated when selecting a listing from a Datagrid and all is well. The weirdness is that upon selecting a listing in the Datagrid and having it populate the form fields, I can select any *blank* fields just fine (nothing happens to the other fields which is correct), however if I select a field that has some text in it, every field in the group gets cleared... and I'm not specifying anywhere or clearing it. I've tried using the message watcher, as well as tried trapping mouseUps (which appears to be when the fields all get reset) both at the field and group levels, but I don't know why this would be happening. Could anyone lend some insight or troublshooting tips (the message watcher really just got me confused so it didn't help much)

Thanks in advance, any direction would be helpful.

Jim

jimboston
Posts: 3
Joined: Mon Apr 23, 2012 11:25 pm

Re: Troubleshooting self-clearing form fields

Post by jimboston » Tue Apr 24, 2012 2:46 am

ok I understand what is happening now, but not why.

When I select a line in the DataGrid, the action handler for selectionChanged fires and runs my code to move data to the form fields, BUT when I then click on any of the form input text fields that have text in them selectionChanged is fired again... however if I click into an empty field and tab to the same field with text, everything will work and selectionChanged isn't fired... what gives? Can I somehow prevent selectionChanged from occuring once I'm outside the DataGrid? I thought this would be default behavior.

jimboston
Posts: 3
Joined: Mon Apr 23, 2012 11:25 pm

Re: Troubleshooting self-clearing form fields

Post by jimboston » Tue Apr 24, 2012 3:39 am

figured it out, selectionChanged is sent anytime you click into a field and set the insertion point to anything other than the origin, it doesn't get sent with arrow key entry.

Post Reply