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 : TextBox search 
with autocomplete

Tutoriels

>

Tutoriel Textbox

>

Tutorial : TextBox search with autocomplete


Textbox-08: Tutoriel du composants Textbox du FrameWork PHP WebSite-PHP.

Tutorial : TextBox search with autocomplete:



Retourner aux tutoriels du composants Textbox



Code source

Code source


Fichier: /pages/tutorials/textbox/textbox-08.php

<?php
class Textbox08 extends Page {
    public function 
InitializeComponent() {
        
parent::$PAGE_TITLE "Tutorial : TextBox search 
                                with autocomplete"
;
        
        
// List of values used is available on:
        // http://www.website-php.com/en/tutorials/database/database-05.html
                
        
$form = new Form($this);
                
        
// Create TextBox object
        
$search_text = new TextBox($form);
        
        
// Create AutoCompleteEvent object
        
$autocompete_event = new AutoCompleteEvent($form);
        
$autocompete_event->onSelect("onSelectAutoComplete");
        
$autocompete_event->setAjaxEvent();
        
$autocompete_event->disableAjaxWaitMessage();
        
        
// You can catch the event with JavaScript
        /*$autocompete_event->onSelectJs(
            "if (ui.item.id != '') { alert(ui.item.id); }");*/
        
        // Create AutoComplete object
        
$autocomplete = new AutoComplete(
                        new 
Url("xml/textbox-search.json"), 
                        
1$autocompete_event);

        
// Set autocomplete on the TextBox
        
$search_text->setAutoComplete($autocomplete);
        
$form->setContent($search_text);
        
        
$this->render $form;
    }
    
    public function 
onSelectAutoComplete($sender$id) {
        
$this->addObject(
            new 
DialogBox("onSelectAutoComplete"
                                
"URL: ".$id)
            );
    }
}
?>


Retourner aux tutoriels du composants Textbox



Share

 


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