Hi,
is it possible to use DCLISTBOX with Dataobjects?
DCLISTBOX and DataObject
Re: DCLISTBOX and DataObject
Yes.
Here is some sample code:
Here is some sample code:
Code: Select all
#INCLUDE "dcdialog.ch"
FUNCTION Main()
LOCAL GetList[0], oDataObject, cVarName := ''
oDataObject := DataObject():new()
oDataObject:name := 'Roger Donnay'
oDataObject:street1 := '1486 S. Loggers Pond Place'
oDataObject:street1 := 'Apt. 11'
oDataObject:city := 'Boise'
oDataObject:state := 'Idaho'
oDataObject:country := 'U.s.A.'
@ 0,0 DCLISTBOX cVarName LIST oDataObject SIZE 30,10
DCREAD GUI FIT
RETURN nil
* ---------
PROC appsys ; RETURN
The eXpress train is coming - and it has more cars.
Re: DCLISTBOX and DataObject
Sorry, it was my mistake. I mean this for example
Code: Select all
LOCAL aJahre := {}
LOCAL aVerzeichnisse := {}
LOCAL cJahre := ""
LOCAL cVerzeichnis := oSysPAra:doParaWs:datenbestand + "jahresabschluss\*"aVerzeichnisse := Directory(cVerzeichnis,"D") // nur Directories der Jahre
IF Len(aVerzeichnisse) > 0
SELECT field1 AS name FROM (aVerzeichnisse) AS jahr WHERE jahr->field1 <> "." .AND. jahr->field1 <> ".." INTO objects aJahre
ENDIF
//------------------------------------------------------------------------------
@ oDialogZusatz:nOben,oDialogZusatz:nLinks DCSAY "Jahr:";
OBJECT oDialogZusatz:oText;
PARENT oDialogZusatz:oRahmenKopf;
SIZE 0
@ DCGUI_ROW,DCGUI_COL DCLISTBOX cJahre;
LIST aJahre;
OBJECT oListbox;
PARENT oDialogZusatz:oRahmenKopf;
SIZE oSysPara:SkaliereXbParts(100),oDialogZusatz:nSayHoehe
Re: DCLISTBOX and DataObject
This will not work for you.
DCLISTBOX is built on the DC_XbpListBox() class (inherited from XbpListBox()) which only works with single dimensional arrays or data objects.
I am guessing that I could modify the class in eXpress++, but that would take some work.
You can get the same behavior as DCLISTBOX by using DCBROWSE instead. It already supports arrays of data objects.
Look at the sample in \exp20\samples\adssql\sqltest1.prg.
DCLISTBOX is built on the DC_XbpListBox() class (inherited from XbpListBox()) which only works with single dimensional arrays or data objects.
I am guessing that I could modify the class in eXpress++, but that would take some work.
You can get the same behavior as DCLISTBOX by using DCBROWSE instead. It already supports arrays of data objects.
Look at the sample in \exp20\samples\adssql\sqltest1.prg.
The eXpress train is coming - and it has more cars.
Re: DCLISTBOX and DataObject
thanks a lot. it was a little test. Thats life..... 
