Pages

Pages

Previous: Creating Your First Application Up to Contents Next: Customizing Field labels, descriptions, and widgets

Getting Started with Dataface 0.5.x

Jump:

Dataface is a simple framework for developing data-driven web applications in PHP and MySQL. This tutorial will show you how to get a dataface powered web application running in under 20 minutes.

Using Your First Application

A Dataface application, at its core, provides 4 standard operations: Add new records, edit existing records, delete records, and find records. This section gives a brief overview of how to use your first Dataface application.

When you first create your Dataface application and there are no records in the database, the application will look quite plain.  If you point your web browser to your newly created application it will look something like:

You may be wondering why it says "No records matched your request" when you haven't even really made a request.  This is because the 'default' request that is performed if no other request is specified is to show the first record from the first table in the navigation menu.  Since there are no records, it is true that there are NO records matching the default request.

So what can you do with this application anyways?  Essentially there are 4 operations you will want to perform:

  1. Create new records
  2. Edit Existing records
  3. Find records
  4. Delete records

Basic Navigation

The navigation menu on the left contains a list of tables in your database.  You can navigate to any of the tables in this list by clicking on that table:

There are 3 "views" associated with tables in the database:

  • Details - Shows the details of a single record in the table
  • List - Shows the records in the current "found set" as a list. (in a table).
  • Find - Allows users to find records matching certain criteria.
You can toggle between these 3 views using the tabs at the top of the page:

The "Found Set"

Throughout this tutorial you will see the phrase "found set" an awful lot, so it is important to understand just what this means.  A "found set" is the set of all records in the current table that match the current "find criteria".  This begs the question, "what is 'find criteria'?".  By default there is no find criteria.  When you perform a search or a find on the current table, you add "find criteria" so that only the records satisfying these criteria will be included in the "found set".

For example, if you click on the "find" tab, you will get a search form that allows you to search for records that match certain criteria.  The "find" tab for the "Course" table in our application looks like:

If you type in "English" in the "Subject" field and click "Find", then the "found set" will consist of only records that contain the word "English" in their subject fields.
On the top left of the application window there will always be a "Found" line that indicates how many records are currently in the found set.  e.g.,

This indicates that there are 256 records in the current table (which is the 'Groups' table).  There are currently only 225 records in the current "found set" (meaning that we have performed a "find" operation and it matched 225 of the records).  It also indicates that the currently displayed record is record number 1 out of the 225 found records.


The Actions Menu

The "actions to be performed" menu is always available at the top right of the application window.  It allows you to perform basic actions such as creating new records for the current table, deleting records for the current table, or clearing the "find" criteria (Show all records).

Descriptions:

  • new record - Creates a new record in the current table.
  • show all - Clears all find criteria on current table so that all records are shown.
  • delete - Deletes the current record in the table.
  • delete found records - Deletes all records in the current "found set". If no find criteria is specified this will delete all records in the table.

Creating new records

The basic FacultyOfWidgetry application that we created in the previous section isn't very interesting when it doesn't contain any records, so let's create some Program records.

  1. Select the "Program" table by clicking on the "Program" option of the navigation menu.
  2. Select "new record" from the "actions to be performed" menu.
  3. This will bring up a form to insert a new record that looks like:
  4. Fill in the form and click "Save".  If everything went OK, you will see the same form again, but with a "success" message at the top of the page:

Editing an existing record

The "details" view allows you to edit the current record.  The form is identical to the "create new record" form.

Deleting records

You can either delete the current record that you are viewing, or you can delete all of the records in the current "found set".  Both options are available from the "actions to be performed" menu in the upper right:

Select "delete" to delete only the current record you are viewing in the "details" view.
Select "delete found records" to delete all of the records in the current found set.
In either case, you will be prompted to confirm your decision before the records are actually deleted.

Other topics

This short section is only intended to get you acquainted with the basics of Dataface applications.  As your application becomes more complex with relationships and value-lists, there will be other usage scenarios of interest. 



Previous: Creating Your First Application Up to Contents Next: Customizing Field labels, descriptions, and widgets
blog comments powered by Disqus
Powered by Xataface
(c) 2005-2025 All rights reserved