FoxInCloud
JS in Activate()
Gravatar is a globally recognized avatar based on your email address. JS in Activate()
  Vincent H.
  All
  Apr 6, 2018 @ 01:54am

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()

Gravatar is a globally recognized avatar based on your email address. re: JS in Activate()
  FoxInCloud Support - Thierry N.
  Vincent H.
  Apr 6, 2018 @ 08:14am

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)

Gravatar is a globally recognized avatar based on your email address. re: JS in Activate()
  Vincent H.
  FoxInCloud Support - Thierry N.
  Apr 6, 2018 @ 02:37pm

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)}
});

Gravatar is a globally recognized avatar based on your email address. re: JS in Activate()
  Vincent H.
  Vincent H.
  Apr 7, 2018 @ 03:54am

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 ''

Gravatar is a globally recognized avatar based on your email address. re: JS in Activate()
  FoxInCloud Support - Thierry N.
  Vincent H.
  Apr 9, 2018 @ 07:03am

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

Gravatar is a globally recognized avatar based on your email address. re: JS in Activate()
  Vincent H.
  FoxInCloud Support - Thierry N.
  Apr 9, 2018 @ 08:05am

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.

Gravatar is a globally recognized avatar based on your email address. re: JS in Activate()
  FoxInCloud Support - Thierry N.
  Vincent H.
  Apr 9, 2018 @ 08:29am

As .Show() is a method, just add the wNotify script:
thisform.wcScriptJSadd(thisform.wnotify(…))

Gravatar is a globally recognized avatar based on your email address. re: JS in Activate()
  Vincent H.
  FoxInCloud Support - Thierry N.
  Apr 9, 2018 @ 09:51am

Same behavior with your code (+ dodefault ()) in Show ()

Gravatar is a globally recognized avatar based on your email address. re: JS in Activate()
  FoxInCloud Support - Thierry N.
  Vincent H.
  Apr 9, 2018 @ 10:59am

"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…
Gravatar is a globally recognized avatar based on your email address. re: JS in Activate()
  Vincent H.
  FoxInCloud Support - Thierry N.
  Apr 9, 2018 @ 02:52pm

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(/&#38;nbsp;-&#60;small&#62;&#60;a\s+(\S+\s+)?title=".+/i, '') + '&#38;nbsp;-&#60;small&#62;&#60;a id="realise_scx_caption_a" title="En cas d&#38;#39;anomalie, cliquez pour la signaler par courriel à &#38;#34;FoxInCloud App&#38;#34; (&#38;#34;xxx&#60;support@xxx-ino.com&#62;&#38;#34;)" tabindex="-1" href="javascript:void(0);"&#62;&#38;nbsp;11:26:51 PM (serveur)&#38;nbsp;&#60;span class="fa fa-bullhorn" aria-hidden="true"&#62;&#60;/span&#62;&#60;/a&#62;&#60;/small&#62;');;
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 ?

Gravatar is a globally recognized avatar based on your email address. re: JS in Activate()
  FoxInCloud Support - Thierry N.
  Vincent H.
  Apr 10, 2018 @ 03:25am

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

Gravatar is a globally recognized avatar based on your email address. re: JS in Activate()
  Vincent H.
  FoxInCloud Support - Thierry N.
  Apr 10, 2018 @ 03:36am

With pleasure, I'm waiting for the evolution

Gravatar is a globally recognized avatar based on your email address. re: JS in Activate()
  Vincent H.
  Vincent H.
  Apr 10, 2018 @ 04:14am

Received thank you. Very pleasant to be able to have such a reactivity.

Gravatar is a globally recognized avatar based on your email address. re: JS in Activate()
  Vincent H.
  Vincent H.
  Apr 10, 2018 @ 04:17am

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(/&#38;nbsp;-&#60;small&#62;&#60;a\s+(\S+\s+)?title=".+/i, '') + '&#38;nbsp;-&#60;small&#62;&#60;a id="realise_scx_caption_a" title="En cas d&#38;#39;anomalie, cliquez pour la signaler par courriel à &#38;#34;FoxInCloud App&#38;#34; (&#38;#34;xxx&#60;support@xxx-info.com&#62;&#38;#34;)" tabindex="-1" href="javascript:void(0);"&#62;&#38;nbsp;12:56:38 PM (serveur)&#38;nbsp;&#60;span class="fa fa-bullhorn" aria-hidden="true"&#62;&#60;/span&#62;&#60;/a&#62;&#60;/small&#62;');;
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>
Gravatar is a globally recognized avatar based on your email address. re: JS in Activate()
  FoxInCloud Support - Thierry N.
  Vincent H.
  Apr 10, 2018 @ 04:22am

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');
…
Gravatar is a globally recognized avatar based on your email address. re: JS in Activate()
  Vincent H.
  FoxInCloud Support - Thierry N.
  Apr 10, 2018 @ 04:55am
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));

Gravatar is a globally recognized avatar based on your email address. re: JS in Activate()
  FoxInCloud Support - Thierry N.
  Vincent H.
  Apr 10, 2018 @ 05:08am

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
  )
Gravatar is a globally recognized avatar based on your email address. re: JS in Activate()
  Vincent H.
  FoxInCloud Support - Thierry N.
  Apr 10, 2018 @ 06:11am

Yes and yes.

And now, on click, I have only the title of notify(), no longer the text (Mprompt, public variable)

Gravatar is a globally recognized avatar based on your email address. re: JS in Activate()
  Vincent H.
  Vincent H.
  Apr 10, 2018 @ 06:18am

thank you for ignoring my second sentence

Gravatar is a globally recognized avatar based on your email address. re: JS in Activate()
  FoxInCloud Support - Thierry N.
  Vincent H.
  Apr 10, 2018 @ 06:38am

I'm lost -- does it work, yes, no, in which condition?

Gravatar is a globally recognized avatar based on your email address. re: JS in Activate()
  Vincent H.
  FoxInCloud Support - Thierry N.
  Apr 10, 2018 @ 07:57am

no, as before. Nothing is displayed without a click

Gravatar is a globally recognized avatar based on your email address. re: JS in Activate()
  FoxInCloud Support - Thierry N.
  Vincent H.
  Apr 10, 2018 @ 12:08pm

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
Gravatar is a globally recognized avatar based on your email address. re: JS in Activate()
  FoxInCloud Support - Thierry N.
  Vincent H.
  Apr 11, 2018 @ 05:48am

Vincent,

We are releasing V 2.26.2-beta.6 which should solve the whole issue.

Gravatar is a globally recognized avatar based on your email address. re: JS in Activate()
  Vincent H.
  FoxInCloud Support - Thierry N.
  Apr 11, 2018 @ 08:30am

It's perfect ! Thanks

© 1996-2024