[jsr-314-open] Wrapping Text with a tag - what's the correct behavior?

Jim Driscoll Jim.Driscoll at SUN.COM
Tue Jun 16 13:39:17 EDT 2009


Currently, when we wrap text in tag, like h:outputText, we get output 
like this in mojarra:


<h:outputText id="foo" value="value">text!</h:outputText>

gives:

text!<span id="foo">value</span>


Eww.  But, AFAICT, unspec'd, and we don't want you doing that, anyway. 
And it seems it's always done it this way.  (And to answer, yes, I 
occasionally make this mistake when I'm marking up a page - some sort of 
mental defect on my part, apparently.)

But when I then put an ajax tag there, like so:

<f:ajax>
<h:outputText id="foo" value="value">text!</h:outputText>
</f:ajax>

(not valid, think of this as pseudo-tag-code)

then I get:

text!<update id="foo">[CDATA[... span ]]</update>

Which, of course, is not a valid return - the text isn't allowed in the 
schema to be there.

So, I've got a few different things we can do, but my preferred solution 
is to ignore the wrapped text (i.e., don't traverse the children, don't 
output anything under foo) for the *ajax* case only, and leave it alone 
for the full response case, since I don't want to break any existing 
odd-looking code.

I'd repeat this for all components like outputText, I haven't done the 
homework yet there to see which components require it.

Thoughts?  I don't think we should bother spec'ing this behavior, but 
you may disagree.

Jim




More information about the jsr-314-open-mirror mailing list