You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 3 Next »

Finally, here is an example of a modified SHARED layout function that changes the font of all fields on the form to use 8pt Arial. The example loop used earlier in SHARED.ApplyStandardLayout could be changed to be like this example:
 
/* Get all elements between lines 3 and 22 */
 
<span style="color: #0000ff">var</span> aH = HTMLAPI.getElementsinRowRange(3,22);
 
/* Hide all fields containing "+" signs and strip trailing dots from others */
       
<span style="color: #0000ff">for</span> (i = 0; i < aH.length; i++ )
{
<span style="color: #0000ff">   var</span> oH = aH[i];
 
<span style="color: #0000ff">   if</span> ((oH != <span style="color: #0000ff">null</span>) && (<span style="color: #0000ff">typeof</span>(oH.tagName) != <span style="color: #a31515">"undefined"</span>))
   {
     <span style="color: #0000ff">var</span> fIsINPUTField = ((oH.tagName == <span style="color: #a31515">"INPUT"</span>) || (oH.tagName == <span style="color: #a31515">"TEXTAREA"</span>));
         
     <span style="color: #0000ff">if</span> (fIsINPUTField) HTMLAPI.applyFont(oH,<span style="color: #a31515">"Arial"</span>,<span style="color: #a31515">"7pt"</span>);
     <span style="color: #0000ff">else</span>
     {
        <span style="color: #0000ff">if</span> (oH.innerText == <span style="color: #a31515">"+"</span>) HTMLAPI.hideElement(oH);
        <span style="color: #0000ff">else</span>
        {
           HTMLAPI.stripTrailingDots(oH);
           HTMLAPI.applyFont(oH, <span style="color: #a31515">"Arial"</span>,<span style="color: #a31515">"8pt"</span>);
        }
     }  
   }
}
 
The resulting 5250 screen now looks like this:
 
  
 
It started out as:
 

 
[<span style="color: #0000ee"><span style="text-decoration: underline; ">Show Contents List</span></span>|../../index.htm#lansa/lansa050_1045.htm]

  • No labels