Attached is a zip project of a JSF demo.
My goal is to effectively use the JSF 1.2 Reference Implementation, Facelets (latest version), DynaFaces, with markup written almost exclusively in HTML.
I wanted to demonstration internationalization, AJAX, the expression language, validation, but...well...quite didn't get there. You'll see.
According to the people that I have spoken with, Facelets and DynaFaces, or something very similar, will be incorporated into the JSF 2.0 specification.
I consider this great news, because Facelets allows for the HTML templating that people expect from Tapestry and Wicket. And DynaFaces provides
a toolkit to Ajax Enable plain ordinary JSF components.
If DynaFaces were part of the 2.0 Specification, component developers could concentrate on writing plain ordinary JSF components, and add AJAX functionality in a standardized manner, that would allow products such as IceFaces, RichFaces, (name JSF Ajax Framework here) to interoperate.
Since 1.0, 1.1, and 1.2 JSF Specifications did not address AJAX functionality directly, and vendors built their own AJAX solutions that did not interoperate.
My first version of this demo used had multiple forms in it, and this revealed a bug within the Facelets/DynaFaces combination in which ~facelets.VIEW_STATE~ was rendered in the HTML. This also affected the stability of the JSF application.
Sun provided me with a fix in DynaFaces that would make the problem go away. Yes, ~facelets.VIEW_STATE~ no longer appeared, but the AJAX response now had stacktraces in them, so it seemed as though something else was wrong.
I found a workaround. Just use one FORM (and wait for DynaFaces to mature and address this problem). Granted, this will make validation phase more difficult on complex pages.
Then I ran into another problem, which was part of our UI Requirements.
In my demo application, if you select a Sprocket:0, or any Sprocket for that matter, and then click the Add Snap Crackle Pop button, inputs will dynamically appear in a the footer of a dataGrid.
I cannot get my inputs, and actionListener for the "saveSnapCracklePop" button to be handled as an AJAX transaction on the dataGrid footer.
Am I doing something wrong? or is there another issue with DynaFaces?
----
On a side note, I am loosing the battle to push for the adoption of JSF in our next UI Web Application. We have Tapestry experienced developers who are convinced that Wicket is the right way to go.
I want to choose the technology that is best for the team though. I prefer JSF because of my previous experiences, and its wide industry support.
---
On another note, wouldn't it be nice if there was a domain specific language for writing JSF components? Facelets almost achieves this, but still forces developers to put code in a ManagedBean that truly belongs in a UIComponent. It must become easy to develope UIComponents through composition, that contain the logic that you would expect from a component encapsulated.
-M