I used the following, and it always sends the last node's id to me. no matter which node I selected.
<rich:tree style="width:300px"
value="#{desktopBean.templateRoot}"
var="item" nodeFace="leaf">
<rich:treeNode type="leaf"
onselected="saveFolderSelection();">
<a4j:jsFunction name="saveFolderSelection">
<a4j:actionparam name="folderPath"
value="#{item.id}"
assignTo="#{desktopBean.folderPath}"
noEscape="false"/>
</a4j:jsFunction>
<h:outputText value="#{item.name}"/>
</rich:treeNode>
</rich:tree>