Hi Andor,
I'm cc-ing your mail to the myfaces dev list (the place where such
issues are discussed) and kindly ask you to subscribe to that list.
See http://myfaces.apache.org/mail-lists.html for infos.
Regards,
Manfred


---------- Forwarded message ----------
From: Andor Greißl <[EMAIL PROTECTED]>
Date: Sat, Mar 29, 2008 at 8:18 PM
Subject: tomahawk tree2 suggestion
To: [EMAIL PROTECTED]


Hello Mr Geiler,
since I don't know whom I should contact about a suggestion for the
tree2 component, you became the first person I'll write.
After looking at the generated html of the tree2 component I wondered
why it wasn't using css, this would be a nice feature
since my first - try tree component took about 10 kbytes to transfer
it it had just two nodes and about 4 children.

Experimenting just a little with css (I'm not the css guru, I would
say I know what its good for...) -
thre resulting html code was about six times smaller

Here is what I did

1) take a look at the generated code for ONLY ONE child in the first node
    as you can see the image links are very long and even duplicated


<table cellpadding="0" cellspacing="0" border="0"><tr><td width="19"
height="100%" 
background="/Web/faces/myFacesExtensionResource/org.apache.myfaces.renderkit.html.util.MyFacesResourceLoader/12068063/tree2.HtmlTreeRenderer/images/line-trunk.gif"><img
src="/Web/faces/myFacesExtensionResource/org.apache.myfaces.renderkit.html.util.MyFacesResourceLoader/12068063/tree2.HtmlTreeRenderer/images/line-trunk.gif"
width="19" height="18" border="0" /></td><td width="19" height="100%"
valign="top" 
background="/Web/faces/myFacesExtensionResource/org.apache.myfaces.renderkit.html.util.MyFacesResourceLoader/12068063/tree2.HtmlTreeRenderer/images/line-trunk.gif"><img
id="t2" 
src="/Web/faces/myFacesExtensionResource/org.apache.myfaces.renderkit.html.util.MyFacesResourceLoader/12068063/tree2.HtmlTreeRenderer/images/line-middle.gif"
border="0" height="18" width="19" /></td><td><a href="#"
onclick="return
oamSubmitForm('menuform','menuform:clientTree:0:0:0:j_id23',null,[['docNum','']]);"
class="document"><img id="menuform:clientTree:0:0:0:j_id24"
src="/Web/img/document.png" border="0"
/>KontoauszŸge</a></td></tr></table>


2) play around with css to get the same results


#myfaces-tree2 table {border: 0;}
#myfaces_tree2 td.lt {width: 19px; height: 100%; background-image:
url(".../12068063/tree2.HtmlTreeRenderer/images/line-trunk.gif")}
#myfaces_tree2 td.ll {width: 19px; height: 100%; background-image:
url(".../12068063/tree2.HtmlTreeRenderer/images/line-last.gif")}
#myfaces_tree2 td.lm {width: 19px; height: 100%; background-image:
url(".../12068063/tree2.HtmlTreeRenderer/images/line-middle.gif")}
#myfaces_tree2 td.sp {width: 19px; height: 100%; background-image:
url(".../12068063/tree2.HtmlTreeRenderer/images/spacer.gif")}
#myfaces_tree2 td.nmlm {width: 19px; height: 100%; background-image:
url(".../12068063/tree2.HtmlTreeRenderer/images/nav-minus-line-middle.gif")}
#myfaces_tree2 td.nmlp {width: 19px; height: 100%; background-image:
url(".../12068063/tree2.HtmlTreeRenderer/images/nav-plus-line-middle.gif")}
#myfaces_tree2 a.document {height: 100%; padding-left: 18px;
background: url(../img/document.png) no-repeat left top;}
#myfaces_tree2 td.nodefolder {height: 100%; padding-left: 18px;
background: url(../img/yellow-folder-open.png) no-repeat left top;}

Now the code of the tree with ALL THE NODES (javascript calls and ids
removed...)


<div id="myfaces_tree2">
<table cellpadding="0" cellspacing="0"><tr><td class="nmlm"><a
href="#"/></td><td class="nodefolder">Admin</td></tr></table>
<table cellpadding="0" cellspacing="0"><tr><td class="lt"/><td
class="lm"/><td><a href="#"
class="document">Users</a></td></tr></table>
<table cellpadding="0" cellspacing="0"><tr><td class="lt"/><td
class="ll"/><td><a href="#"
class="document">Customers</a></td></tr></table>
<table cellpadding="0" cellspacing="0"><tr><td class="nmlm"><a
href="#"/></td><td class="nodefolder">User</td></tr></table>
<table cellpadding="0" cellspacing="0"><tr><td class="sp"/><td
class="lt"/><td><a href="#"
class="document">J010002</a></td></tr></table>
<table cellpadding="0" cellspacing="0"><tr><td class="sp"/><td
class="lt"/><td><a href="#"
class="document">J030047</a></td></tr></table>
<table cellpadding="0" cellspacing="0"><tr><td class="sp"/><td
class="ll"/><td><a href="#"
class="document">F030112</a></td></tr></table>
</div>


I think this could be a nice enhancement to the tree2, I even made a
version that uses no tables just ol/li/span elements. The code above
was generatd within a jsf backing bean.



Ok, maybe you like to read on - Ive created nice components that have
an annotation based functionality. Maybe this could fit into the
myfaces implementation
(it's about auto generating tables and forms from annotated beans).

I'm looking forward to hearing from  you soon,

Best regards
Andor Greissl

Reply via email to