WebSite-PHP Framework PHP
Mehrsprachig
Einfacher Ajax Modus
Kein HTML, kein JavaScript
URL Rewriting
Mails senden
Sitemap - RSS - Web service
Laden Sie WebSite-PHP FrameWork jetzt herunter
 


Loading
 


Tutorial : Define default button

Tutorials

>

Tutorial Button

>

Tutorial : Define default button


Button-07: Tutorial der Komponente Button vom PHP FrameWork WebSite-PHP.

Tutorial : Define default button:




Zurück zum Tutorial der Komponente Button



Quelltext

Quelltext


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


Zurück zum Tutorial der Komponente Button


Share

 


Copyright © 2009-2024 WebSite-PHP Framework PHP
Start Dokumentation Herunterladen Schnellstart Tutorials Wiki Issue Tracker