Topic
IC4NOTICE: developerWorks Community will be offline May 29-30, 2015 while we upgrade to the latest version of IBM Connections. For more information, read our upgrade FAQ.
2 replies Latest Post - ‏2013-08-16T16:48:56Z by george.baker
george.baker
george.baker
314 Posts
ACCEPTED ANSWER

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
    518 Posts
    ACCEPTED ANSWER

    Re: Macro - Extract to indexed Global Variable

    ‏2013-08-16T16:03:43Z  in response to george.baker

    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
      314 Posts
      ACCEPTED ANSWER

      Re: Macro - Extract to indexed Global Variable

      ‏2013-08-16T16:48:56Z  in response to tmparker

      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?