searching in combobox, please , somebody can help me ?

Moderator: Rathinagiri

gdp
Posts: 47
Joined: Mon Jan 21, 2013 12:57 am

searching in combobox, please , somebody can help me ?

Post by gdp »

Hi all,

I need to do a search by typing a few letters, in a COmbobox, I tried to use a SORT option, but i get the following error.
SORT and Itemsource Clauses can't be used simultaneusly.

I work with hmg 3.0.34, + Access.
My definition is
@ 50,170 COMBOBOX TEXT1 ITEMS aCliente VALUE 1 WIDTH 220 ON ENTER Traecli() on lostfocus traecli() SORT

where aCliente is a array .

thanks a lot,
Best regards


Hola a todos,

Necesito poder implementar la opciond e busqueda en un combobox, trate de usar la clausula SORT, pero me sale el sgte error
SORT and Itemsource Clauses can't be used simultaneusly.

Estoy trabajando con HMG 3.0.34 + ACCESS.
Mi definicion es
@ 50,170 COMBOBOX TEXT1 ITEMS aCliente VALUE 1 WIDTH 220 ON ENTER Traecli() on lostfocus traecli() SORT

Donde aCliente es un array.

Gracias y saludos
Gerardo
Last edited by gdp on Mon Apr 15, 2013 8:39 pm, edited 2 times in total.
Leopoldo Blancas
Posts: 388
Joined: Wed Nov 21, 2012 7:14 pm
Location: México

Re: searching in combobox

Post by Leopoldo Blancas »

Hola gdp..

Si a lo mejor es un Bug, ya que hice una modificación a un ejemplo sencillo y me pasa lo mismo... hay que ver a los que saben más a ver que dicen....
*--------------------------------------------------------------------------------------------------------------------------------------
Hello gdp ..

If perhaps it's a bug, and I made a modification to a simple example and I feel the same ... must see to those who know more to see what they say ....

Code: Select all

/*
* HMG ComboBox Demo
* Contributed by "Sistemas Victory" <victory@cultura.com.br>
* Modified by Roberto Lopez
*/

#include "hmg.ch"

Function Main
LOCAL aABC := { 'A' , 'B' , 'C' }
	SET INTERACTIVECLOSE QUERY
	SET NAVIGATION EXTENDED
	
	DEFINE WINDOW Form_1 ;
		AT 0,0 ;
	        WIDTH 600 ;
        	HEIGHT 400 ;
	        TITLE 'Exemplo Funcao' ;
        	MAIN ;
		FONT 'Arial' ;
		SIZE 10

			@ 120   , 030  Label     L_CODIGO ;
				VALUE 'Codigo:' 

			@ 120   , 150  TextBox   T_CODIGO  ;
				ON GOTFOCUS Form_1.L_CODIGO.FontBold := .T. ;
				ON LOSTFOCUS Form_1.L_CODIGO.FontBold := .F. 

			*---------------------------------------------

			@ 160   , 030  Label     L_ESPECIE ;
				VALUE 'Especie:'  

			@ 160   , 150  COMBOBOX  C_ESPECIE ;
				ITEMS aABC ;
				value 1 ;
            SORT ;                          // aquí da error??? ///////////////////////////////////////////////////////////////////////////////
				ON GOTFOCUS Form_1.L_ESPECIE.FontBold := .T. ;
				ON LOSTFOCUS Form_1.L_ESPECIE.FontBold := .F. 

			*---------------------------------------------

			@ 200   , 030  Label     L_DESCRICAO  ;
				VALUE 'Descricao:'  

			@ 200   , 150  TextBox   T_DESCRICAO ;
				ON GOTFOCUS Form_1.L_DESCRICAO.FontBold := .T. ;
				ON LOSTFOCUS Form_1.L_DESCRICAO.FontBold := .F. 

			*---------------------------------------------

			@ 240   , 030  Label     L_CODIR ;
				VALUE 'Auxiliar:' 

			@ 240   , 150  COMBOBOX  C_CODIR  ;
				ITEMS { '1' , '2' , '3' } ;
				VALUE 1 ;
				ON GOTFOCUS Form_1.L_CODIR.FontBold := .T. ;
				ON LOSTFOCUS Form_1.L_CODIR.FontBold := .F. 

			*---------------------------------------------

			@ 280   , 030  Label     L_DESCG ;
				VALUE 'Endereco:' 

			@ 280   , 150  TextBox   T_DESCG ;
				ON GOTFOCUS Form_1.L_DESCG.FontBold := .T. ;
				ON LOSTFOCUS Form_1.L_DESCG.FontBold := .F. 

	END WINDOW

	CENTER WINDOW Form_1

	ACTIVATE WINDOW Form_1

Return

La literatura dice: (La que yo tengo)

SORT < lValue > Specifies whether a ComboBox or ListBox should be automatically sorted

Yo diría que esta bien lo que haces, o a la mejor nos falta información para saber en que casos se aplica.

