Le forum (ô combien francophone) des utilisateurs de Powerbuilder.
Bjr a vous j'ai un soucis avec l'utilisation d'un trieview avec power builder 10.5
voila l'erreur qui s'affiche
Text:Invalid DataWindow row/column specified at line 120 in itempopulate event of object tv_1 of u_md0760_ent_geo Object:tv_1 Event/Function:itempopulate Line:120 Position:6
Ce problème se pose au niveau du case 5(dans le code)
Quelqu'un pour me venir en aide.STP
et voila le code
TreeViewItem tvi_Current, tvi_New long ll_Row, ll_RowCount, ll_level SetPointer(HourGlass!) GetItem(handle, tvi_Current) ids_DataBuffer.Reset() ll_level = tvi_Current.Level choose case tvi_Current.Level case 1 if ids_DataBuffer.of_cambiar_dataobject('d_md0760_prov') <0 then Return -1 case 2 if ids_DataBuffer.of_cambiar_dataobject('d_md0760_deptos') <0 then Return -1 case 3 if ids_DataBuffer.of_cambiar_dataobject('d_md0760_munic') <0 then Return -1 case 4 if ids_DataBuffer.of_cambiar_dataobject('d_md0760_localidades_1') <0 then Return -1 case 5 if ids_DataBuffer.of_cambiar_dataobject('d_md0760_localidades_2') <0 then Return -1 case 6 if ids_DataBuffer.of_cambiar_dataobject('d_ent_calles') <0 then Return -1 case 7 if ids_DataBuffer.of_cambiar_dataobject('d_ent_fincas') <0 then Return -1 case else tvi_Current.Children=FALSE this.SetItem(Handle,tvi_Current) return 0 end choose ids_DataBuffer.SetTransObject(SQLCA) ll_RowCount=ids_DataBuffer.Retrieve(tvi_Current.Data) if ll_RowCount< 1 then tvi_Current.Children=FALSE this.SetItem(handle,tvi_Current) return 0 end if tvi_New.Children=(NOT tvi_Current.Level=7) tvi_New.Level=tvi_Current.Level+1 tvi_New.PictureIndex=tvi_New.Level*2 tvi_New.SelectedPictureIndex=tvi_New.PictureIndex for ll_Row=1 to ll_RowCount tvi_New.Data=ids_DataBuffer.GetItemNumber(ll_Row,'ID') tvi_New.Label=ids_DataBuffer.GetItemString(ll_Row,'nombre') this.InsertItemLast(Handle,tvi_New) Elseif tvi_New.Level= 2 Then tvi_New.Data=ids_DataBuffer.GetItemNumber(ll_Row,'ID') tvi_New.Label=ids_DataBuffer.GetItemString(ll_Row,'nombre') this.InsertItemLast(Handle,tvi_New) Elseif tvi_New.Level= 3 Then tvi_New.Data=ids_DataBuffer.GetItemNumber(ll_Row,'ID') tvi_New.Label=ids_DataBuffer.GetItemString(ll_Row,'nombre') this.InsertItemLast(Handle,tvi_New) Elseif tvi_New.Level= 4 Then tvi_New.Data=ids_DataBuffer.GetItemNumber(ll_Row,'ID') tvi_New.Label=ids_DataBuffer.GetItemString(ll_Row,'nombre') this.InsertItemLast(Handle,tvi_New) Elseif tvi_New.Level= 5 Then tvi_New.Data=ids_DataBuffer.GetItemNumber(ll_Row,'ID') // Le problème se pose ici tvi_New.Label=ids_DataBuffer.GetItemString(ll_Row,'nombre') this.InsertItemLast(Handle,tvi_New) Elseif tvi_New.Level= 6 Then tvi_New.Data=ids_DataBuffer.GetItemNumber(ll_Row,'ID') tvi_New.Label=ids_DataBuffer.GetItemString(ll_Row,'nombre') this.InsertItemLast(Handle,tvi_New) Elseif tvi_New.Level= 7 Then tvi_New.Data=ids_DataBuffer.GetItemNumber(ll_Row,'ID') tvi_New.Label=ids_DataBuffer.GetItemString(ll_Row,'nombre') this.InsertItemLast(Handle,tvi_New) End if next return 0
Hors ligne
Bonjour,
Tout d'abord, afin de clarifier ton post,
Ensuite, as-tu le code de la fonction of_cambiar_dataobject?
Hors ligne
A mon avis, il manque un if dans ta boucle FOR...NEXT.
On ne voit que des elseif.
Hors ligne
Il doit en effet manquer après le FOR : If tvi_New.Level= 1 Then (copier-coller foiré?)
D'ailleurs autant utiliser un Choose case.
Mais bon, l'erreur est en amont...
Hors ligne
On dirait oui, par contre il passe plusieurs elseif quand même
Il a du sucrer des bouts de code.
Dernière modification par Gilles (07-09-2010 12:01:05)
Hors ligne
Bonjour,
Il doit en effet manquer après le FOR : If tvi_New.Level= 1 Then (copier-coller foiré?)
D'ailleurs autant utiliser un Choose case.
Surtout que dans les elseif, J'ai raté quelque chose mais je n'ai vu aucune différence de code pour les niveaux 2 à 7.
Ce ne serait pas plus lisible et plus simple :
CHOOSE CASE ltvi_new.level CASE 2 TO 7 tvi_New.Data=ids_DataBuffer.GetItemNumber(ll_Row,'ID') tvi_New.Label=ids_DataBuffer.GetItemString(ll_Row,'nombre') this.InsertItemLast(Handle,tvi_New) END CHOOSE
Hors ligne
Armelos as tu résolu ton cas ?
Si oui peut tu indiquer ce que tu as fait pour le résoudre et mettre le cas échéant ton cas à résolu : [RESOLU] dans ton titre?
Si ce n'est toujours pas le cas peut tu donner d'autres info .
Hors ligne
Gilles a écrit:
1 Message pour Armelos, le reverrons nous ?
Il ne s'est pas reconnecté depuis son post.
en même temps, c'était juste hier...
Hors ligne