WebSite-PHP Framework PHP
Multi langues
Mode Ajax simple
Aucun HTML, aucun JavaScript
URL rewrinting
Envoi d'email
Sitemap - RSS - Web service
Télécharger le Framework WebSite-PHP maintenant
 


Loading
 


Tutorial : Define default button

Tutoriels

>

Tutoriel Button

>

Tutorial : Define default button


Button-07: Tutoriel du composants Button du FrameWork PHP WebSite-PHP.

Tutorial : Define default button:




Retourner aux tutoriels du composants Button



Code source

Code source


Fichier: /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);
    }
}
?>


Retourner aux tutoriels du composants Button


Share

 


Copyright © 2009-2024 WebSite-PHP Framework PHP
Accueil Documentation Télécharger Quick start Tutoriels Wiki Issue Tracker