Daniel Spors edited this page Aug 15, 2013 · 2 revisions
Clone this wiki locally

Classes in file base/ajaxaction.class.php

class AjaxAction

Helper class to build common JavaScript codes for usage in AJAX aware controls.

Namespace: ScavixWDF\Base


High level confirm procedure. This will return a standard confirmation dialog that will perform the specified action when OK is clicked. Will also set a session variable so that the OK action PHP side code can simply test with AjaxAction::IsConfirmed($text_base) if the confirmation was really shown and accepted by the user.

Definition: public static function Confirm($text_base, $controller, $event, $data)

Returns: uiConfirmation Dialog ready to be shown to the user


  • string $text_base Text constants basename (like CONFIRMATION). Confirmation will need TITLE_$text_base and TXT_$text_base

  • mixed $controller Controller for OK action

  • string $event Method for OK action

  • array|string $data Data for OK action


Checks if the user has seen and accepted a confirmation. See AjaxAction::Confirm

Definition: public static function IsConfirmed($text_base)

Returns: boolean True if user clicked OK


  • string $text_base Text base the user confirmed


Creates a call.

Definition: public static function Post($controller, $event, $data, $callback)

Returns: string Valid JS code performing


  • mixed $controller Controller to call

  • string $event Method to call

  • array|string $data Data to be posted

  • string $callback JS callback method


Creates a valid URL to a controler('s method).

Definition: public static function Url($controller, $event)

Returns: string A valid URL for use in JavaScript wdf object


  • mixed $controller Controller object, Classname or _storage_id of the controller

  • string $event Optional method to be called