If you use the "Display page source" feature of your browser on both those pages, I think you'll see that the actual ID attributes of the JSF and div components are not quite the same.
A lot the of modern-day software development platforms are designed to permit parcelling out work to those with the best aptitude for it. A lot of modern-day business is predicated on making one person do all the work, regardless of aptitude.
nimo frey
Ranch Hand
Joined: Jun 28, 2008
Posts: 565
posted
0
I was looking at the html-source (via firebug) and cannot find a different ID:
ajax works with id h:panelGrid.
I replaced h:panelGrid with div (which has the same id):
and then I get this error:
Looking at the "Component Tree", it shows me my div:
This message was edited 3 times. Last update was at by nimo frey
Not as strange as you think. Take a look at the HTML generated for a JSF control. You should see that the HTML ID for "grid" is actually something more like "formId:grid". That's because JSF supports something called "naming containers".
Which brings up a point. I hope you've got your commandButton in a JSF form! Otherwise it won't work right.
nimo frey
Ranch Hand
Joined: Jun 28, 2008
Posts: 565
posted
0
I found the problem.
The problem lies in the JSF 2.0 specification:
JSF 2.0 AJAX-Tag can only update JSF-Tags and not HTML-Tags.
So we have to enclose HTML-Tags (which should be updated) by a JSF-Tag (such as h:panelGrid).