Immer wenn ich ein wenig Zeit habe
Domino
arbeite ich an dem Webifying des Agent-Monitors weiter. Zur Zeit werden ein paar Grundfunktionen eingearbeitet, z.B. Dialoge
Kategorie arbeite ich an dem Webifying des Agent-Monitors weiter. Zur Zeit werden ein paar Grundfunktionen eingearbeitet, z.B. Dialoge
Dies ist der Auswahl-Dialog für den Administrationsserver im Web
und so schaut es im Notes-Client aus
Hierzu wurde von mir ein paar Funktionalitäten in der UIWorkspace hinzuimplementiert:
DLGSingleSelect
getCurrentDocumentFromView
getSelectedDocumentsFromView
Hier der Code:
// JavaScript Document
Ext.nd.oda.UIWorkspace = function(config){
Ext.nd.oda.UIWorkspace.superclass.constructor.call(this, config);
};
Ext.extend(Ext.nd.oda.UIWorkspace, Ext.nd.UIWorkspace, {
getCurrentView : function() {
return Ext.nd.oda.Application.uiView;
},
getCurrentDocumentFromView : function() {
var uiView = this.getCurrentView();
var ds = uiView.grid.getDataSource();
var row = uiView.grid.selModel.getSelected();
var node = row.node;
var unid = node.attributes.getNamedItem('unid');
if (!unid) {
return null;
} else {
return unid.value;
}
},
getSelectedDocumentsFromView : function() {
var uiView = this.getCurrentView();
var ds = uiView.grid.getDataSource();
var rows = uiView.grid.selModel.getSelections();
if (rows.length==0) return null;
var result = new Array();
for(i = 0; i < rows.length; i++) {
var node = rows[i].node;
var unid = node.attributes.getNamedItem('unid');
if (unid) {
result.push(unid);
}
}
if (result.length==0) return null;
return result;
},
DLGSelectSingle : function (config) {
var dialog, cb;
var sess = Ext.nd.Session;
var db = sess.CurrentDatabase;
// defaults
this.WebDatabase = "";
this.WebView = "";
this.WebColumn = "";
this.SelectionTitle = "";
this.width = 500;
this.height = 300;
this.shadow = true;
this.minWidth = 500;
this.minHeight = 300;
this.title = "ODA - DLGSelectSingle";
this.prompt = "Please make your selection(s) and click <OK>.";
// override defaults with config object
Ext.apply(this,config);
// move the callback to a local variable
if (this.callback) {
cb = this.callback;
this.callback = false;
}
// remove/destroy old container and grid
var pl = Ext.get('xnd-oda-dlgsingleselect');
if (pl) {
pl.remove(); // if one already exists, remove it so we can build another
}
// build the dialog/PickList
if(!dialog){
dialog = new Ext.LayoutDialog('xnd-oda-dlgsingleselect', {
autoCreate: true,
modal:true,
width:this.width,
height:this.height,
shadow:this.shadow,
minWidth:this.minWidth,
minHeight:this.minHeight,
title:this.title,
north : {
titlebar : true
},
center : {
autoScroll:true
}
});
dialog.addKeyListener(27, handleOK, this);
dialog.addButton('OK', handleOK, this);
dialog.addButton('Cancel', handleCancel, this);
// creae layout
var layout = dialog.getLayout();
layout.beginUpdate();
// add prompt panel
var promptPanel = layout.add('north', new Ext.ContentPanel('xnd-oda-dlgsingleselect-prompt', {autoCreate : true, title : this.prompt}));
var entry;
var link = db.WebFilePath + '.fwrkDLGSelectSingle?OpenForm';
link = link + "&SelectionTitle=" + this.SelectionTitle;
link = link + "&WebDatabase=" + this.WebDatabase;
link = link + "&WebView=" + this.WebView;
link = link + "&WebColumn=" + this.WebColumn;
var iframe = Ext.DomHelper.append(document.body, {
tag: 'iframe',
frameBorder: 0,
src: link,
id : 'oda-dlgselectsingle',
name : 'oda-dlgselectsingle'
});
var panel = new Ext.ContentPanel(iframe, {
title: '',
fitToFrame:true,
closable:true
});
layout.add('center', panel);
// tell the layout we are done so it can draw itself on the screen
layout.endUpdate();
} // end if(!dialog)
// now show our custom dialog
dialog.show();
function handleOK() {
dialog.hide();
// if a callback has been defined, call it and pass the array of return values to it
var frame = null;
for(i=0;i<frames.length;i++) {
if (frames[i].name=='oda-dlgselectsingle') {
frame=frames[i];
}
}
var el = frame.document.forms[0].Selection;
if (cb) {
cb(el.value);
} else {
return ''; //only usefull if async = false, otherwise your code won't be able to process
}
function handleCancel() {
dialog.hide();
if (cb) {
cb(null);
} else {
return null;
}
}
}
})
Gruß JJR