Topic
  • 2 replies
  • Latest Post - ‏2013-08-16T16:48:56Z by george.baker
george.baker
george.baker
337 Posts

Pinned topic Macro - Extract to indexed Global Variable

‏2013-08-15T19:15:46Z |

I have a macro that loops and does an extract to a global variable with the Append this new value after the last index of the existing value.  The macro runs as expected.  However, it appears that a trailing blank is added on the last index which causes a problem later.

We can see the trailing blank when we insert the following code in JSP:

<input type="hidden" id="result_Names" value="<%= ((TransformInfo)request.getAttribute(CommonConstants.REQ_TRANSFORMINFO)).getGlobalVariable("sBorrower1Name", true).getString("~") %> ">

 

The browser source shows (notice the blank before the ending quote):

<input type="hidden" id="loanNumbers" value="0596493724~0596826930~0603630930 ">

Anyone know why this is occurring and how to avoid it?

  • tmparker
    tmparker
    534 Posts

    Re: Macro - Extract to indexed Global Variable

    ‏2013-08-16T16:03:43Z  

    Based on the code you showed above the space is a result of the code you wrote. It appears you added a spaces after the JSP tag and before the closing double quote.  That is why you would have a space in the result.

    Thanks

    Tim

  • george.baker
    george.baker
    337 Posts

    Re: Macro - Extract to indexed Global Variable

    ‏2013-08-16T16:48:56Z  
    • tmparker
    • ‏2013-08-16T16:03:43Z

    Based on the code you showed above the space is a result of the code you wrote. It appears you added a spaces after the JSP tag and before the closing double quote.  That is why you would have a space in the result.

    Thanks

    Tim

    What you said sounds reasonable, so I tested it.  Here is the new <input> statement, and it yields the same result:

    <input type="hidden" id="result_Names" value="<%=((TransformInfo)request.getAttribute(CommonConstants.REQ_TRANSFORMINFO)).getGlobalVariable("sBorrower1Name", true).getString("~")%>">

    I've rebuilt and redeployed and I get the same result.  This is more of an annoyance than a show stopper, but I don't understand why?