FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour XBROWSE; EDIT_GET_LISTBOX
Posts: 1048
Joined: Mon Oct 24, 2005 09:54 AM
XBROWSE; EDIT_GET_LISTBOX
Posted: Thu Oct 17, 2013 09:44 AM

Can i change the ::aEditListTxt and ::aEditListBound at runtime and show this new contents in the listbox?

Regards,
Günther
---------------------------------
office@byte-one.com
Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: XBROWSE; EDIT_GET_LISTBOX
Posted: Thu Oct 17, 2013 10:40 AM

I do it often for EDIT_LISTBOX.
It should work for EDIT_GET_LISTBOX also. If it does not work, please let us know.

Regards



G. N. Rao.

Hyderabad, India
Posts: 389
Joined: Wed Nov 29, 2006 01:51 PM
Re: XBROWSE; EDIT_GET_LISTBOX
Posted: Wed May 07, 2014 09:59 AM

Nageswaragunupudi,

And as do you it do ???

Regards.

Posts: 4
Joined: Mon Apr 23, 2012 07:23 AM
Re: XBROWSE; EDIT_GET_LISTBOX
Posted: Sat Jul 11, 2015 10:36 AM
nageswaragunupudi wrote:I do it often for EDIT_LISTBOX.
It should work for EDIT_GET_LISTBOX also. If it does not work, please let us know.



Could you please give me the solution to set multidimensional array in Xbrowse EDIT_LISTBOX on run time . Single dimensional array is working fine on run time . If i set multidimensional array to aEditListTxt while define xbrowse it is working smoothly , but unable to set aEditListTxt array values on run time .

Regards
Tinu
Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: XBROWSE; EDIT_GET_LISTBOX
Posted: Sat Jul 11, 2015 11:28 PM
If you want to assign at runtime:

Code (fw): Select all Collapse
oCol:aEditListTxt    := ArrTranspose( aNewArray )[ 2 ]
oCol:aEditListBound  := ArrTranspose( aNewArray )[ 1 ]
Regards



G. N. Rao.

Hyderabad, India
Posts: 4
Joined: Mon Apr 23, 2012 07:23 AM
Re: XBROWSE; EDIT_GET_LISTBOX
Posted: Mon Jul 13, 2015 04:54 AM
nageswaragunupudi wrote:If you want to assign at runtime:

Code (fw): Select all Collapse
oCol:aEditListTxt    := ArrTranspose( aNewArray )[ 2 ]
oCol:aEditListBound  := ArrTranspose( aNewArray )[ 1 ]


Thanks for your reply ,

I had already tried this solution, unfortunately the result is not as expected. The aEditListText contents are displayed properly on the xbrowse inside the Combo box for selection, but once I choose the item from the Combo, xbrowse is displaying the ID instead of the aEditListText's value on the xbrowse.

ie my new array contains EmployeeID and EmplyeeName, if I try to select data from the Combo, the list is showing the Employee Name (as expected), but once I choose the Employee name, xbrowse displays the Employee ID on the xbrowse column.

This problem occurs only if we try to change the array at run time ie after the CreateFromCode() has been called

Regards
Tinu
Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: XBROWSE; EDIT_GET_LISTBOX
Posted: Wed Jul 15, 2015 07:00 PM

I checked and this is working for me. Please recheck and ensure that you assigned the second column to aEditListTxt and first column to aEditListBound. If you still have problem, please try to prepare a self-contained sample which we can build and test at our end.

From version 15.06 it is enough if you assign new multi-dim array to aEditListTxt at any time during runtime also. You need not do anything else.

Regards



G. N. Rao.

Hyderabad, India
Posts: 4
Joined: Mon Apr 23, 2012 07:23 AM
Re: XBROWSE; EDIT_GET_LISTBOX
Posted: Mon Jul 20, 2015 06:24 AM
nageswaragunupudi wrote:I checked and this is working for me. Please recheck and ensure that you assigned the second column to aEditListTxt and first column to aEditListBound. If you still have problem, please try to prepare a self-contained sample which we can build and test at our end.

