Leave field contents after save
Archived from the Xataface Users forum.
kedikatt — Sun Dec 25, 2011 6:35 am
User enters a serial number in a field. Then selects items in other fields. Saves record. But then the user needs to enter new items for the same serial number. I would like to have the serial number field not clear after a record save, unless the user actually enters new data in the field.
Is there a method to select certain fields to isolate them from refreshing?
My first effort with Xataface. Not going too badly. A simple database to start.
dmdqlett — Tue Dec 27, 2011 6:38 am
still no one reply this issure .
ADobkin — Tue Dec 27, 2011 7:21 am
Are you saying that the user is updating the existing record with that same serial number, or are they creating a new record with the same serial number?
shannah — Tue Dec 27, 2011 11:34 am
There’s a few ways to tackle this problem.
- Use cookies and javascript to prefill the serial number field on page load.
- Use session variables to store the last serial number then prefill on new form (using the fieldname__default() method).
- Normalize the data structure so you don’t have to repeat this over and over. E.g. just one one record for the serial number, then create a relationship to the records that are related to this main record - and add to that relationship using either the grid widget or the standard add related record form.
- Create a custom action with a custom javascript form that works the way you want.
Since I don’t know the specs of you’re app I can’t really say which solution would work best in your case.
kedikatt — Tue Dec 27, 2011 11:38 am
A new record with the same serial number. Of course it would be nicer to have one input session per serial number, but that would be a complex, big form. There is a wide variety of data to input and it is done while actively operating and observing the system that produces the data. I have droplists and checkboxes to minimize effort for all but the serial number input.
I would just like the serial number field to retain the value, till new data is actually entered via keyboard.
kedikatt — Tue Dec 27, 2011 11:39 am
Thanks. You replied as I was writing. I think I will try option 2.
kedikatt — Tue Dec 27, 2011 1:38 pm
Thanks for the answers to my questions. Obviously I am new to php and Xataface. I am an electronics tech, not an IT. I have done some programming back in the stone age, but went hardware instead.
I just started in a tech shop that maintains over 10,000 pieces of equipment. The current data base consists of thousands of raw spreadsheets filled in randomly. Primary key is the serial number.
So I decided to make a database. Open office is easy to use for a single PC database, but we want it accessible from multiple stations.
In 3 weeks I got Apache, MySql, PHP, phpMyAdmin and now Xataface set up and working. Never used any of them before.
With just the few answers the folks provided here, I now have a useable if not proper or fancy database running.
Luckily it is very basic in it’s requirements.
Thanks for the great program and help.