Xataface Depselect Module  0.1
Dependent Select List Widget for Xataface Forms
 All Data Structures Files Functions Pages
Public Member Functions | Static Public Member Functions
actions_depselect_load Class Reference

An HTTP REST action to load the options for a particular depselect field. Returns JSON data. More...

Public Member Functions

 handle ($params)
 Handles the HTTP request. Outputs the JSON response. More...
 

Static Public Member Functions

static errorMessage ($fieldname)
 Returns the default error message for when a server error has occurred. More...
 

Detailed Description

An HTTP REST action to load the options for a particular depselect field. Returns JSON data.

REST Interface

Parameters
string-table The name of the table where the depselect field resides.
string-field The name of the depselect field.
Returns
JSON A JSON data structure of the following form:
{
code: <int>, // The status code. 200 for success
message: <string>, // String message. Useful if there is an error.
values: <Object> // A JSON object with the options to be returned.
}

Status Codes

Code Meaning
200 Success. The values should be contained in the 'values' property.
401 Permission Denied. The user doesn't have permission to access these values. In order to access this action, the user must either have edit or new permission on the source table (i.e. the table containing the depselect field).
500 Server Error or Configuration Error. Check the server error log for details.

Sample Values Object

The "values" property will be an object with just key values pairs, where the key is the id that is meant to be stored in the database. The value is the label that is displayed to the user. E.g.

{
1: 'Option #1',
2: 'Option #2',
.. etc...
}

Definition at line 78 of file depselect_load.php.

Member Function Documentation

static errorMessage (   $fieldname)
static

Returns the default error message for when a server error has occurred.

Parameters
string$fieldnameThe name of the depselect field on which the error occurred.
Returns
string The full error message.

Definition at line 86 of file depselect_load.php.

handle (   $params)

Handles the HTTP request. Outputs the JSON response.

Definition at line 94 of file depselect_load.php.


The documentation for this class was generated from the following file: