« Agent Monitor (DAF) 1.3.3 released | Main| Immer wieder Sonntags »

Immer wenn ich ein wenig Zeit habe

0
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
A picture named M2
und so schaut es im Notes-Client aus
A picture named M3
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 &lt;OK&gt;.";

    // 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

Mach einen Kommentar

:-D:-o:-p:-x:-(:-):-\:angry::cool::cry::emb::grin::huh::laugh::lips::rolleyes:;-)

Amazon


Impressum

Firmenname: Peanuts-Soft
Straße Nummer: Biinger Strasse 8
PLZ Ort: 55263 Wackernheim
Telefon: +491772134526
E-Mail: joerg.reck @ peanuts-soft.de
Disclaimer: Peanuts-Soft übernimmt keine Garantie dafür, dass die auf dieser Website bereitgestellten Informationen vollständig, richtig und stets aktuell sind. Dies gilt auch für alle Links, auf die verwiesen wird. Peanuts-Soft ist für die Inhalte, auf die per Link verwiesen wird, nicht verantwortlich. Peanuts-Soft haftet nicht für konkrete, mittelbare und unmittelbare Schäden oder Schäden, die durch fehlende Nutzungsmöglichkeiten, Datenverluste oder entgangene Gewinne – sei es aufgrund der Nichteinhaltung vertraglicher Verpflichtungen, durch Fahrlässigkeit oder eine andere unerlaubte Handlung – im Zusammenhang mit der Nutzung von Dokumenten oder Informationen bzw. der Erbringung von Dienstleistungen entstehen, die auf dieser Web Site zugänglich sind.
Datenschutz: Inhalt und Gestaltung der Internetseiten sind urheberrechtlich geschützt. Eine Vervielfältigung der Seiten oder deren Inhalte bedarf der vorherigen schriftlichen Zustimmung von Peanuts-Soft.


Locations of visitors to this page

Powered By

Domino BlogSphere
Version 3.0.2