Powerbuilder pour les completement Geeks !

Le forum (ô combien francophone) des utilisateurs de Powerbuilder.

Recherche rapide

Annonce

Certaines rubriques, dont des cours, sont uniquement visibles par les membres du forum ^^.
Dans la rubrique Liens & Références, vous avez accès à un sommaire de téléchargement, profitez-en !
Il existe maintenant un nouveau TOPIC "Votre CV en Ligne" accessible uniquement par demande.

#1 24-09-2013 09:02:24

rapitou  
Membre Power Geek
Date d'inscription: 29-03-2007
Messages: 163
Pépites: 661
Banque: 0

[RESOLU] Erreur de setItem

Bonjour à tous,

Je demande pas grand chose, juste initialiser un champ  de ma dw...
Sauf que lorsque je mets ma valeur dans ce champ, j'ai rien du tout à l'affichage ! Apparemment un truc se passe pas bien ... Je travaille toujours avec la notation Dot, mais quand j'utilise un setitem il me retourne -1 ...

Ma dw n'a rien de spécifique, le champ est un string ... Jamais vu ça.

Savez-vous comment déterminer la raison pour laquelle un setitem retournerait -1?

Merci )

Dernière modification par rapitou (26-09-2013 09:15:06)

Hors ligne

 

#2 24-09-2013 09:27:57

Geo  
Membre completement Geek
Lieu: Binche
Date d'inscription: 15-12-2008
Messages: 119
Pépites: 378
Banque: 0

Re: [RESOLU] Erreur de setItem

Modifies-tu une ligne existante ?
Si ta DW est vides, as-tu bien inséré une ligne vide dans ta DW avant d'initialiser la colonne ?


Rien ne sert de courir, il faut partir à point .

Hors ligne

 

#3 24-09-2013 09:45:12

rapitou  
Membre Power Geek
Date d'inscription: 29-03-2007
Messages: 163
Pépites: 661
Banque: 0

Re: [RESOLU] Erreur de setItem

Oui la ligne existe bien (sinon ça planterait) et je n'ai qu'une seule ligne

Hors ligne

 

#4 24-09-2013 10:00:01

Dadone  
Membre Power Geek
Lieu: Avon (Seine et Marne)
Date d'inscription: 19-02-2007
Messages: 252
Pépites: 985
Banque: 0
Site web

Re: [RESOLU] Erreur de setItem

Il faut vérifier en édit source que les id qui identifie les champs de l'objet datawindow n'ont pas été vérolé.

Dernière modification par Dadone (24-09-2013 10:00:16)

Hors ligne

 

#5 24-09-2013 10:03:12

rapitou  
Membre Power Geek
Date d'inscription: 29-03-2007
Messages: 163
Pépites: 661
Banque: 0

Re: [RESOLU] Erreur de setItem

Il n'y a pas de problème sur les id

Hors ligne

 

#6 24-09-2013 10:15:40

Geo  
Membre completement Geek
Lieu: Binche
Date d'inscription: 15-12-2008
Messages: 119
Pépites: 378
Banque: 0

Re: [RESOLU] Erreur de setItem

Comment sont les update properties de ta DW ? Le champs que tu essaies de modifier est il updatable ? Le Tab order est il différent de 0 ?

Dernière modification par Geo (24-09-2013 10:18:18)


Rien ne sert de courir, il faut partir à point .

Hors ligne

 

#7 24-09-2013 10:27:23

Dadone  
Membre Power Geek
Lieu: Avon (Seine et Marne)
Date d'inscription: 19-02-2007
Messages: 252
Pépites: 985
Banque: 0
Site web

Re: [RESOLU] Erreur de setItem

Dans ce cas la meilleure solution de refaire de zéro la datawindow et de voir si le problème réapparait.
Si cela se reproduit il faut isoler la problématique de l'existant jusqu'à que cela fonctionne puis la réintégrer pas à pas dans l'existant.

Hors ligne

 

#8 24-09-2013 10:43:30

seki  
0x73656B69
Award: bf
Lieu: Laquenexy & Luxembourg
Date d'inscription: 20-11-2008
Messages: 1118
Pépites: 4,296,080,204
Banque: 9,223,372,036,854,776,000
Site web

