In order to create an AJAX rating widget, use the AJAX Rating server behavior. Before applying it, create a recordset storing the rated elements.
The server behavior is accessible from two locations:
The MX AJAX Toolbox tab of the Insert bar (or MX AJAX Toolbox menu item from the Insert menu):
The Application panel, Server Behaviors -> + -> MX AJAX Toolbox -> AJAX Rating.
The AJAX Rating server behavior has one tab (Basic). Configure it as shown below:
In the Rating widget name text box enter a name for the rating widget, used to identify it later on. It should start with a letter or an underscore, and it should contain only alphanumeric characters.
Note: It is recommended that you leave the default suggestion, rating1, unless you really want to name your rating widget in a certain way. If you leave it like that and then add a new rating widget in page, the new name suggestion will be rating2, and so on (rating3, rating4, etc.).
Click the Dynamic Data button next to the Primary key text box (in the recordset section) to select the recordset column that uniquely identifies each rated item.
Click the Dynamic Data button next to the Get rate from text box (in the recordset section) to select the recordset column that stores the average rated score.
In the Connection drop-down menu select the database connection to use for retrieving and updating data. If the (right) connection has not been defined yet, click the Define button and create it now.
In the Table drop-down menu select the database table that stores the rated records.
Note: To mold with the AJAX rating widget implementation, the database table you are retrieving data from must have the following two columns in its structure (among other columns, obviously):
A float-type column for the rating score.
An integer-type column for the current number of votes (it increments with 1 each time a new vote is performed).
In the Primary key drop-down menu (in the table section) select the table column that uniquely identifies each rated item.
In the Save rate in drop-down menu select the table column that stores the average rated score.
In the Number of rates drop-down menu select the table column that stores the current number of votes.
The three buttons in the top-right part of the interface offer the next functionalities:
Click OK when you are done configuring the server behavior.
Click Cancel to exit without the new settings to be applied.
The Help button brings you to this help page.