WebSite-PHP Framework PHP
Multi language
Simple Ajax mode
No HTML, no JavaScript
URL rewriting
Mail sending
Sitemap - RSS - Web service
Download WebSite-PHP FrameWork now
 


Loading
 


Tutorial : Define default button

Tutorials

>

Tutorial Button

>

Tutorial : Define default button


Button-07: Tutorial of the composant Button of the PHP FrameWork WebSite-PHP.

Tutorial : Define default button:




Go back to tutorial of the componant Button



Source code

Source code


File: /pages/tutorials/button/button-07.php

<?php
class Button07 extends Page {
    private 
$text null;
    
    public function 
InitializeComponent() {
        
parent::$PAGE_TITLE "Tutorial : Define default button";
        
        
$form = new Form($this);
        
        
$this->text = new TextBox($form);
        
$this->text->setValue("Enter your text");
        
$this->text->setStripTags("<b><i>");
        
        
$this->btn_val = new Button($form);
        
$this->btn_val->setValue("Validate");
        
$this->btn_val->onClick("onClickButton");
        
$this->btn_val->setAjaxEvent();
        
        
$this->btn_cancel = new Button($form);
        
$this->btn_cancel->setValue("Cancel");
        
$this->btn_cancel->onClick("onClickButton");
        
$this->btn_cancel->setAjaxEvent();
        
        
// To define default button
        
$this->btn_cancel->assignEnterKey();
        
        
$btn_table = new Table();
        
$btn_table->addRowColumns($this->btn_val
                                
$this->btn_cancel);
        
        
$form_obj = new WSPObject($this->text"<br/>"
                                
$btn_table);
        
        
$form->setContent($form_obj);
        
$this->render $form;
    }
    
    public function 
onClickButton($sender) {
        if (
$sender->getId() == $this->btn_val->getId()) {
            
$dialog = new DialogBox("onClickButton"
                            
$this->text->getValue());
        } else {
            
$dialog = new DialogBox("onClickButton"
                                    
"Cancel");
        }
        
$this->addObject($dialog);
    }
}
?>


Go back to tutorial of the componant Button


Share

 


Copyright © 2009-2024 WebSite-PHP Framework PHP
Home Documentation Download Quick start Tutorials Wiki Issue Tracker