From version 15.06 it is enough if you assign new multi-dim array to aEditListTxt at any time during runtime also. You need not do anything else.



Thanks for your support

Here is a sample that reproduce the said problem. I am assigning values to aEditListTxt, aEditListBound at run time. When you run the code, please click the button available at the bottom of the xbrowse to set values to aEditListTxt, aEditListBound at run time. Please note that the displays the country names in the combo box, but once we select the item from the Combo box, the country code is displayed on the xbrowse column instead of the country name.
Code (fw): Select all Collapse
#Include "FiveWin.ch"
#include "Xbrowse.ch"
  
*--------------------------------* 
Function Test()
*--------------------------------* 
Local oDlg,oBrw,aAlias:={{"","",""}}

   DEFINE DIALOG oDlg SIZE 440,220 PIXEL  TITLE 'XBrowse '
   
      @  10, 10 XBROWSE oBrw  OF oDlg ;
         COLUMNS 1,2,3; 
         ALIAS aAlias AUTOCOLS SIZE 200,70 PIXEL
         
         WITH OBJECT oBrw
               :aCols[1]:nEditType :=  EDIT_LISTBOX  
               :aCols[1]:aEditListTxt := {}
               :aCols[1]:aEditListBound := {}
               :CreateFromCode()
     END
         
    @ 5, 10 BUTTON "Set List BOX" SIZE  70, 10 ACTION Test1(oDlg,oBrw)
   
   ACTIVATE DIALOG oDlg
  
Return Nil
  
*--------------------------------* 
Function Test1(oDlg,oBrw)
*--------------------------------* 
Local aList:={{1,"Canada"},;
                    {2,"US"},;
                    {3,"Australia"}}

    oBrw:aCols[1]:nEditType :=  EDIT_LISTBOX
    oBrw:aCols[1]:aEditListBound  := ArrTranspose( aList)[ 1 ]
    oBrw:aCols[1]:aEditListTxt    := ArrTranspose( aList )[ 2 ]
    oBrw:Refresh()

Return Nil


The following code works fine ie while defining the xbrowse, if I assign a blank array to aEditListTxt, aEditListBound ie {""}, then everything is working as expected ie after selecting the item from the combobox the country name is displayed in the xbrowse column
Code (fw): Select all Collapse
#Include "FiveWin.ch"
#include "Xbrowse.ch"

  
*--------------------------------* 
Function Test()
*--------------------------------* 

Local oDlg,oBrw,aAlias:={{"","",""}}

   DEFINE DIALOG oDlg SIZE 440,220 PIXEL  TITLE 'XBrowse '
   
      @  10, 10 XBROWSE oBrw  OF oDlg ;
         COLUMNS 1,2,3; 
         ALIAS aAlias AUTOCOLS SIZE 200,70 PIXEL
         
        WITH OBJECT oBrw
           :aCols[1]:nEditType :=  EDIT_LISTBOX  /*IF i first assign aEditListTxt,aEditListBound blank array it will work fine */
           :aCols[1]:aEditListTxt := {""}
           :aCols[1]:aEditListBound := {""}
           :CreateFromCode()
        END
     
    @ 5, 10 BUTTON "Set List BOX" SIZE  70, 10 ACTION Test1(oDlg,oBrw)
   
   ACTIVATE DIALOG oDlg
   
Return Nil
  
*--------------------------------* 
Function Test1(oDlg,oBrw)
*--------------------------------* 

Local aList:={{1,"Canada"},;
                    {2,"US"},;
                    {3,"Australia"}}

    oBrw:aCols[1]:nEditType :=  EDIT_LISTBOX
    oBrw:aCols[1]:aEditListBound  := ArrTranspose( aList)[ 1 ]
    oBrw:aCols[1]:aEditListTxt    := ArrTranspose( aList )[ 2 ]
    oBrw:Refresh()

Return Nil


Regards
Tinu

Continue the discussion