Re: [RESOLU] Erreur de setItem

Ton SetItem() est appelé comment (fais voir... ) ? Tu es sûre de la valeur qui est passée ?


The best programs are the ones written when the programmer is supposed to be working on something else. - Melinda Varian

Mes réponses PB sur StackOverflow
http://stackoverflow.com/users/flair/317266.png

Hors ligne

 

#9 24-09-2013 11:10:09

rincevent  
Modérateur
Award: bf
Lieu: Belgique
Date d'inscription: 06-02-2007
Messages: 722
Pépites: 100,002,023
Banque: 0

Re: [RESOLU] Erreur de setItem

rapitou a écrit:

Savez-vous comment déterminer la raison pour laquelle un setitem retournerait -1?

au hasard : type de donnée utilisé par le setitem <> type de donnée de la colonne ?


http://img114.imageshack.us/img114/8519/userbar175801nb.gif
Pourquoi ne puis-je vivre comme n'importe quel être humain ? Pourquoi mon destin est-il de ne pouvoir cesser de me battre ?

Hors ligne

 

#10 24-09-2013 11:16:37

seki  
0x73656B69
Award: bf
Lieu: Laquenexy & Luxembourg
Date d'inscription: 20-11-2008
Messages: 1118
Pépites: 4,296,080,204
Banque: 9,223,372,036,854,776,000
Site web

Re: [RESOLU] Erreur de setItem

rincevent a écrit:

rapitou a écrit:

Savez-vous comment déterminer la raison pour laquelle un setitem retournerait -1?

au hasard : type de donnée utilisé par le setitem <> type de donnée de la colonne ?

Vu que SetItem() prend un any, il peut y avoir des trucs quand PB fait correspondre le any avec le vrai type de la colonne. Any nul ou un truc du genre.


The best programs are the ones written when the programmer is supposed to be working on something else. - Melinda Varian

Mes réponses PB sur StackOverflow
http://stackoverflow.com/users/flair/317266.png

Hors ligne

 

#11 24-09-2013 11:48:08

rincevent  
Modérateur
Award: bf
Lieu: Belgique
Date d'inscription: 06-02-2007
Messages: 722
Pépites: 100,002,023
Banque: 0

Re: [RESOLU] Erreur de setItem

avec date / datetime aussi ça fait des trucs chelous des fois je pense


http://img114.imageshack.us/img114/8519/userbar175801nb.gif
Pourquoi ne puis-je vivre comme n'importe quel être humain ? Pourquoi mon destin est-il de ne pouvoir cesser de me battre ?

Hors ligne

 

#12 24-09-2013 11:49:15

Geo  
Membre completement Geek
Lieu: Binche
Date d'inscription: 15-12-2008
Messages: 119
Pépites: 378
Banque: 0

Re: [RESOLU] Erreur de setItem

seki a écrit:

Ton SetItem() est appelé comment...

Tant qu'on y est, un export de la Datawindow Object serait utile pour vérifier le type...


Rien ne sert de courir, il faut partir à point .

Hors ligne

 

#13 24-09-2013 12:48:11

rapitou  
Membre Power Geek
Date d'inscription: 29-03-2007
Messages: 163
Pépites: 661
Banque: 0

Re: [RESOLU] Erreur de setItem

Juste pour info je suis très confirmée en dev PB donc il faut chercher la vérité ailleurs que dans les types pas compatibles ou la syntaxe du setitem ...
Voici l'export des colonnes, la dw n'a rien de compliqué :

Code:

