Example #1
0
        $this->txtAccessCode->Text = $this->objShippingAccount->AccessCode;
        $this->txtAccessCode->Required = true;
        $this->txtAccessCode->CausesValidation = true;
        $this->txtAccessCode->AddAction(new QEnterKeyEvent(), new QAjaxAction('btnSave_Click'));
        $this->txtAccessCode->AddAction(new QEnterKeyEvent(), new QTerminateAction());
    }
    // Setup btnSave
    protected function btnSave_Create()
    {
        $this->btnSave = new QButton($this);
        $this->btnSave->Text = QApplication::Translate('Save');
        $this->btnSave->AddAction(new QClickEvent(), new QAjaxAction('btnSave_Click'));
        $this->btnSave->PrimaryButton = true;
        $this->btnSave->CausesValidation = true;
    }
    // Control ServerActions
    protected function btnSave_Click($strFormId, $strControlId, $strParameter)
    {
        try {
            $this->UpdateShippingAccountFields();
            $this->objShippingAccount->Save();
            $this->RedirectToListPage();
        } catch (QExtendedOptimisticLockingException $objExc) {
            $this->btnCancel->Warning = sprintf('This shipping account has been updated by another user. You must <a href="shipping_account_edit.php?intShippingAccountId=%s">Refresh</a> to edit this shipping account.', $this->objShippingAccount->ShippingAccountId);
        }
    }
}
// Go ahead and run this form object to render the page and its event handlers, using
// generated/shipping_account_edit.php.inc as the included HTML template file
ShippingAccountEditForm::Run('ShippingAccountEditForm', __DOCROOT__ . __SUBDIRECTORY__ . '/admin/shipping_account_edit.tpl.php');
// Include prepend.inc to load Qcodo
require '../includes/prepend.inc.php';
/* if you DO NOT have "includes/" in your include_path */
// require('prepend.inc.php');				/* if you DO have "includes/" in your include_path */
// Include the classfile for ShippingAccountEditFormBase
require __FORMBASE_CLASSES__ . '/ShippingAccountEditFormBase.class.php';
// Security check for ALLOW_REMOTE_ADMIN
// To allow access REGARDLESS of ALLOW_REMOTE_ADMIN, simply remove the line below
QApplication::CheckRemoteAdmin();
/**
 * This is a quick-and-dirty draft form object to do Create, Edit, and Delete functionality
 * of the ShippingAccount class.  It extends from the code-generated
 * abstract ShippingAccountEditFormBase class.
 *
 * Any display customizations and presentation-tier logic can be implemented
 * here by overriding existing or implementing new methods, properties and variables.
 *
 * Additional qform control objects can also be defined and used here, as well.
 * 
 * @package My Application
 * @subpackage FormDraftObjects
 * 
 */
class ShippingAccountEditForm extends ShippingAccountEditFormBase
{
}
// Go ahead and run this form object to render the page and its event handlers, using
// generated/shipping_account_edit.tpl.php as the included HTML template file
ShippingAccountEditForm::Run('ShippingAccountEditForm', 'generated/shipping_account_edit.tpl.php');