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
--
Neu: GMX FreeDSL Komplettanschluss mit DSL 6.000 Flatrate + Telefonanschluss
für nur 17,95 Euro/mtl.!*
http://dslspecial.gmx.de/freedsl-surfflat/?ac=OM.AD.PD003K11308T4569a
------------------------------------------------------------------------------
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