column(band=detail id=2 alignment="0" tabsequence=10 border="5" color="0" x="507" y="16" height="56" width="800" format="[general]" html.valueishtml="0"  name=ag_nom_patro visible="1" edit.limit=30 edit.case=upper edit.autoselect=yes edit.autohscroll=yes edit.useellipsis=yes  font.face="Arial" font.height="-8" font.weight="400"  font.family="2" font.pitch="2" font.charset="0" background.mode="2" background.color="16777215" background.transparency="0" background.gradient.color="8421504" background.gradient.transparency="0" background.gradient.angle="0" background.brushmode="0" background.gradient.repetition.mode="0" background.gradient.repetition.count="0" background.gradient.repetition.length="100" background.gradient.focus="0" background.gradient.scale="100" background.gradient.spread="100" tooltip.backcolor="134217752" tooltip.delay.initial="0" tooltip.delay.visible="32000" tooltip.enabled="0" tooltip.hasclosebutton="0" tooltip.icon="0" tooltip.isbubble="0" tooltip.maxwidth="0" tooltip.textcolor="134217751" tooltip.transparency="0" transparency="0" )
text(band=detail alignment="1" text="Nom Patronymique" border="0" color="8388608" x="14" y="16" height="56" width="443" html.valueishtml="0"  name=t_1 visible="1"  font.face="Arial" font.height="-8" font.weight="400"  font.family="2" font.pitch="2" font.charset="0" background.mode="1" background.color="536870912" background.transparency="0" background.gradient.color="8421504" background.gradient.transparency="0" background.gradient.angle="0" background.brushmode="0" background.gradient.repetition.mode="0" background.gradient.repetition.count="0" background.gradient.repetition.length="100" background.gradient.focus="0" background.gradient.scale="100" background.gradient.spread="100" tooltip.backcolor="134217752" tooltip.delay.initial="0" tooltip.delay.visible="32000" tooltip.enabled="0" tooltip.hasclosebutton="0" tooltip.icon="0" tooltip.isbubble="0" tooltip.maxwidth="0" tooltip.textcolor="134217751" tooltip.transparency="0" transparency="0" )
column(band=detail id=4 alignment="0" tabsequence=30 border="5" color="0" x="507" y="184" height="56" width="800" format="[general]" html.valueishtml="0"  name=ag_prenom visible="1" edit.limit=30 edit.case=upper edit.autoselect=yes edit.autohscroll=yes edit.useellipsis=yes  font.face="Arial" font.height="-8" font.weight="400"  font.family="1" font.pitch="1" font.charset="0" background.mode="2" background.color="16777215" background.transparency="0" background.gradient.color="8421504" background.gradient.transparency="0" background.gradient.angle="0" background.brushmode="0" background.gradient.repetition.mode="0" background.gradient.repetition.count="0" background.gradient.repetition.length="100" background.gradient.focus="0" background.gradient.scale="100" background.gradient.spread="100" tooltip.backcolor="134217752" tooltip.delay.initial="0" tooltip.delay.visible="32000" tooltip.enabled="0" tooltip.hasclosebutton="0" tooltip.icon="0" tooltip.isbubble="0" tooltip.maxwidth="0" tooltip.textcolor="134217751" tooltip.transparency="0" transparency="0" )
text(band=detail alignment="1" text="Prénom" border="0" color="8388608" x="270" y="184" height="56" width="187" html.valueishtml="0"  name=t_2 visible="1"  font.face="Arial" font.height="-8" font.weight="400"  font.family="2" font.pitch="2" font.charset="0" background.mode="1" background.color="536870912" background.transparency="0" background.gradient.color="8421504" background.gradient.transparency="0" background.gradient.angle="0" background.brushmode="0" background.gradient.repetition.mode="0" background.gradient.repetition.count="0" background.gradient.repetition.length="100" background.gradient.focus="0" background.gradient.scale="100" background.gradient.spread="100" tooltip.backcolor="134217752" tooltip.delay.initial="0" tooltip.delay.visible="32000" tooltip.enabled="0" tooltip.hasclosebutton="0" tooltip.icon="0" tooltip.isbubble="0" tooltip.maxwidth="0" tooltip.textcolor="134217751" tooltip.transparency="0" transparency="0" )
column(band=detail id=5 alignment="0" tabsequence=40 border="5" color="0" x="1701" y="16" height="56" width="581" format="[general]" html.valueishtml="0"  name=ag_matricule visible="1" edit.limit=15 edit.case=upper edit.autoselect=yes  font.face="Arial" font.height="-8" font.weight="400"  font.family="1" font.pitch="1" font.charset="0" background.mode="2" background.color="16777215" background.transparency="0" background.gradient.color="8421504" background.gradient.transparency="0" background.gradient.angle="0" background.brushmode="0" background.gradient.repetition.mode="0" background.gradient.repetition.count="0" background.gradient.repetition.length="100" background.gradient.focus="0" background.gradient.scale="100" background.gradient.spread="100" tooltip.backcolor="134217752" tooltip.delay.initial="0" tooltip.delay.visible="32000" tooltip.enabled="0" tooltip.hasclosebutton="0" tooltip.icon="0" tooltip.isbubble="0" tooltip.maxwidth="0" tooltip.textcolor="134217751" tooltip.transparency="0" transparency="0" )
column(band=detail id=3 alignment="0" tabsequence=20 border="5" color="0" x="507" y="100" height="56" width="800" format="[general]" html.valueishtml="0"  name=ag_nom visible="1" edit.limit=30 edit.case=upper edit.autoselect=yes edit.autohscroll=yes  font.face="Arial" font.height="-8" font.weight="400"  font.family="2" font.pitch="2" font.charset="0" background.mode="2" background.color="16777215" background.transparency="0" background.gradient.color="8421504" background.gradient.transparency="0" background.gradient.angle="0" background.brushmode="0" background.gradient.repetition.mode="0" background.gradient.repetition.count="0" background.gradient.repetition.length="100" background.gradient.focus="0" background.gradient.scale="100" background.gradient.spread="100" tooltip.backcolor="134217752" tooltip.delay.initial="0" tooltip.delay.visible="32000" tooltip.enabled="0" tooltip.hasclosebutton="0" tooltip.icon="0" tooltip.isbubble="0" tooltip.maxwidth="0" tooltip.textcolor="134217751" tooltip.transparency="0" transparency="0" )
column(band=detail id=1 alignment="0" tabsequence=50 border="5" color="0" x="1701" y="100" height="56" width="581" format="[general]" html.valueishtml="0"  name=ag_num visible="1~t~"No~"" edit.limit=0 edit.case=any edit.autoselect=yes  font.face="Arial" font.height="-8" font.weight="400"  font.family="2" font.pitch="2" font.charset="0" background.mode="2" background.color="16777215" background.transparency="0" background.gradient.color="8421504" background.gradient.transparency="0" background.gradient.angle="0" background.brushmode="0" background.gradient.repetition.mode="0" background.gradient.repetition.count="0" background.gradient.repetition.length="100" background.gradient.focus="0" background.gradient.scale="100" background.gradient.spread="100" tooltip.backcolor="134217752" tooltip.delay.initial="0" tooltip.delay.visible="32000" tooltip.enabled="0" tooltip.hasclosebutton="0" tooltip.icon="0" tooltip.isbubble="0" tooltip.maxwidth="0" tooltip.textcolor="134217751" tooltip.transparency="0" transparency="0" )
text(band=detail alignment="1" text="Identifiant" border="0" color="8388608" x="1413" y="16" height="56" width="242" html.valueishtml="0"  name=t_3 visible="1"  font.face="Arial" font.height="-8" font.weight="400"  font.family="2" font.pitch="2" font.charset="0" background.mode="1" background.color="536870912" background.transparency="0" background.gradient.color="8421504" background.gradient.transparency="0" background.gradient.angle="0" background.brushmode="0" background.gradient.repetition.mode="0" background.gradient.repetition.count="0" background.gradient.repetition.length="100" background.gradient.focus="0" background.gradient.scale="100" background.gradient.spread="100" tooltip.backcolor="134217752" tooltip.delay.initial="0" tooltip.delay.visible="32000" tooltip.enabled="0" tooltip.hasclosebutton="0" tooltip.icon="0" tooltip.isbubble="0" tooltip.maxwidth="0" tooltip.textcolor="134217751" tooltip.transparency="0" transparency="0" )
text(band=detail alignment="1" text="Nom Marital" border="0" color="8388608" x="160" y="100" height="56" width="297" html.valueishtml="0"  name=t_4 visible="1"  font.face="Arial" font.height="-8" font.weight="400"  font.family="2" font.pitch="2" font.charset="0" background.mode="2" background.color="81324524" background.transparency="0" background.gradient.color="8421504" background.gradient.transparency="0" background.gradient.angle="0" background.brushmode="0" background.gradient.repetition.mode="0" background.gradient.repetition.count="0" background.gradient.repetition.length="100" background.gradient.focus="0" background.gradient.scale="100" background.gradient.spread="100" tooltip.backcolor="134217752" tooltip.delay.initial="0" tooltip.delay.visible="32000" tooltip.enabled="0" tooltip.hasclosebutton="0" tooltip.icon="0" tooltip.isbubble="0" tooltip.maxwidth="0" tooltip.textcolor="134217751" tooltip.transparency="0" transparency="0" )
text(band=detail alignment="1" text="N° d'Agent" border="0" color="8388608" x="1349" y="100" height="56" width="306" html.valueishtml="0"  name=ag_num_t visible="1~t~"No~""  font.face="Arial" font.height="-8" font.weight="400"  font.family="2" font.pitch="2" font.charset="0" background.mode="2" background.color="79741120" background.transparency="0" background.gradient.color="8421504" background.gradient.transparency="0" background.gradient.angle="0" background.brushmode="0" background.gradient.repetition.mode="0" background.gradient.repetition.count="0" background.gradient.repetition.length="100" background.gradient.focus="0" background.gradient.scale="100" background.gradient.spread="100" tooltip.backcolor="134217752" tooltip.delay.initial="0" tooltip.delay.visible="32000" tooltip.enabled="0" tooltip.hasclosebutton="0" tooltip.icon="0" tooltip.isbubble="0" tooltip.maxwidth="0" tooltip.textcolor="134217751" tooltip.transparency="0" transparency="0" )

