Thanks for the advice, Matej. I've upgraded to Wicket 1.3 and the LinkTree
lays out much nicer.
That said, I actually was able to adjust the width by using CSS:
1. Create a CSS file in the same package as the HTML file.
2. Use a span tag in the HTML for the tree (when the HTML is generated by
Wicket, the span tag will become a div tag and get a class of
"wicket-tree").
3. In the CSS file, make a setting for the width for the "wicket-tree"
class.
4. In the Java code, add this line:
tree.add(HeaderContributor.forCss(TreePage.class, cssFilename));
This is obviously not ideal since I had to look in the generated HTML to see
the "wicket-tree" class. Also, if you use a div tag (instead of a span tag),
the class doesn't show up.
David
Matej Knopp-2 wrote:
>
> Hi, unfortunately the Tree class is not able to grow horizontally,
> neither it is possible for it to have a horizontal scrollbar. If you
> need this features, you have to use the new LinkTree (or it's
> superclass BaseTree) from wicket 1.3.
>
> -Matej
>
> On 10/24/07, David Struck <[EMAIL PROTECTED]> wrote:
>> I've been able to get an AJAX tree up and running and I'm very happy
>> with how simple it was. My HTML is:
>>
>>
>>
>>
>>
>>
>>
>> and my Java is:
>>
>> ...
>> public TreePage() {
>> DefaultMutableTreeNode root = ...
>> TreeModel treeModel = new DefaultTreeModel(root);
>> Tree tree = new Tree("myTree", treeModel);
>> tree.getTreeState().collapseAll();
>> add(tree);
>> }
>> ...
>>
>> Now I'd like to improve the layout and I'm not sure how to do it. First
>> of all, the tree view seems to have a preset width that doesn't grow
>> when one of the tree nodes goes outside the width. How can I modify the
>> width of the tree view? Should I use CSS? And, if so, how do I hook my
>> CSS settings in?
>>
>> Second, can I move/remove the floating debugger link? And can anyone
>> provide a link to a tutorial/guide that explains how to tweak pre-built
>> components? Hopefully that will get me moving in the right direction.
>>
>> Thanks,
>>
>> David
>>
>> -
>> To unsubscribe, e-mail: [EMAIL PROTECTED]
>> For additional commands, e-mail: [EMAIL PROTECTED]
>>
>>
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>
>
--
View this message in context:
http://www.nabble.com/Configuring-AJAX-tree-tf4687105.html#a13430342
Sent from the Wicket - User mailing list archive at Nabble.com.
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]