Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.clipper.visual-objects > #3907 > unrolled thread

Access to ListViewItem:oCargo from ListView;GetSelectedItem()

Started byFrank Leverenz <levi37@gmail.com>
First post2012-08-08 02:19 -0700
Last post2012-08-08 12:33 +0200
Articles 3 — 3 participants

Back to article view | Back to comp.lang.clipper.visual-objects


Contents

  Access to ListViewItem:oCargo from ListView;GetSelectedItem() Frank Leverenz <levi37@gmail.com> - 2012-08-08 02:19 -0700
    Re: Access to ListViewItem:oCargo from ListView;GetSelectedItem() "Wolfgang Riedmann" <wriedmann@gmail.com> - 2012-08-08 09:42 +0000
    Re: Access to ListViewItem:oCargo from ListView;GetSelectedItem() John Martens <adsl672100@tiscali.nl> - 2012-08-08 12:33 +0200

#3907 — Access to ListViewItem:oCargo from ListView;GetSelectedItem()

FromFrank Leverenz <levi37@gmail.com>
Date2012-08-08 02:19 -0700
SubjectAccess to ListViewItem:oCargo from ListView;GetSelectedItem()
Message-ID<85a4f213-723c-42c6-8424-b4f3fba96f9f@m13g2000vbd.googlegroups.com>
Hi,

I wanna store additional informations to a ListViewItem object. So I
generate an object for these informations and store it in oCargo. But
when I retrieve the object, the oCargo is empty.

	LOCAL oLV AS ListView
	LOCAL oItem AS ListViewItem

	oLV := SELF:oDCListView1
	oItem := ListViewItem{}
...
	oItem:oCargo := My_LVI_Cargo{}
	oLV:InsertItem(oItem,0)




METHOD ListViewMouseButtonDoubleClick(oListViewMouseEvent)
CLASS ...
	LOCAL oLV AS ListView
	LOCAL oLVI AS ListViewItem

...

	IF oEvent:NameSym == #ListView1
		oLV := SELF:oDCListView1
		oLVI := oLV:GetSelectedItem()
		IF Empty(oLVI)
			// nothing to do
		ELSE
			IF Empty(oLVI:oCargo)

here is my problem: oCargo is always empty

Any ideas?

Ciao
Frank

[toc] | [next] | [standalone]


#3909

From"Wolfgang Riedmann" <wriedmann@gmail.com>
Date2012-08-08 09:42 +0000
Message-ID<a8eqjaFobuU1@mid.individual.net>
In reply to#3907
Hi Frank,

> I wanna store additional informations to a ListViewItem object. So I
> generate an object for these informations and store it in oCargo. But
> when I retrieve the object, the oCargo is empty.


when you add a ListViewItem to a ListView, the objects effectively goes
lost, and is recreated when you retrieve the item later.
The array of values (set with ListViewItem:SetValue) is saved and
restored later.

Unfortunately, the Cargo value is not saved and not restored.

IMHO, you should your own listview class with an array for these
objects, and store the index to the object in a listViewItem value.

Wolfgang

[toc] | [prev] | [next] | [standalone]


#3910

FromJohn Martens <adsl672100@tiscali.nl>
Date2012-08-08 12:33 +0200
Message-ID<5022407e$0$14709$5fc3050@news.tiscali.nl>
In reply to#3907
When I want to do that I make an array in the window where the LV is in 
and store the info I want
when selecting the LV itme you know the index-nr of the array and can 
get to the additionel info



Op 8-8-2012 11:19, Frank Leverenz schreef:
> Hi,
>
> I wanna store additional informations to a ListViewItem object. So I
> generate an object for these informations and store it in oCargo. But
> when I retrieve the object, the oCargo is empty.
>
> 	LOCAL oLV AS ListView
> 	LOCAL oItem AS ListViewItem
>
> 	oLV := SELF:oDCListView1
> 	oItem := ListViewItem{}
> ....
> 	oItem:oCargo := My_LVI_Cargo{}
> 	oLV:InsertItem(oItem,0)
>
>
>
>
> METHOD ListViewMouseButtonDoubleClick(oListViewMouseEvent)
> CLASS ...
> 	LOCAL oLV AS ListView
> 	LOCAL oLVI AS ListViewItem
>
> ....
>
> 	IF oEvent:NameSym == #ListView1
> 		oLV := SELF:oDCListView1
> 		oLVI := oLV:GetSelectedItem()
> 		IF Empty(oLVI)
> 			// nothing to do
> 		ELSE
> 			IF Empty(oLVI:oCargo)
>
> here is my problem: oCargo is always empty
>
> Any ideas?
>
> Ciao
> Frank
>

[toc] | [prev] | [standalone]


Back to top | Article view | comp.lang.clipper.visual-objects


csiph-web