Hors ligne

 

#14 24-09-2013 12:59:46

Dadone  
Membre Power Geek
Lieu: Avon (Seine et Marne)
Date d'inscription: 19-02-2007
Messages: 252
Pépites: 985
Banque: 0
Site web

Re: [RESOLU] Erreur de setItem

As tu essayé d'utiliser ta datwindow en dehors de l'applicatif ?
Cela permet d'isoler les dysfonctionnements.

Hors ligne

 

#15 24-09-2013 13:13:53

rapitou  
Membre Power Geek
Date d'inscription: 29-03-2007
Messages: 163
Pépites: 661
Banque: 0

Re: [RESOLU] Erreur de setItem

Non je n'ai pas essayé... Par contre j'ai créé  un nouveau champ bidon pour y mettre une valeur et ça n'a pas marché non plus....
Je vais faire autrement ... je vais créer une autre dw avec la meme requete , la mettre dans mon controle et faire un nouveau test ... je vous dis ce que ça donne

Hors ligne

 

#16 24-09-2013 13:23:59

rapitou  
Membre Power Geek
Date d'inscription: 29-03-2007
Messages: 163
Pépites: 661
Banque: 0

Re: [RESOLU] Erreur de setItem

Ca marche toujours pas donc ce n'est pas l'objet datawindow lui même mais ce dans quoi il est encapsulé ... Sauf que je n'ai pas envie de mettre le nez dans les méandres de ce fw sur lequel je ne ferai aucun commentaire !!

