Hi Thierry,
In a sales record entry form, after drawing a customer's signature using the jSignature object, I will want to erase the contents of this drawing area as soon as I change sales records. Amicalement
Gilles
Hi Gilles,
Welcome back from vacation!
Did you take a look at the sample in the FoxInCloud Live Tutorial? These actions are implemented… please see the code samples below…
* thisForm.cmdClear as Ficcmd (of ficsample.vcx) as Commandbutton
Caption_EN = Clear here && caption_en
Caption_FR = Effacer ici && caption_fr
* ——————————————————————————————————————————————————————————————————————————————
PROCEDURE Click
if thisForm.wlHTMLgen
* clear image in jSignature only
* effacer l'image dans jSignature
return Textmerge([jQuery('#<<thisForm.cntSignature.wcID>>').jSignature('reset');])
endif
ENDPROC
caption_en = "Clear here and on Server", ;
caption_fr = "Effacer ici et sur le serveur", ;
PROCEDURE cmdclearall.Click
if thisForm.wlHTMLgen
* {en} clear image in jSignature and send event to server
* {fr} effacer l'image dans jSignature et envoyer l'événement au server
return thisform.wcScriptEventClientServer(Textmerge([jQuery('#<<thisForm.cntSignature.wcID>>').jSignature('reset')]))
endif
local cImg
* {en} clear signature image
* {fr} effacer l'image signature
cImg = thisform.imgSignature.Picture
thisform.imgSignature.Picture = ''
this.Enabled = .F.
if !Empty(m.cImg)
* {en} for safety, completely erase signature image file
* {fr} par sécurité, effacer complètement le fichier de signature
clear resources (m.cImg)
erase (ForcePath(m.cImg, thisForm.woConfig.cTempPath))
erase (ForcePath(m.cImg, thisForm.woConfig.cTempPathPhysical))
endif
thisForm.Refresh
ENDPROC
Merci Thierry.
I've seen the code for the button's click () event, but that's not quite what I want to do.
The drawing in the container object of jSignature, persists, I would like to be able to erase the drawing area, as soon as I display another SAV folder.
This deletion must be done from a THISFORM method (THISFORM.display ()) and not from a button click () event.
How to integrate this code in the Display () method of the form so that it is actually executed?
if thisForm.wlHTMLgen
* {en} clear image in jSignature and send event to server
* {fr} delete the image in jSignature and send the event to the server
return thisform.wcScriptEventClientServer (Textmerge ([jQuery ('# << thisForm.cntSignature.wcID >>'). jSignature ('reset')]))
endif
Amicalement
Gilles
Please try
thisform.wcScriptJSadd (Textmerge([jQuery('#<<thisForm.cntSignature.wcID>>').jSignature ('reset')]))
&& adjust 'thisForm.cntSignature' to your container's address
Thierry,
thisform.wcScriptJSadd (Textmerge([jQuery('#<<thisForm.cntSignature.wcID>>').jSignature ('reset')]))
&& adjust 'thisForm.cntSignature' to your container's address
where can i try it in my form method THISFORM.affiche() ?
This method of the form (THISFORM.affiche()) is called from a click () event of a combobox containing a list of after-sales service files to display..
* THISFORM.affiche()
LPARAMETERS p_iClePk AS INTEGER && N° de dossier a afficher
#DEFINE _CRLF CHR(13) + CHR(10)
LOCAL cAlias AS STRING
cAlias = ALIAS()
* Afficher le dossier de réparation p_iclepk
IF PCOUNT() > 0;
AND VARTYPE(m.p_iClePk) == 'N';
AND NOT EMPTY(m.p_iClePk);
AND USED('v_reparation');
AND voirDossier(m.p_iClePk) && vérification si ce dossier est visible par cet utilisateur
SELECT v_reparation
=TABLEREVERT(.F., 'v_reparation')
=THISFORM.wViewParmSet('v_reparation', 'iclepk', m.p_iClePk, .T.)
IF RECCOUNT('v_reparation') > 0
REPLACE v_reparation.phototicketforfait WITH IIF(LEN(NVL(v_reparation.phototicketforfait, '')) < 20, '', v_reparation.phototicketforfait);
, v_reparation.phototicketdevis WITH IIF(LEN(NVL(v_reparation.phototicketdevis, '')) < 20, '', v_reparation.phototicketdevis);
IN 'v_reparation'
SELECT v_articlereparation
=TABLEREVERT(.T., 'v_articlereparation')
=THISFORM.wViewParmSet('v_articlereparation', 'iclefk', m.p_iClePk, .T.)
SCAN
* Suppression des caractères parasites dans les champs sensés contenir une photo
REPLACE v_articlereparation.photo1 WITH IIF(LEN(NVL(v_articlereparation.photo1, '')) < 20, '', v_articlereparation.photo1);
, v_articlereparation.photo2 WITH IIF(LEN(NVL(v_articlereparation.photo2, '')) < 20, '', v_articlereparation.photo2);
, v_articlereparation.photo3 WITH IIF(LEN(NVL(v_articlereparation.photo3, '')) < 20, '', v_articlereparation.photo3);
, v_articlereparation.photo4 WITH IIF(LEN(NVL(v_articlereparation.photo4, '')) < 20, '', v_articlereparation.photo4);
IN 'v_articlereparation'
ENDSCAN
GO TOP IN 'v_articlereparation'
=THISFORM.chargecombos(v_articlereparation.clefk_appareil)
SELECT v_client
=TABLEREVERT(.F., 'v_client')
iClePk = v_reparation.clefk_client
=THISFORM.wViewParmSet('v_client', 'iclepk', m.iClePk, .T.)
RELEASE iClePk
* Mise en mémoire N° de réparation affiché
WITH m.THISFORM
STORE m.p_iClePk TO .iClePk
STORE .F. TO .AddMode, .isChange && enlève le mode création et initialise le mode pas encore eu de changement de données
.CAPTION = 'DEMANDE S.A.V. DOSSIER N° ' + ALLTRIM(STR(m.p_iClePk))
ENDWITH
=THISFORM.montant()
=THISFORM.REFRESH()
IF NOT EMPTY(m.cAlias) AND USED(m.cAlias)
SELECT (m.cAlias)
ENDIF
RETURN .T.
ENDIF
ENDIF
* Dossier non accessible à l'utilisateur
=THISFORM.raz_dossier()
IF NOT EMPTY(m.cAlias) AND USED(m.cAlias)
SELECT (m.cAlias)
ENDIF
=THISFORM.wMessageBox(, 'Dossier N° ' + ALLTRIM(STR(m.p_iClePk)) + ' inconnu!', 64, 'Dossier', 10000)
RETURN .F.
Amicalement
Gilles
Not sure about your question… you can add this code anywhere in your method
Thierry,
I have try it in a new form method called test() and it have work very well..
I have deleted the affiche() method from my scx and rename the test() method with affiche() and also it have work very well again..
scx file mistake ?
Amicalement
Gilles