- The 2 JS files were not included
- fix: manually call the tomahawk API to add the two resources manually:
AddResource.addJavaScriptToHeader(HtmlTreeRenderer.class,
"_javascript_/tree.js", context);
AddResource.addJavaScriptToHeader(HtmlTreeRenderer.class,
"_javascript_/cookielib.js", context); - Facelets was not able to set the correct parameters on the tree2 as tree2's tag's properties were not the same as the UI component attributes.
- Fix is posted on the MyFaces wiki about getting tomahawk to work with facelets
- tree2 uses f:param support to identify nodes that are being expanded. This needs (in myfaces) <input type="hidden" /> tags for each of those parameters
- fix: Wrap an ajax anywhere span around all those tags and scripts that are rendered by
HtmlFormRenderer.java in MyFaces 1.1.1 (which involved some nice string parsing). I extended this renderer and buffered the output of the encodeBegin and encodeEnd and moved any hidden elements and any script tags into a span tag using the AAUtils functions to make sure it was rendered correctly.
AjaxAnywhere handles script tags specially when the request is an AJAX request. It parses out the script tags and then executes an "eval" on the JS client side. Best thing there is to just look into aa.js. Other than that, I'm not sure what could be your problem. Hard to say since you are not using the tree2 out of the box.
-Andrew
On 4/11/06,
Bill Schneider <[EMAIL PROTECTED]> wrote:
> I have it working with MyFaces 1.1.1 but had to do some work arounds
> (some messy). What does your XHTML (or JSP) looking like with the
> aa:zoneJSF and t:tree2 nodes? Let me know that and I'll see if I can
> help you out.
I should point out that I am overloading the tree2 component with some
table function as well, like t:tree/t:treeColumn, as others have
discussed previously on this list. That may be the crux of the issue,
but I'm not exactly sure why it would break anything because the basic
tree2 functionality is the same; it just renders as table rows.
Besides that, this should be fairly vanilla MyFaces/AjaxAnywhere
integration; I am putting the zoneJSF tag around my whole tree component:
<aa:zoneJSF id="treeZone">
<xxx:tree2Table ...>
<h:column...>
<h:commandLink ....>
<xxx:treeColumn...>
then later, I have a script to set up the zone and substitute for the
form submission function, since the tree is within a form with commandLinks.
<script>
ajaxAnywhere.setZonesToRefresh = function() {
return "treeZone";
}
ajaxAnywhere.formName = "myForm";
ajaxAnywhere.substituteFormSubmitFunction();
ajaxAnywhere.substituteSubmitButtonsBehavior(true);
</script>
It appears to be making the request and receiving the response, but the
response HTML looks 'cut off'. It appears to get as far as
<script src="">and that's the end of it.
debugging the response, I wonder if AjaxAnywhere is getting tripped up
by the HTML comment immediately following that <script> tag ("<!-- \n //
-->"), because it is not showing the following reference to cookielib.js
that I would expect either.
-- Bill
--
Bill Schneider
Chief Architect
Vecna Technologies
5004 Lehigh Rd.
College Park, MD 20740
[EMAIL PROTECTED]
t: 240-737-1640
f: 301-699-3180