On revient au point de départ d'où ma question : il n'y a pas moyen de récupérer l'erreur déclenchée par le setitem ? D'après vos réponses je comprends que non ...

Hors ligne

 

#17 24-09-2013 13:24:37

buck  
Modérateur
Lieu: Dijon
Date d'inscription: 31-07-2008
Messages: 747
Pépites: 1,028,843
Banque: 171,170,849,654

Re: [RESOLU] Erreur de setItem

Bonjour,

Tu n'utilise pas un framework quelconque qui refuse la valeur dans l'événement itemchanged ou autres ...

Sinon, j'ai vu une ou deux fois des comportements analogues inexplicables. J'ai effacé et reconstruit le "dataobjet" et le problème s'est réglé tout seul.

Hors ligne

 

#18 24-09-2013 13:34:23

rapitou  
Membre Power Geek
Date d'inscription: 29-03-2007
Messages: 163
Pépites: 661
Banque: 0

Re: [RESOLU] Erreur de setItem

Non il n'y a pas de refus de valeur dans l'itemchanged .. un setitem ne déclenche pas l'itemchanged sinon j'aurai pu récupérer l'erreur dans l'itemerror ...
En recréant le dataobject ça fonctionne pas non plus !

Pourquoi je pourrais modifier un champ en saisie mais ne pas mettre une valeur dedans par le code ?? Ca n'a pas de sens ...

