Hi Ingrid,

the difference between Tree and TreeVirtual is that the latter only 
displays the nodes that are currently visible, making it very useful for 
structures with lots of entries, like a file system explorer for example.

In your code, you're using the "regular" Tree but are trying to use the 
getHierarchy method in your listener for the "changeSelection" event, 
which is a method of TreeVirtual. changeSelection's event data contains 
an array of selected tree nodes, so you can set your text field's value 
like this:

this.setValue(nodes[0].getLabel());

Some more hints:
* Since you're not using TreeVirtual, you can remove the 
qx.Class.include statement.
* Whatever "buttonRemove" is, it's not defined.
* The VBox Layout you're using doesn't support the "left" property, so 
you can't use that when adding widgets to commandFrame.


As for your second question, I'm afraid I don't know anything about PHP 
in general and its session handling in particular, so I can't help you 
there :(


Regards,
Daniel

Ingrid Lohmann schrieb:
> Hi,
> 
> at the I'm developing an application with a filebrowser-like interface. In 
> the left Window I have an explorer-like root-directory and in the "main" 
> right window "reports" are supposed to shown (generated out of a database). 
> 
> With the following code I tried to find a way to control the right window by 
> clicking in the left root directory ... but it didn't work.
> 
> Of course its possible to achieve this by using 
> "qx.ui.treevirtual.TreeVirtual"
> 
> but I like the look and and feel of "TreeFolder" and "TreeFile"
> ... so I just have difficulties with the event handling.
> 
> --------begin code---------
> 
> qx.Class.define("custom.Application",
> {
>   extend : qx.application.Standalone,
> 
>   members :
>   {
>     main : function()
>     {
>       this.base(arguments);
>       // We want to use some of the high-level node operation convenience
>       // methods rather than manually digging into the TreeVirtual helper
>       // classes.  Include the mixin that provides them.
>       qx.Class.include(qx.ui.treevirtual.TreeVirtual,
>                        qx.ui.treevirtual.MNode);
> 
>       // Use an HBox to hold the tree and the groupbox
>       var hBox = new qx.ui.container.Composite(new qx.ui.layout.HBox(20));
>       this.getRoot().add(hBox, { edge : 30 });
> 
> 
> 
>       // CREATING THE TREE
>       var tree = new qx.ui.tree.Tree().set({
>         width : 200,
>         height : 800
>       });
> 
>       // Creat a folder and set it the root folder
>       var root = new qx.ui.tree.TreeFolder("root");
>       tree.setRoot(root);
> 
>       // Create some folders:
>       var te1_1 = new qx.ui.tree.TreeFolder("Files");
>       var te1_2 = new qx.ui.tree.TreeFolder("Workspace");
>       var te1_3 = new qx.ui.tree.TreeFolder("Network");
>       var te1_4 = new qx.ui.tree.TreeFolder("Trash");
> 
>       // Create some content (leaves) and add it to the "Files" folder:
>       var te1_2_1 = new qx.ui.tree.TreeFile("Windows (C:)");
>       var te1_2_2 = new qx.ui.tree.TreeFile("Documents (D:)");
>       te1_2.add(te1_2_1, te1_2_2);
> 
> 
>       var te1_2_1_1 = new qx.ui.tree.TreeFile("Eigene Dateien");
>       te1_2_1_1.addListener("execute", function(e) 
>         {
>           alert("Hello AntiWorld!");
>         }
>       )
> 
>       te1_2_1.add(te1_2_1_1);
> 
>       // Add the content to the root folder
>       root.add(te1_1, te1_2, te1_3, te1_4);
> 
> 
>       // Add the root widget to the appliation
>   
>       hBox.add(tree);
> 
>       var commandFrame = new qx.ui.groupbox.GroupBox("Control");
>       commandFrame.setLayout(new qx.ui.layout.VBox(2));
> 
>       hBox.add(commandFrame);
> 
> 
>       var o = new qx.ui.basic.Atom("Current Selection: ");
>       commandFrame.add(o, { left: 0, top: 6 });
> 
>       o = new qx.ui.form.TextField();
>       o.set({ readOnly: true });
>       commandFrame.add(o, { left : 4, right : 0, top : 20 });
> 
> 
>       tree.addListener(
>         "changeSelection",
>         function(e)
>         {
>           // Get the list of selected nodes.  We're in single-selection mode,
>           // so there will be only one of them.
>           var nodes = e.getData();
>           this.setValue(tree.getHierarchy(nodes[0].nodeId).join('/'));
>           buttonRemove.setEnabled(true);
>           
>         },
>         o);
> 
>     }
>   }
> });
> 
> --------end code---------
> 
> my second questions is concerned with sessions. I want to create a login 
> Page. I found an example in the Demo-Browser. But what is the best way to 
> control the session. Ist it possible to make this via php, i.e. having an 
> index.php rather than index.html, looking e.g. like:
> <$php 
> include functions.php
> ?>
> <html xmlns="http://www.w3.org/1999/xhtml"; xml:lang="en">
> <head>
>   <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
>   <title>custom</title>
>   <script type="text/javascript" src="script/custom.js"></script>
> </head>
> 
> ...
> 
> hints / best practises would be nice.
> 
> Its nice framework and fun to work with it !
>  
> I'm looking forward to your answers...
> 
> regards,
> 
> Poc
> 
> 
> 
>  
> 
> 


------------------------------------------------------------------------------
Crystal Reports - New Free Runtime and 30 Day Trial
Check out the new simplified licensing option that enables 
unlimited royalty-free distribution of the report engine 
for externally facing server and web deployment. 
http://p.sf.net/sfu/businessobjects
_______________________________________________
qooxdoo-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel

Reply via email to