TWeb TGet con autocomplete listo

Post Reply
carles
Posts: 45
Joined: Thu Dec 19, 2019 7:08 pm

TWeb TGet con autocomplete listo

Post by carles » Wed Apr 15, 2020 7:21 pm

Hola,

GET ya tiene el AUTOCOMPLETE para arrays o peticion al server y funciona correctamente


Este es un ejemplo que crea una petición al servidor

Code: Select all

//	{% LoadHrb( 'lib/tweb/tweb.hrb' ) %}

#include {% TWebInclude() %}

function main()

    LOCAL o, oWeb

	DEFINE WEB oWeb TITLE 'Test Autocomplete' INIT

    DEFINE FORM o ID 'demo'

    INIT FORM o  		
       
		HTML o INLINE '<h3>Test Get Autocomplete - Server</h3></hr>'
		
        ROWGROUP o        
            
            GET ID 'birds' VALUE '' GRID 6 LABEL 'Source: Server' AUTOCOMPLETE 'tutor17-server.prg' ;
				PLACEHOLDER 'ex: Charles, Chris, Irene,... ' OF o
        
        END o	
		
    END FORM o	
	
retu nil
Y este un ejemplo sencillo manejando arrays

Code: Select all

//	{% LoadHrb( 'lib/tweb/tweb.hrb' ) %}

#include {% TWebInclude() %}

function main()

    LOCAL o, oWeb
    LOCAL aLang := {"ActionScript",;
	                 "AppleScript",; 
	                 "Asp",; 
	                 "BASIC",; 
	                 "C",; 
	                 "C++",; 
	                 "Clojure",; 
	                 "COBOL",; 
	                 "ColdFusion",; 
	                 "Erlang",; 
	                 "Fortran",; 
	                 "Groovy",; 
	                 "Haskell",; 
	                 "Harbour",; 
	                 "Java",; 
	                 "JavaScript",; 
	                 "Lisp",; 
	                 "Perl",; 
	                 "PHP",; 
	                 "Python",; 
	                 "Ruby",; 
	                 "Scala",; 
	                 "Scheme" }
	
	
	DEFINE WEB oWeb TITLE 'Test Autocomplete' INIT

    DEFINE FORM o ID 'demo'

    INIT FORM o  		
       
		HTML o INLINE '<h3>Test Get Autocomplete - Array</h3></hr>'
		
        ROWGROUP o
        
            GET ID 'myid'  VALUE '' GRID 6 LABEL 'Source: Array' AUTOCOMPLETE aLang OF o
            
        END o
		
    END FORM o	
	
retu nil



Podeis chequear los ejemplos aqui

https://54.37.60.33/htweb/tutor17.prg
https://54.37.60.33/htweb/tutor17b.prg
https://54.37.60.33/htweb/tutor17c.prg
https://54.37.60.33/htweb/tutor17d.prg



Saludos.
C.

Post Reply