Dire qu'il va falloir vivre avec ce fw daubesque ... en peu de temps j'ai cumulé tout un tas de c... inexplicables !!

Hors ligne

 

#19 24-09-2013 13:44:00

xlat  
0xc0000005
Award: bf
Lieu: Tanger (طنج)
Date d'inscription: 04-12-2010
Messages: 720
Pépites: 11,343
Banque: 100,221,387,868,884,300
Site web

Re: [RESOLU] Erreur de setItem

tiens, tu parles de fw, est-ce que tu travailes avec une datawindow ou un control heritié, avec une surcharge du setitem par exemple?


https://lut.im/eJINqa9o/vAtyxD0h "Don't believe everything you read on the Internet"
    -- Abraham Lincoln

www.ngs.ma

Hors ligne

 

#20 24-09-2013 13:48:04

rapitou  
Membre Power Geek
Date d'inscription: 29-03-2007
Messages: 163
Pépites: 661
Banque: 0

Re: [RESOLU] Erreur de setItem

Non il n'y a pas de surcharge du setitem

Hors ligne

 

#21 24-09-2013 13:53:02

Dadone  
Membre Power Geek
Lieu: Avon (Seine et Marne)
Date d'inscription: 19-02-2007
Messages: 252
Pépites: 985
Banque: 0
Site web

Re: [RESOLU] Erreur de setItem

Essaye SetText() puis accepttext() cela déclenche bien l'item error.
Tu simules ainsi une saisie manuelle.

Dernière modification par Dadone (24-09-2013 13:54:46)

Hors ligne

 

#22 24-09-2013 14:00:02

xlat  
0xc0000005
Award: bf
Lieu: Tanger (طنج)
Date d'inscription: 04-12-2010
Messages: 720
Pépites: 11,343
Banque: 100,221,387,868,884,300
Site web

Re: [RESOLU] Erreur de setItem

j'imagine que tu as essayé de tracer en debug en pas à pas (Step In) pour voir si il n'y a pas un script qui s’exécute une fois dans le setitem...


https://lut.im/eJINqa9o/vAtyxD0h "Don't believe everything you read on the Internet"
    -- Abraham Lincoln

www.ngs.ma

Hors ligne

 

#23 24-09-2013 14:35:48

rapitou  
Membre Power Geek
Date d'inscription: 29-03-2007
Messages: 163
Pépites: 661
Banque: 0

Re: [RESOLU] Erreur de setItem

Ou j'étais passé en debug ça n'a rien donné
Je vais essayer avec le Settext/acceptText

Dernière modification par rapitou (24-09-2013 14:35:58)

Hors ligne

 

#24 24-09-2013 14:42:29

rapitou  
Membre Power Geek
Date d'inscription: 29-03-2007
Messages: 163
Pépites: 661
Banque: 0

Re: [RESOLU] Erreur de setItem

Bon alors j'ai essayé avec le SetText ... et là je n'ai pas d'erreur le champ est bien mis à jour !!

???

La vérité est vraiment ailleurs pour le coup ...........

Hors ligne

 

#25 24-09-2013 14:49:24

seki  
0x73656B69
Award: bf
Lieu: Laquenexy & Luxembourg
Date d'inscription: 20-11-2008
Messages: 1118
Pépites: 4,296,080,204
Banque: 9,223,372,036,854,776,000
Site web

Re: [RESOLU] Erreur de setItem

rapitou a écrit:

La vérité est vraiment ailleurs pour le coup

Maraboutage habituels de PB (quand on a déjà essayé tout le reste) :
- full build
- sinon relancer PB + full build ?
- sinon relancer le poste + full build ?
- sinon ?


The best programs are the ones written when the programmer is supposed to be working on something else. - Melinda Varian

Mes réponses PB sur StackOverflow
http://stackoverflow.com/users/flair/317266.png

Hors ligne

 

Pied de page des forums

Propulsé par FluxBB 1.2.22