webtier@glassfish.java.net

Re: [webtier] JSF2: using JavaScript to update a component

From: <webtier_at_javadesktop.org>
Date: Wed, 07 Oct 2009 14:48:55 PDT

Finished the code trace, and yep, that's what happening.

Since I don't expect there to be a script tag after the element for update, the behavior is inconsistent, and I'm inclined not to change that unless there's a good use case.

In your case, putting the script tag inside the div should fix everything.

The next question is, is this required by the spec? Well, I think it's vague:
--------------
# For any other <update> element:

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

Find the DOM element with the identifier that matches the <update> element identifier, and replace its contents with the <update> element's CDATA contents.
---------------

While that [b]seems[/b] to imply that you can update with multiple elements on first reading, it actually doesn't say that at all - since the update action itself needs to apply to a single element - which implies only a single element as a CDATA argument.

I'll file the spec bug for clarification once java.net decides to visit the waking world again.

In the meantime, please let me know if this doesn't fix your problem... We're almost at ship, and I'm eager to get any bug reports early - I'd love to ship something as rock solid as possible. (And thanks for reporting this.)
[Message sent by forum member 'driscoll' (jim.driscoll_at_sun.com)]

http://forums.java.net/jive/thread.jspa?messageID=367175