Twitter Feed

Xataface Maillist

Sign up to receive the Xataface news letter with weekly updates and development tips.

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

Getting Started with Xataface

Jump:

Web Lite 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 Xataface 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 Xataface application.

When you first create your Xataface 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 tabs (aka Navigation menu) at the top left represent the 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

Just below the view tabs ('details', 'list', and 'find') there are a few buttons that allow you to perform actions such as create new records, clear find parameters (i.e. Show All), and delete 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. Click "new record" in the actions menu (top left).
  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 view details or edit the current record.  There should be at least 2 sub-tabs: 'View' and 'Edit'.  If you click on the 'Edit' tab, you will be presented with a form to edit the record. The form is identical to the "create new record" form.

Deleting records

If the 'list' tab is selected, then you will see a button called 'delete found records' in the actions menu (just below the view tabs).  Alternatively if the 'details' tab is selected, you will see a button called simply 'delete'.

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.

Interface Overview

Xataface applications provide an intuitive and consistent interface throughout.  The following screenshot contains a map of some comment interface components along with some explanations:

interface-schematic.png

 

Other topics

This short section is only intended to get you acquainted with the basics of Xataface 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-2017 All rights reserved