Running into the same kinds of issues almost a year after this post (using 
GWT 2.0.4)...
Need to set alt text and need to discern both tree selection and hierarchy 
with CSS turned off. 

This can be made more elegant but here is the strategy (some GWT Tree 
assumptions are made here)...
We are adding and OpenHandler and CloseHandler to the Tree. 
Each handler checks if the TreeItem has children then it has an expand or 
collapse (+/-) child image (may want to consider whether or not you have 
leaf images).

For each TreeItem with children,  item, whose <img> alt or title attributes 
you want to set, access its <img> tags:
NodeList<com.google.gwt.dom.client.Element> imgs =  
item.getElement().getElementsByTagName("img");

access the first Element in this set because this is the +/- img and set the 
attributes you want:
com.google.gwt.dom.client.Element elem = imgs.getItem(0);
elem.setAttribute("alt", "...");
elem.setAttribute("title", "...");

Our selected strategy is to append to the beginning of the selected 
TreeItem's text a selected character (ex. right-facing triangle). 

Still working on a solution to showing tree depth with CSS off.

-- 
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/google-web-toolkit/-/pEPcIV0iNEQJ.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.

Reply via email to