Custom dialog to pick a folder

I’m currently customizing iNotes 8.5 for our archiving solution. I’d like to have a custom dialog started from a view action where a user can pick a folder to work with.

Something like the function ‘Move to folder’. I can see that there is a scene/widget ‘e-dialog-folderdialog’ but I can’t find where it is defined.

If maybe someone could give me a hint where I should look. A small sample code would be cool as well. Based on Akira’s article “Manipulating data in iNotes Lite forms” I’m able to create custom dialogs already but what I’m missing is the Folder List display with the ability to pick one.

Thanks for any help + kind regards,

Veit

Subject: Here’s what worked for me

Basically the code for this is in subform l_MailPageMoveCopy.

So I copied the code to a new custom subform and modified the functions

EsC - calls the Folder dialog

EtZ - processed after clicking OK / Cancel

The selected folder return value is in EKJ.

Hope that helps anyone

Subject: How to properly load and use the EwE (mailFolderPickerOutline) widget?

I found out that the widget to use in iNotes Lite framework is the EwE [com_ibm_dwa_ui_mailFolderPickerOutline] widget. Analog to the date picker widget example in the article ‘Manipulating data in iNotes Lite forms’ I created a subformCustomLLExample and added the markups in I_StdPageOperations … and the lazy loading code lines in Subform Custom_JS_Lite – Scene_Actions_Lite

EKc.prototype.EQj[‘EwE:handleEvent’]=[‘MiscWidgets’];

EKc.prototype.EQj[‘com_ibm_dwa_ui_actionLLExample’] = [‘LLExample’];

When I click on the view action the dialog box is shown but no EwE widget is loaded. What am I missing? Has anybody used the mailFolderPicker widget in a custom dialog?

Subform CustomLLExample looks like this

// Call of the Subform is in Custom_JS_Lite - function Scene_Actions_Lite

function com_ibm_dwa_ui_actionLLExample(sId){

	this.sId = sId; 

	var oMainDoc = AAA.EcK;

	EKc.prototype.ESH['e-dialog-llexample:EeE'] 

		= this.dialogInited.EHq(this); 

	if (!oMainDoc.getElementById('e-dialog-llexample')) { 

    		var EPQ = 'AAA.DSq.EKc.prototype.EYl[\'e-dialog-llexample:EeE\']';

	// Start HTML for dialogbox 

    		var sHtml = '<div id="e-dialog-llexample" class="s-stack s-dialog"' 

     		+ ' com_ibm_dwa_ui_widget_class="EeE"' 

     		+ ' com_ibm_dwa_ui_dialog_title="Copy From Archive"' 

     		+ ' com_ibm_dwa_ui_dialog_closeIndicator="8 7 40 20"' 

     		+ ' com_ibm_dwa_ui_dialog_consolidatedIcons="' + AAA.BYp('basicicons.gif') + '"' 

     		+ ' com_ibm_dwa_ui_dialog_width="18em" com_ibm_dwa_ui_dialog_height="18em">' 

	+ '<table class="s-toppanel" border="0" cellspacing="4" cellpadding="0">'

	+ '<tbody>'

	+ '<tr>'

	+ '<td class="s-label-light" >Select a folder</td>' 

	+ '</tr>'

	+ '<tr>'

	+ '<td id="e-dialog-llexample-folder-outline" class="s-basicpanel s-outline s-panel-border" '

	+ 'com_ibm_dwa_ui_outline_collapseicon="10 20" com_ibm_dwa_ui_outline_expandicon="0 20" '

	+ 'com_ibm_dwa_ui_outline_consolidatedicons="/iNotes/Forms85.nsf/mailoutlineicons.gif?OpenFileResource&MX&TS=20090818T083021,57Z" '

	+ 'com_ibm_dwa_ui_widget_class="EwE" '

	+ 'com_ibm_dwa_ui_outline_context_action="a-movetofolder" '

	+ 'com_ibm_dwa_ui_widget_delayed="true">'

	+ '</td>'

	+ '</tr>'

	+ '</tbody>'

	+ '</table>'

     		+ '<div class="s-bottompanel" style="padding: 4px 2px ; height: 1.6em; text-align: right;">' 

     		+ '<input id="e-dialog-llexample-ok" class="s-basic-buttons"' 

     		+ ' type="button" value="OK"' 

     		+ ' onclick=" ' + EPQ + ' .oAction.dialogSelected();" style= "margin: 0px 2px;">' 

     		+ '<input id="e-dialog-llexample-no" class="s-basic-buttons"' 

     		+ ' type="button" value="Cancel" onclick=" ' + EPQ + ' .close();" style= "margin: 0px 2px;">' 

     		+ '</div>' 

     		+ '</div>'; 

	// End HTML

    		if (oMainDoc.body.insertAdjacentHTML) { 

        			oMainDoc.body.insertAdjacentHTML('beforeEnd', sHtml); 

    		} else { 

        			var oRange = oMainDoc.createRange(); 

        			oRange.setStartBefore(oMainDoc.body); 

        			var oFragment = oRange.createContextualFragment(sHtml); 

        			oMainDoc.body.appendChild(oFragment); 

    		}

	// Call of the dialog 

    		EPl(oMainDoc.getElementById('e-dialog-llexample')); 

} else { 

    		EKc.prototype.EYl['e-dialog-llexample:EeE'].Fcs(); 

    		this.dialogInited(); 

}

};

com_ibm_dwa_ui_actionLLExample.prototype.dialogInited

