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 Combobox

Tutorials

>

Tutorial Combobox



Tutorial 1 : Simple ComboBox
File: /pages/tutorials/combobox/combobox-01.php

<?php
class Combobox01 extends Page {
    public function 
InitializeComponent() {
        
parent::$PAGE_TITLE "Tutorial : Simple ComboBox";
        
        
$this->render = new ComboBox($this);
        
$this->render->addItem("value 1""value 1");
        
$this->render->addItem("value 2""value 2");
        
$this->render->addItem("value 3""value 3");
        
$this->render = new Object($this->render"<br/>");
    }
}
?>


Tutorial 2 : Simple ComboBox with picture
File: /pages/tutorials/combobox/combobox-02.php

<?php
class Combobox02 extends Page {
    public function 
InitializeComponent() {
        
parent::$PAGE_TITLE "Tutorial : Simple ComboBox with 
                                picture"
;
        
        
$this->render = new ComboBox($this);
        
$this->render->addItem("value 1""value 1"
                                
false"img/home.png");
        
$this->render->addItem("value 2""value 2"
                                
false"img/doc.png");
        
$this->render->addItem("value 3""value 3"
                                
false"img/contact.png");
        
$this->render = new Object($this->render"<br/>");
    }
}
?>


Tutorial 3 : Simple ComboBox with picture and group
File: /pages/tutorials/combobox/combobox-03.php

<?php
class Combobox03 extends Page {
    public function 
InitializeComponent() {
        
parent::$PAGE_TITLE "Tutorial : Simple ComboBox with 
                                picture and group"
;
        
        
$this->render = new ComboBox($this);
        
$this->render->addItem("value 1""value 1"
                            
false"img/home.png""Group 1");
        
$this->render->addItem("value 2""value 2"
                            
false"img/doc.png""Group 1");
        
$this->render->addItem("value 3""value 3"
                            
false"img/contact.png""Group 2");
        
$this->render = new Object($this->render"<br/>");
    }
}
?>


Tutorial 4 : ComboBox with javascript alert on change
File: /pages/tutorials/combobox/combobox-04.php

<?php
class Combobox04 extends Page {
    public function 
InitializeComponent() {
        
parent::$PAGE_TITLE "Tutorial : ComboBox with javascript 
                                alert on change"
;
        
        
$this->render = new ComboBox($this);
        
$this->render->addItem("value 1""value 1");
        
$this->render->addItem("value 2""value 2");
        
$this->render->addItem("value 3""value 3");
        
$this->render->onChangeJs("alert('change');");
        
$this->render = new Object($this->render"<br/>");
    }
}
?>


Tutorial 5 : ComboBox with form
File: /pages/tutorials/combobox/combobox-05.php

<?php
class Combobox05 extends Page {
    public function 
InitializeComponent() {
        
parent::$PAGE_TITLE "Tutorial : ComboBox with form";
        
        
$form = new Form($this);
        
        
$combo = new ComboBox($form);
        
$combo->addItem("value 1""value 1");
        
$combo->addItem("value 2""value 2");
        
$combo->addItem("value 3""value 3");
        
        
$form->setContent($combo);
        
$this->render $form;
        
$this->render = new Object($this->render"<br/>");
    }
}
?>


Tutorial 6 : ComboBox with form, callback method on change
File: /pages/tutorials/combobox/combobox-06.php

<?php
class Combobox06 extends Page {
    public function 
InitializeComponent() {
        
parent::$PAGE_TITLE "Tutorial : ComboBox with form, 
                                    callback method on change"
;
        
        
$form = new Form($this);
        
        
$combo = new ComboBox($form);
        
$combo->addItem("value 1""value 1");
        
$combo->addItem("value 2""value 2");
        
$combo->addItem("value 3""value 3");
        
$combo->onChange("onChangeCombo");
        
        
$form->setContent($combo);
        
$this->render $form;
        
$this->render = new Object($this->render"<br/>");
    }
    
    public function 
onChangeCombo($sender) {
        
$this->addObject(new JavaScript("alert('change');"));
    }
}
?>


Tutorial 7 : ComboBox with form, callback method on change in AJAX
File: /pages/tutorials/combobox/combobox-07.php

<?php
class Combobox07 extends Page {
    private 
$combo null;
    
    public function 
InitializeComponent() {
        
parent::$PAGE_TITLE "Tutorial : ComboBox with form, 
                            callback method on change in AJAX"
;
        
        
$form = new Form($this);
        
        
$this->combo = new ComboBox($form);
        
$this->combo->addItem("value 1""value 1");
        
$this->combo->addItem("value 2""value 2");
        
$this->combo->addItem("value 3""value 3");
        
$this->combo->onChange("onChangeCombo");
        
$this->combo->setAjaxEvent();
        
$this->combo->setStripTags();
        
        
$form->setContent($this->combo);
        
$this->render $form;
        
$this->render = new Object($this->render"<br/>");
    }
    
    public function 
onChangeCombo($sender) {
        
$dialog = new DialogBox("onChangeCombo"
                        
$this->combo->getValue());
        
$this->addObject($dialog);
    }
}
?>


Tutorial 8 : ComboBox with advance style
File: /pages/tutorials/combobox/combobox-08.php

<?php
class Combobox08 extends Page {
    public function 
InitializeComponent() {
        
parent::$PAGE_TITLE "Tutorial : ComboBox with advance 
                                style"
;
        
        
$this->render = new ComboBox($this);
        
$this->render->setOption("mainCSS:'blue'");
        
$this->render->setWidth(200);
        
$this->render->addItem("value 1""value 1"
                            
false"img/home.png""Group 1");
        
$this->render->addItem("value 2""value 2"
                            
false"img/doc.png""Group 1");
        
$this->render->addItem("value 3""value 3"
                            
false"img/contact.png""Group 2");
        
$this->render = new Object($this->render"<br/><br/>");
    }
}
?>



Share

 


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