<?phpclass Button06 extends Page { private $text = null; public function InitializeComponent() { parent::$PAGE_TITLE = "Tutorial : Button callback method and display log in console and alert box"; $form = new Form($this); logConsoleInfo("This is an info"); logConsoleWarn("This is a warning"); logConsoleError("This is an error"); $this->text = new TextBox($form); $this->text->setValue("Text to display in the console"); $this->text->setStripTags("<b><i>")->setWidth(200); $button = new Button($form); $button->setValue("Validate")->onClick("onClickButton"); $button->setAjaxEvent(); $form_obj = new WSPObject($this->text, "<br/>", $button); $form_obj->setAlign(WSPObject::ALIGN_CENTER); $form->setContent($form_obj); $this->render = $form; } public function onClickButton($sender) { alert($this->text->getValue()); logConsoleInfo($this->text->getValue()); }}?>