Saludos
Polo
*--------------------------------------------------------------------------------------------------------------------------
The literature says: (The one I have)

SORT <lValue> Specifies ListBox or ComboBox Whether to Automatically Should be sorted

I would say that what you're doing, or the best information we need to know in which cases applies.

regards
Polo
gdp
Posts: 47
Joined: Mon Jan 21, 2013 12:57 am

Re: searching in combobox

Post by gdp »

Gracias !!,

Tengo otro error en un Grid Virtual, pero espera a tener un ejemploc con que mostrarlo.

Thanks,

I have another error in a Virtual Grid, but hopes to be an example to show

Gerardo
gdp
Posts: 47
Joined: Mon Jan 21, 2013 12:57 am

Re: searching in combobox, please , somebody can help me ?

Post by gdp »

Hi,

sorry for the insistence, but I have not been able to resolve this issue.
Anyone use the extended search mode in the Combo box ?
Can Somebody help me , please ?

Thanks a lot.

perdon por la insistencia, pero aun no he podido resolver esta cuestion.
Alguien usa el modo de busqueda extendida en el Combo BOX ?

Puede alguien ayudarme por favor ?
Muchas gracias !!!!!

Gerardo
User avatar
esgici
Posts: 4543
Joined: Wed Jul 30, 2008 9:17 pm
DBs Used: DBF
Location: iskenderun / Turkiye
Contact:

Re: searching in combobox, please , somebody can help me ?

Post by esgici »

gdp wrote: ...
Anyone use the extended search mode in the Combo box ?
...
Hola Gerardo and Leopoldo

Why you didn't try <hmg>\hfcl\Samples\ComboSearchBox :?:

Happy HMG'ing :D
Viva INTERNATIONAL HMG :D
gdp
Posts: 47
Joined: Mon Jan 21, 2013 12:57 am

Re: searching in combobox, please , somebody can help me ?

Post by gdp »

Hi Esgici,

Actually, I have implemented this solution, but this solution required a textbox and a Combobox, and the final users is not happy with this.
I'm migrating a system in VB6 , made by me, in 2002/2003, where ComboBox Seach works well.
Thanks for your interest.

Gerardo
User avatar
esgici
Posts: 4543
Joined: Wed Jul 30, 2008 9:17 pm
DBs Used: DBF
Location: iskenderun / Turkiye
Contact:

Re: searching in combobox, please , somebody can help me ?

Post by esgici »

gdp wrote: Actually, I have implemented this solution, but this solution required a textbox and a Combobox, and the final users is not happy with this.
I'm migrating a system in VB6 , made by me, in 2002/2003, where ComboBox Seach works well.
What clever ( and spoiled ) final users you have ;) they know textbox, Combobox and distinguish them :?

Your task is difficult :(

I wish easiness to you

By the way, why you didn't talk about ComboSearchBox at the beginning ?

f.e You could say "I 'don't like combobox and ComboSearchBox ..."

Whatever, nevermind; only I wondered and sory I couldn't help you :(

Viva HMG :D
Viva INTERNATIONAL HMG :D
gdp
Posts: 47
Joined: Mon Jan 21, 2013 12:57 am

Re: searching in combobox, please , somebody can help me ?

Post by gdp »

Well, I still don't know why this code don't function,

@ 50,170 COMBOBOX TEXT1 ITEMS aCliente VALUE 1 WIDTH 220 ON ENTER Traecli() on lostfocus traecli() SORT

but this Code DO !!!!!

DEFINE COMBOBOX text1
ROW 50
COL 170
WIDTH 220
VALUE 1
ITEMS aCliente
SORT .T.
ONENTER Traecli(1)
onlostfocus traecli(2)
END COMBOBOX


I only want to post the solution . . .. .

Gerardo
User avatar
esgici
Posts: 4543
Joined: Wed Jul 30, 2008 9:17 pm
DBs Used: DBF
Location: iskenderun / Turkiye
Contact:

Re: searching in combobox, please , somebody can help me ?

Post by esgici »

gdp wrote:Well, I still don't know why this code don't function,
@ 50,170 COMBOBOX TEXT1 ITEMS aCliente VALUE 1 WIDTH 220 ON ENTER Traecli() on lostfocus traecli() SORT
but this Code DO !!!!!
...
I only want to post the solution . . .. .
Hi Gerardo

Please be more specific;

what is meaning of don't function,

what is your expected function ?

Happy HMG :D
Viva INTERNATIONAL HMG :D
gdp
Posts: 47
Joined: Mon Jan 21, 2013 12:57 am

Re: searching in combobox, please , somebody can help me ?

Post by gdp »

:)
Sorry, Esgici, was the emotion .....

Previusly , i Wrote
Hi all,

I need to do a search by typing a few letters, in a COmbobox, I tried to use a SORT option, but i get the following error.
SORT and Itemsource Clauses can't be used simultaneusly
And Now, this was the solution that i found . . . .

:D

I Don't know why not work.....

Gerardo
Post Reply