Hi Thierry,
Why this code does not work in the form's Activate ?
lparameters uselessParm && {en} doc in Parent Code {fr} doc dans le code parent
IF (Type('m.thisForm.wlHTMLgen') == 'L' AND m.thisForm.wlHTMLgen)
RETURN THISFORM.wcScriptEventClientServer(THISFORM.wNotify(Mprompt, "Finalisation du compromis", 64))
ENDIF
It's works well with Click() or GotFocus()
can you post the JavaScript generated for this form? (should be near the end of form_scx.js
, no need to post JS for contained controls)
Here is the code snippet of the screen. Thank you.
jQuery('#realise_scx-fermer').prop('effectShow', true).prop('effectHide', true);
FoxInCloud.formActivateObserve('realise_scx', 'jQuery.notify({title: "<b>Finalisation du compromis</b>:",message: "Compromis réalisé ... ",icon: "fa fa-info-circle"},{type: "info", element: "#realise_scx"})', false);
FoxInCloud.formActivateObserve('realise_scx', null, false);
jQuery('#realise_scx').prop('wuValue ', null);
FoxInCloud.documentInit('realise_scx');
jQuery('#realise_scx').prop('effectShow', true).prop('effectHide', true);
event = jQuery.event.fix(event);
var srce = event.target, srceTag = srce.tagName.toLowerCase(), eventType = event.type;
if (srceTag === 'option'
|| true
&& srceTag === 'select'
&& ['mouseover', 'mouseout', 'mouseenter', 'mouseleave'].indexOf(eventType) > -1
&& event.relatedTarget
&& (event.relatedTarget === srce || event.relatedTarget.tagName.toLowerCase() === 'option')
) {event.stopPropagation(); event.preventDefault(); return;}
if (false
|| event.eventPhase === 2
|| eventType.substr(0, 3) === 'key'
|| srceTag === 'select'
|| eventType === 'click' && ['span', 'i', 'b', 'strong', 'img'].indexOf(srceTag) > -1
) {
event.stopPropagation();
jQuery.notify({title: "<b>Finalisation du compromis</b>:",message: "Compromis réalisé - Vous pouvez encore annuler votre option pour choisir un partenaire",icon: "fa fa-info-circle"},{type: "info", element: "#realise_scx"});jQuery.proxy(FoxInCloud.LeftClick, FoxInCloud, undefined, false)(event)}
});
As we can see FoxInCloud.formActivateObserve
is launched twice.
In awhtml.prg, this code looks better:
CASE m.lcBaseClass == 'Form' AND m.this.cEvent == 'Activate'
IF .NOT. EMPTY (m.this.cScriptClient)
this.cScriptJSadd(Textmerge([FoxInCloud.formActivateObserve('<<m.this.wcID>>', <<cLitteralJS(Evl(m.this.cScriptClient, .null.))>>, <<cLitteralJS(m.this.lScriptClientAnte)>>)]))
ENDIF
this.cScriptClient = ''
RETURN ''
Hi Vincent,
To me, this code should be in form.show()
rather than form.activate()
However I'll send you (by PM) a modified awHTML.prg
which should, hopefully, solve the issue.
Thanks for your patience
Hi Thierry, I had not done because Show () is not documented.
Your code works well, but it does not start when the screen is displayed. You have to click on it (same thing with Show ()).
Thanks for your attention.
As .Show()
is a method, just add the wNotify script:
thisform.wcScriptJSadd(thisform.wnotify(…))
Same behavior with your code (+ dodefault ()) in Show ()
"it does not work" without code does not help…
can you post:
- the generated form JavaScript (like on a previous post)
- the AJAX response to
MethExec.doo?&MethAddr=InitControlsInet&ObjAddr=form_scx…
Of course ...
Here is AJAX response (I hope so):
<?xml version='1.0' encoding='UTF-8' standalone='yes'?><IntuiCat>
<Result><v>true</v><t>boolean</t></Result>
<script_>var $form = jQuery('#realise_scx');
if ($form.length){
var $title = $form.parent().parent().find('.modal-title '); $title.html($title.html().replace(/&nbsp;-<small><a\s+(\S+\s+)?title=".+/i, '') + '&nbsp;-<small><a id="realise_scx_caption_a" title="En cas d&#39;anomalie, cliquez pour la signaler par courriel à &#34;FoxInCloud App&#34; (&#34;xxx<support@xxx-ino.com>&#34;)" tabindex="-1" href="javascript:void(0);">&nbsp;11:26:51 PM (serveur)&nbsp;<span class="fa fa-bullhorn" aria-hidden="true"></span></a></small>');;
jQuery('#realise_scx_caption_a').on('mousedown', function(event){event.stopPropagation();}).on('click', function(event){FoxInCloud.FormDisplay(event, 'vhcFrmFB', '"realise_scx", "11:26:51 PM (serveur)"');});
}</script_>
<UserID>56117J6RA</UserID>
<reqID>1457_5691E987P-001</reqID>
<ServerVersion>2.26.2-beta.5</ServerVersion>
<ServerTimeStamp>{^2018-04-03 04:52:01 PM}</ServerTimeStamp>
<AppTime>0</AppTime>
<ServerTime>1.704408</ServerTime></IntuiCat>
And the extract of my form.js -no "activate" word - My code is in Activate():
jQuery('#realise_scx-fermer').prop('effectShow', true).prop('effectHide', true);
FoxInCloud.formActivateObserve('realise_scx', 'jQuery.notify({title: "<b>Finalisation du compromis</b>:",message: "Dossier finalisé avec succès !",icon: "fa fa-info-circle"},{type: "info", element: "#realise_scx"})', false);
jQuery('#realise_scx').prop('wuValue ', null);
FoxInCloud.documentInit('realise_scx');
Is this what you need ?
Thanks,
If you prefer, we'll drop .Show()
and go for .Activate()
.
form_scx.js
has FoxInCloud.formActivateObserve('realise_scx', …
, that's OK.
Issue is: form.activate()
fires for master forms, not for child forms.
Will send you by PM FoxInCloud.js
that should fix the issue.
Thanks
With pleasure, I'm waiting for the evolution
Received thank you. Very pleasant to be able to have such a reactivity.
Same behavior.
Voici le code retour:
<?xml version='1.0' encoding='UTF-8' standalone='yes'?><IntuiCat>
<Result><v>true</v><t>boolean</t></Result>
<script_>var $form = jQuery('#realise_scx');
if ($form.length){
var $title = $form.parent().parent().find('.modal-title '); $title.html($title.html().replace(/&nbsp;-<small><a\s+(\S+\s+)?title=".+/i, '') + '&nbsp;-<small><a id="realise_scx_caption_a" title="En cas d&#39;anomalie, cliquez pour la signaler par courriel à &#34;FoxInCloud App&#34; (&#34;xxx<support@xxx-info.com>&#34;)" tabindex="-1" href="javascript:void(0);">&nbsp;12:56:38 PM (serveur)&nbsp;<span class="fa fa-bullhorn" aria-hidden="true"></span></a></small>');;
jQuery('#realise_scx_caption_a').on('mousedown', function(event){event.stopPropagation();}).on('click', function(event){FoxInCloud.FormDisplay(event, 'vhcFrmFB', '"realise_scx", "12:56:38 PM (serveur)"');});
}</script_>
<UserID>56117J6RA</UserID>
<reqID>1457_56A0RQRF2-001</reqID>
<ServerVersion>2.26.2-beta.5</ServerVersion>
<ServerTimeStamp>{^2018-04-03 04:52:01 PM}</ServerTimeStamp>
<AppTime>0</AppTime>
<ServerTime>1.627408</ServerTime></IntuiCat>
can you post the JavaScript generated for this form? (should be near the end of form_scx.js, no need to post JS for contained controls)
this is important:
…
FoxInCloud.formActivateObserve('form_scx', …);
…
FoxInCloud.documentInit('form_scx');
…
jQuery('#realise_scx-fermer').prop('effectShow', true).prop('effectHide', true);
FoxInCloud.formActivateObserve('realise_scx', 'jQuery.notify({title: "<b>Finalisation du compromis</b>:",message: "Compromis réalisé - Vous pouvez encore annuler votre option pour choisir un partenaire",icon: "fa fa-info-circle"},{type: "info", element: "#realise_scx"})', false);
jQuery('#realise_scx').prop('wuValue ', null);
FoxInCloud.documentInit('realise_scx');
jQuery('#realise_scx').prop('effectShow', true).prop('effectHide', true);
jQuery('#realise_scx-acte').on('click', jQuery.proxy(FoxInCloud.LeftClick, FoxInCloud, undefined, false));
should work… sure you hit F5 to make sure you reload foxincloud.js
?
if you seek XBrowserFix:
in foxincloud.js
in browser tools, you should see:
XBrowserFix: function ( // Adapte la présentation d'un élément au browser
elt // [document] élément ou son identifiant
, member // [false] élément membre d'un formulaire
, master // [false] formulaire maître
)
Yes and yes.
And now, on click, I have only the title of notify(), no longer the text (Mprompt, public variable)
thank you for ignoring my second sentence
I'm lost -- does it work, yes, no, in which condition?
no, as before. Nothing is displayed without a click
if you have no code to execute on the server, code should be
lparameters uselessParm && {en} doc in Parent Code {fr} doc dans le code parent
IF (Type('m.thisForm.wlHTMLgen') == 'L' AND m.thisForm.wlHTMLgen)
RETURN THISFORM.wNotify(Mprompt, "Finalisation du compromis", 64)
ENDIF
Vincent,
We are releasing V 2.26.2-beta.6
which should solve the whole issue.