Set the following settings:
Form1.UseAjax = true;
Button1
control create a routine like this: class Form1 extends Page { $Button1 = null; . . . // other controls defined here function Button1JSClick($sender, $params) { echo $this->Button1->ajaxCall("WhateverRoutineToCall"); ?> // always finish with this javascript statement // when using a Submit button (if you do not want // to reload the form. return(false); <?php } function WhateverRoutineToCall() { // do something here (just do not include echo statements) } . . . // other functions defined here }
Note: Do not put echo
statements in the function that is called by ajaxCall()
. Otherwise the AJAX code will not work.
Perform the following steps:
echo “Hello, world!”;
) should be replaced by a call to gettext()
or _()
. Eg: echo _("Hello, World!");
Language
property for the form to the required locale.form1.<locale>.xml.php
file that contains all the specific changes made to that locale.locale/<locale>/LC_MESSAGES/messages.po
. After saving the poEdit catalog (eg: messages.po
file), poEdit will create a .mo binary file which is what it is used by your application.Language
property in the OnCreate event for the form, and translate the required form controls. Eg: function Form1Create($sender, $params) { // set locale $this->Language = "Danish"; // translate form controls $this->btnSave->Caption = _("Save"); $this->btnDownload->Caption = _("Download"); $this->lblLanguage->Caption = _("Language"); $this->lblProductName->Caption = _("Product Name"); $this->lblCompanyName->Caption = _("Company Name"); }