<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0">
<channel>
<title>Efficy Overflow Q&amp;A - Recent questions tagged case-study</title>
<link>https://overflow.efficy.io/?qa=tag/case-study</link>
<description>Powered by Question2Answer</description>
<item>
<title>Case study - Macro OnArgument and switch</title>
<link>https://overflow.efficy.io/?qa=511/case-study-macro-onargument-and-switch</link>
<description>&lt;p&gt;Here is a small case study (on the demand on our R&amp;amp;D) :&lt;/p&gt;

&lt;p&gt;One of our partners was wondering what was conditioning the display on the mass Update button :&lt;/p&gt;

&lt;p&gt;macros/MacroGridtool.txt - line 49 (of build R6100)&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;&amp;lt;%OnArgument(ArgValue='$_context$', condition='case', D=' ', S=' ', else='%%Macro(&quot;CmdGridMenuItemMassUpdate&quot;)')%&amp;gt; 
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;When OnArgument takes the value 'case', a switch is performed. So in our case, if the Argument '$_context$ takes the value 'D' or 'S', the value ' ' will be returned. Otherwise we return the macro CmdGridMenuItemMassUpdate.&lt;/p&gt;

&lt;p&gt;we can see line 8 that &lt;code&gt;$_context$&lt;/code&gt; is declared as &lt;code&gt;$_context$=$context$&lt;/code&gt; :&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;GridCommandsBasic {[&amp;lt;%Macros('CmdGridNavigate;CmdGridMenu;CmdGridRemoveFilterGroup;CmdGridTextSearch;CmdGridScriptsTemp', $_context$=$context$)%&amp;gt;]}
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;we can perform a search in the Efficy folder with $context$='D' (Dialog) and $context$='S' (Search) to see in which places the Mass Update will not be displayed.And we can see that 4 dialog pages and the Search page are concerned.&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;C:\inetpub\wwwroot\Efficy2014Juin\efficy\pages\dialog\InstantDoc.htm:
   42                       &amp;lt;ul id=&quot;cmd-grid-menu&quot; class=&quot;button-group toolbar small grid&quot; data-channel=&quot;entitylist/tools&quot;&amp;gt;
   43                           &amp;lt;%Macro('CmdFieldDetail')%&amp;gt;
   44:                          &amp;lt;%Delay(1)%&amp;gt;Macro('GridCommandsBasic', $context$='D')%&amp;gt;
   45                       &amp;lt;/ul&amp;gt;
   46                   &amp;lt;/div&amp;gt;

C:\inetpub\wwwroot\Efficy2014Juin\efficy\pages\dialog\Query.htm:
   33                       &amp;lt;ul id=&quot;cmd-grid-menu&quot; class=&quot;button-group toolbar small grid&quot; data-channel=&quot;entitylist/tools&quot;&amp;gt;
   34                           &amp;lt;%Macro('CmdFieldDetail')%&amp;gt;
   35:                          &amp;lt;%Delay(1)%&amp;gt;Macro('GridCommandsBasic', $context$='D')%&amp;gt;
   36                       &amp;lt;/ul&amp;gt;
   37                   &amp;lt;/div&amp;gt;

C:\inetpub\wwwroot\Efficy2014Juin\efficy\pages\dialog\QueryResult.htm:
   36                       &amp;lt;ul id=&quot;cmd-grid-menu&quot; class=&quot;button-group toolbar small grid&quot; data-channel=&quot;entitylist/tools&quot;&amp;gt;
   37                           &amp;lt;%Macro('CmdFieldDetail')%&amp;gt;
   38:                          &amp;lt;%Delay(1)%&amp;gt;Macro('GridCommandsBasic', $context$='D')%&amp;gt;
   39                       &amp;lt;/ul&amp;gt;
   40                   &amp;lt;/div&amp;gt;

 C:\inetpub\wwwroot\Efficy2014Juin\efficy\pages\dialog\Template.htm:
   31                       &amp;lt;ul id=&quot;cmd-grid-menu&quot; class=&quot;button-group toolbar small grid&quot; data-channel=&quot;entitylist/tools&quot;&amp;gt;
   32                           &amp;lt;%Macro('CmdFieldDetail')%&amp;gt;
   33:                          &amp;lt;%Delay(1)%&amp;gt;Macro('GridCommandsBasic', $context$='D')%&amp;gt;
   34                       &amp;lt;/ul&amp;gt;
   35                   &amp;lt;/div&amp;gt;

C:\inetpub\wwwroot\Efficy2014Juin\efficy\pages\search\SearchResult.htm:
   13               &amp;lt;ul class=&quot;button-group toolbar small grid&quot; data-channel=&quot;entitylist/tools&quot;&amp;gt;
   14                   &amp;lt;%OnArgument('METHOD', condition='case',
   15:                      SEARCHFILE=`&amp;lt;%OnDependency('DTSEARCH', then='&amp;lt;%Delay(1)%&amp;gt;Macro('GridCommandsBasic', $context$='S')%&amp;gt;', else=' ', nolicense=' ')%&amp;gt;`,
   16:                      SEARCHFILENAME=`&amp;lt;%Delay(1)%&amp;gt;Macro('GridCommandsBasic', $context$='S')%&amp;gt;`,
   17                       else=`&amp;lt;%Delay(1)%&amp;gt;Macro('GridCommandsFull')%&amp;gt;`
   18                   )%&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;I hope that it will help.&lt;/p&gt;

&lt;p&gt;Geoffrey&lt;/p&gt;
</description>
<category>Efficy/ Client side</category>
<guid isPermaLink="true">https://overflow.efficy.io/?qa=511/case-study-macro-onargument-and-switch</guid>
<pubDate>Fri, 17 Jul 2015 10:16:18 +0000</pubDate>
</item>
</channel>
</rss>