Roger Keays wrote:
Hi Bill,
I had no problem with it, what kind of tree behavior are you looking for?
lazy loading? ajax expend-collapse? clickable treenode that does ajax
request? etc
I'm looking for AJAX expand-collapse when the +/- icon is clicked. It
would be okay if the entire tree was refreshed, just not the entire page!
Okay, so the trick is to use showNav="false" and make your own
navigation togglers with an a4j:commandLink. It works, but it is
difficult to make the new links look just like the originals. I gave it
a shot (see below), but it still looks pretty ugly.
Perhaps a better solution would be a new tree2 attribute called
'a4jToggle', which when set to true puts in the magic a4j javascript
(not sure exactly what that looks like) instead of the standard js.
<t:tree2 value="#{dao.treeModel}" id="tree" var="node"
showNav="false" clientSideToggle="false"
varNodeToggler="t">
<f:facet name="content">
<h:panelGroup>
<a4j:commandLink action="#{t.toggleExpanded}" reRender="tree"
rendered="#{!node.leaf}">
<h:graphicImage
value="/faces/myFacesExtensionResource/org.apache.myfaces.renderkit.html.util.MyFacesResourceLoader/11588409/tree2.HtmlTreeRenderer/images/nav-#{t.nodeExpanded
? 'minus' : 'plus'}-line-middle.gif"
style="border: 0px;"/>
</a4j:commandLink>
<h:graphicImage
value="/faces/myFacesExtensionResource/org.apache.myfaces.renderkit.html.util.MyFacesResourceLoader/11588409/tree2.HtmlTreeRenderer/images/line-middle.gif"
rendered="#{node.leaf}" style="border: 0px;"/>
<h:outputText value="#{node.uri}"/>
</h:panelGroup>
</f:facet>
</t:tree2>
One other thing though.. I see lots of references to AJAX lazy loading.
What is that supposed to mean? AFAICT tree2 supports lazy loading out of
the box, and it has nothing to do with AJAX. Just set
clientSideToggle="false".
Cheers,
Roger
Hi there,
Does anybody have experience integrating ajax4jsf with MyFaces' tree2
component? I can't see anything in ajax4jsf that will work out of the
box (a4j:support, a4j:region and a4j:form don't do the trick).
Cheers,
Roger
--
----------------------------------------
Ninth Avenue Software
p: +61 7 3137 1351 (UTC +10)
f: +61 7 3102 9141
w: http://www.ninthavenue.com.au
e: [EMAIL PROTECTED]
----------------------------------------