Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Wiki MarkupFinally, 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


var aH = ="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>

       

for (i = 0; i < (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"

{

   var oH = aH[i];


   if ((oH != null) && (typeof>typeof</span>(oH.tagName) != <span style= "color: #a31515">"undefined"</span>))

   \ {      <span style="color: #0000ff">var</span> fIsINPUTField =

     var fIsINPUTField = ((oH.tagName == <span style="color: #a31515"> "INPUT"</span>) || (oH.tagName == <span style= "color: #a31515">"TEXTAREA"</span>));

               <span style="color: #0000ff">if</span>

     if (fIsINPUTField) HTMLAPI.applyFont(oH,<span style="color: #a31515">"Arial"</span>,<span style="color: #a31515">"7pt"</span>);     

     else

     {

        if <span style="color: #0000ff">else</span>      \{         <span style="color: #0000ff">if</span> (oH.innerText == <span style= "color: #a31515">"+"</span>) HTMLAPI.hideElement(oH);         <span

        else

        {

           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:  

}


The resulting 5250 screen now looks like this:

Image Added

  

It started out as:


Image Added !worddavaf485e25f57cd86bb5b0fc63f3f1b1cc.png|height=32,width=32!      It started out as:   !worddavaf485e25f57cd86bb5b0fc63f3f1b1cc.png|height=32,width=32!   [<span style="color: #0000ee"><span style="text-decoration: underline; ">Show Contents List</span></span>|../../index.htm#lansa/lansa050_1045.htm]