]>
git.argeo.org Git - gpl/argeo-slc.git/blob - ContextNodeInputView.js
bf01cefbc41d22c3c181d03d94a9588ad36980c7
1 qx
.Class
.define("org.argeo.jcr.ria.views.ContextNodeInputView", {
2 extend
: qx
.ui
.container
.Composite
,
3 implement
: [org
.argeo
.ria
.components
.IView
],
7 * The commands definition Map that will be automatically added and wired to the menubar and toolbar.
8 * See {@link org.argeo.ria.event.CommandsManager#definitions} for the keys to use for defining commands.
15 check
:"org.argeo.ria.components.ViewSelection"
19 event
: "changeInstanceId"
23 event
: "changeInstanceLabel"
30 construct : function(){
36 * The implementation should contain the GUI initialisation.
37 * This is the role of the manager to actually add the graphical component to the pane,
38 * so it's not necessary to do it here.
39 * @param viewPane {org.argeo.ria.components.ViewPane} The pane manager
40 * @param data {Mixed} Any object or data passed by the initiator of the view
43 init : function(viewPane
, dataModel
){
44 this.setViewSelection(new org
.argeo
.ria
.components
.ViewSelection(viewPane
.getViewId()));
46 layout
: new qx
.ui
.layout
.HBox(),
47 dataModel
: dataModel
,
52 this.contextInput
= new qx
.ui
.form
.TextField();
53 this.contextInput
.setWidth(100);
54 this.contextInput
.setTextAlign("right");
55 this.add(this.contextInput
);
57 var sep
= new qx
.ui
.basic
.Label(":");
58 sep
.set({paddingTop
:3, paddingLeft
:2,paddingRight
:2});
61 this.selectionInput
= new qx
.ui
.form
.TextField();
62 this.selectionInput
.setWidth(300);
63 this.selectionInput
.setReadOnly(true);
64 this.add(this.selectionInput
);
66 this._attachInputsToDM();
69 * The implementation should contain the real data loading (i.o. query...)
75 _attachInputsToDM : function(){
76 var dm
= this.getDataModel();
77 this.contextInput
.addListener("keypress", function(event
){
78 if(event
.getKeyIdentifier() != "Enter") return;
79 var path
= this.contextInput
.getValue();
80 dm
.requireContextChange(path
);
82 dm
.addListener("changeContextNode", function(event
){
83 var ctxtNode
= event
.getData();
84 this.contextInput
.setValue(ctxtNode
.getPath());
86 dm
.addListener("changeSelection", function(event
){
87 var sel
= event
.getData();
89 this.selectionInput
.setValue("/");
91 this.selectionInput
.setValue(sel
[0].getPath().substring(this.contextInput
.getValue().length
));
97 * Whether this component is already contained in a scroller (return false) or not (return true).
100 addScroll : function(){
104 * Called at destruction time
105 * Perform all the clean operations (stopping polling queries, etc.)