= function com_ibm_dwa_ui_actionLLExample_dialogInited(){

	EKc.prototype.EYl['e-dialog-llexample:EeE'].oAction = this; 

};

com_ibm_dwa_ui_actionLLExample.prototype.dialogSelected

= function com_ibm_dwa_ui_actionLLExample_dialogSelected(){

// Code after clicking OK in the dialogbox 

	EKc.prototype.EYl['e-dialog-llexample:EeE'].close();

};

EKc.prototype.FKd[‘llexample’] = true;

//End of Subform

Subject: Try analyzing the detail mode of iNotes console log

That can be seen by Ctrl-Click on the product logo and hit Detail button. You’ll see what widgets have successfully been initialized, what widgets were not.

For example:

08/20/2009 06:05:33PM Releasing Eyu LISTENER92 from ELG

08/20/2009 06:05:33PM Releasing Eyu LISTENER84 from ELG

08/20/2009 06:05:33PM Widget ACTION2:EaJ is being created.

08/20/2009 06:05:33PM Widget e-form-472B52F82AD1A56D49257617004692C8-0:EHB is being created.

08/20/2009 06:05:33PM Widget e-form-472B52F82AD1A56D49257617004692C8-0:Eaa is being created.

08/20/2009 06:05:33PM Start tracking Eyu LISTENER97 from EQS

08/20/2009 06:05:33PM Start tracking Eyu LISTENER98 from Eeb

Best regards,

  • Akira

Subject: One more little question about outline content

Thank you very much, Akira, for the hint with the details in the console.

Now the EwE widget is loading correctly and I can pick a folder and work with it.

But the outline container, as far as I defined it now, is showing the whole list of views and folders (Sent, Trash, and so on).

Is there a method (or an easy way) to control which folders are displayed in the outline container?

I’d like to have the same amount of entries displayed as in the Copy Folder dialog (Inbox and all Custom Folders). I thought this could be done using com_ibm_dwa_ui_outline_context_action=“a-copytofolder” but this has in my case not the desired effect.

Any hint is very welcome!

Best regards, Veit

Currently my html code for the dialog looks like this:

	if (!oMainDoc.getElementById('e-dialog-llcopyorder')) { 

    		var EPQ = 'AAA.DSq.EKc.prototype.EYl[\'e-dialog-llcopyorder:EeE\']';

	// Start HTML for dialogbox 

    		var sHtml = '<div id="e-dialog-llcopyorder" class="s-stack s-dialog"' 

     		+ ' com_ibm_dwa_ui_widget_class="EeE"' 

     		+ ' com_ibm_dwa_ui_dialog_title="Copy From Archive"' 

     		+ ' com_ibm_dwa_ui_dialog_closeIndicator="8 7 40 20"' 

     		+ ' com_ibm_dwa_ui_dialog_consolidatedIcons="' + AAA.BYp('basicicons.gif') + '"' 

     		+ ' com_ibm_dwa_ui_dialog_width="18em" com_ibm_dwa_ui_dialog_height="24em">' 

	+ '<table class="s-toppanel" border="0" cellspacing="4" cellpadding="0">'

	+ '<tbody>'

	+ '<tr>'

	+ '<td class="s-label-light" >Select a folder</td>' 

	+ '</tr>'

	+ '<tr>'

	+ '<td id="e-dialog-llcopyorder-outline" class="s-basicpanel s-outline s-panel-border" '

	+ 'style="padding:4px;background-color:white;" '

	+ 'com_ibm_dwa_ui_outline_collapseicon="10 20" com_ibm_dwa_ui_outline_expandicon="0 20" '

	+ 'com_ibm_dwa_ui_widget_class="EwE" '

	+ 'com_ibm_dwa_ui_outline_context_action="a-copytofolder" '

	+ 'com_ibm_dwa_ui_outline_consolidatedIcons="' + AAA.BYp('mailoutlineicons.gif') + '" '

	+ 'com_ibm_dwa_ui_widget_delayed="true">'

	+ '</td>'

	+ '</tr>'

	+ '</tbody>'

	+ '</table>'

     		+ '<div class="s-bottompanel" style="padding: 4px 2px ; height: 1.6em; text-align: right;">' 

     		+ '<input id="e-dialog-llcopyorder-ok" class="s-basic-buttons"' 

     		+ ' type="button" value="OK"' 

     		+ ' onclick=" ' + EPQ + ' .oAction.dialogSelected();" style= "margin: 0px 2px;">' 

     		+ '<input id="e-dialog-llcopyorder-no" class="s-basic-buttons"' 

     		+ ' type="button" value="Cancel" onclick=" ' + EPQ + ' .close();" style= "margin: 0px 2px;">' 

     		+ '</div>' 

     		+ '</div>'; 

	// End HTML

    		if (oMainDoc.body.insertAdjacentHTML) { 

        			oMainDoc.body.insertAdjacentHTML('beforeEnd', sHtml); 

    		} else { 

        			var oRange = oMainDoc.createRange(); 

        			oRange.setStartBefore(oMainDoc.body); 

        			var oFragment = oRange.createContextualFragment(sHtml); 

        			oMainDoc.body.appendChild(oFragment); 

    		}

	// Call of the dialog 

    		EPl(oMainDoc.getElementById('e-dialog-llcopyorder')); 

} else { 

    		EKc.prototype.EYl['e-dialog-llcopyorder:EeE'].Fcs(); 

    		this.dialogInited(); 

}