Kris Schneider wrote the following on 10/21/2004 4:16 PM:
Right, got it. The problem is in the DelimItems.tag file.

I'm still confused:) Here's the DelimItems tag file:

(had this all one line but broker out the imports as shown)
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core";
%><%@ attribute name="items" required="true" type="java.util.Collection"
%><%@ attribute name="preDelim"
%><%@ attribute name="postDelim"
%><%@ attribute name="property" required="true"
%><%@ attribute name="includeFirst" type="java.lang.Boolean"
%><%@ attribute name="includeLast" type="java.lang.Boolean"
%><c:if test='${preDelim == null && postDelim == null}'><c:set var='postDelim' value=', '/></c:if><c:forEach items='${items}' var='item' varStatus='status'><c:if test='${preDelim != null && ( includeFirst || !status.first )}'>${preDelim}</c:if>${item[property]}<c:if test='${postDelim != null && ( includeLast || !status.last )}'>${postDelim}</c:if></c:forEach>


Here's the exact line that calls it (all one line):

<span style="cursor:hand;" onmouseover="return overlib('<tags:DelimItems items="${associate.additionalServices}" property="code" postDelim=" ,"/>');" onmouseout="return nd();">*<c:out value='${associate.primaryService.code}' default='N/A'/></span>

What I'm confused at is when you say "the prolbme is IN the DelimItems.tag file? I've had the file all is one complete line with no returns but will still get a break in the JSP where it's used. I'm sure I'm missing something obvious here:)

Here's something that
might trip you up. This tag file ("EOF" is just the end-of-file marker so it's
explicit in the example, it's not really in the tag file):

<%@ tag body-content="scriptless" %><%--
--%><%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"; %><%--
--%><c:forEach var="s" items="0,1,2,3">
${s}
</c:forEach>EOF

Will produce:

Tag output: '
0

1

2

3
'

But this tag file:

<%@ tag body-content="scriptless" %><%--
--%><%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"; %><%--
--%><c:forEach var="s" items="0,1,2,3"><%--
--%>${s} <%--
--%></c:forEach>EOF

Will produce:

Tag output: '0 1 2 3 '

So be careful with your handling of nested tags...

Quoting Rick Reumann <[EMAIL PROTECTED]>:


Kris Schneider wrote the following on 10/21/2004 2:59 PM:

Nope (I tried it - it looks like your choice A), but your example really

isn't

any different than mine ;-). The ' is after the tag and it's still on the

same

line as the tag's output. Care to (re)post the tag file that's giving you

the

problem?

The problem is when I try to do:

(All of this on one line ...sorry for crummy wrapping. I can send as text if you want)

<span style="cursor:hand;" onmouseover="return overlib('<tags:DelimItems items="${associate.additionalServices}" property="code" postDelim=" ,"/>');" onmouseout="return nd();">*<c:out value='${associate.primaryService.code}' default='N/A'/></span>

The problem is in this part:

onmouseover="return overlib('<tags:DelimItems items="${associate.additionalServices}" property="code" postDelim=" ,"/>');"

The source looks like:

onmouseover="return overlib('foo,bar,foo,bar  <-- LINE BREAK!
');"

The Line Break above is what is messing up. The output of the Tag file(DelimItems) is fine, but the break it ends up giving at the end is what is messing it up (the same break you noticed in your code). Also, I don't want to make the tag file javascript specific since I use this tag for other html output which is fine. I could of course make a modified tag or pass in a param to produce the javascript from the tag file. That might not be a bad option but still sort of annoying.

--
Rick




--
Rick

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to