Open Exchange
Global Masters
Home / Class Reference / ENSLIB namespace / %ZEN.Dialog.fileSelect
Private  Storage   


class %ZEN.Dialog.fileSelect extends

This dialog page displays a file selection window listing directories and files on the server. This is intended for use within server portal pages.
To use this dialog, the current user must hold USE privileges on one of the following resources:
For an production-enabled namespace, resource %Ens_ViewFileSystem is required.

How to Use This Dialog

Example invoking the fileSelect dialog to open in a popup window:


If Dir is null, then the manager directory is used when the dialog is opened. If Dir contains a partial directory, then the last valid level of directory, if can be found, is used. If Dir contains a filename or a partical name without a directory then the manager directory is used for the filename. When OK is pressed, whatever is shown in the File name field is returned to the calling page.

If you are opening the dialog as a popup window such as shown in the above example, then you should have an onPopupAction method defined on the calling page. In the following example, a Zen control "FileName" is defined on your calling page, and upon returning from the fileSelect dialog by clicking "OK", the returned value will be set into your Zen control "FileName":

	ClientMethod onPopupAction(popupName, action, value) [ Language = javascript ]
		if (action == "ok") {
			if (popupName == "FileSelect") zen("FileName").setValue(value);

ISC Developers: Please use caution when modifying logic in this class. Your change needs to be tested in Windows, Unix, and VMS for all cases.


Parameters Properties Methods Queries Indices ForeignKeys Triggers
2 6 28


This is a Zen Page class. 

%condition %import %includeFiles %page
%resource DefaultDirectory DirFile FileName
FirstFailed InvalidParam IsEMSReadOnly ValidationErrorMsg
align aux backgroundTimerInterval cellAlign
cellSize cellStyle cellVAlign children
composite containerStyle cssLevel dialogTitle
disabled disabledStyle dragAndDrop dragEnabled
dropEnabled enclosingClass enclosingStyle error
groupClass groupStyle height hidden
hideApplyButton hideCancelButton hint hintClass
hintStyle id index isVMS
isWINDOWS label labelClass labelDisabledClass
labelPosition labelStyle layout name
onafterdrag onbeforedrag onclick ondrag
ondrop onhide onrefresh onshow
onupdate parent showLabel showdirectoryonly
slice title tuple useSVG
useSoftModals valign visible width
window zenPersistentPopup

%AddChild %AddChildAfter %AddChildBefore %AddComponent
%AddImportedComponents %AddToSaveSet %ApplyURLParms %Attr
%BindExport %ClassIsLatestVersion %ClassName %ConstructClone
%DispatchClassMethod %DispatchGetModified %DispatchGetProperty %DispatchMethod
%DispatchSetModified %DispatchSetMultidimProperty %DispatchSetProperty %DrawAutoLogout
%DrawClassDefinitions %DrawComponentHTML %DrawHTML %DrawHTMLPage
%DrawJSStrings %DrawObjectDefinitions %DrawTitle %EnclosingDivId
%EndBackgroundMethod %EndScript %Eval %EvalC
%Extends %ForceClientRender %GetChildIndex %GetComponent
%GetComponentById %GetComponentByName %GetEventHandlers %GetLinks
%GetPageName %GetParameter %GetValueById %GetValueByName
%GetXMLName %IsA %IsModified %Link
%LinkCSS %LinkScript %MakeId %New
%NormalizeObject %ObjectModified %OnAddToPageAfter %OnAddToPageBefore
%OnAfterCreatePage %OnBeforeCreatePage %OnCreateApplication %OnCreatePage
%OnDetermineCSSLevel %OnDrawEnclosingDiv %OnDrawHTMLBody %OnDrawHTMLHead
%OnDrawHTMLMeta %OnDrawObjectProperties %OnFinishBackgroundTask %OnGetSubtitle
%OnGetTitle %OnMonitorBackgroundTask %OnMutateChildren %OnObjectSynch
%OnSubmit %OnUseSoftModals %OnZENDeserialize %OriginalNamespace
%PackageName %QuoteValue %QuoteValueL10N %RemoveChild
%RemoveChildren %RemoveComponent %RemoveFromSaveSet %RunBackgroundMethod
%Self %SerializeObject %SetBackgroundMethodStatus %SetErrorById
%SetErrorByName %SetModified %SetValueById %SetValueByName
%SetValuesByName %StartScript %ValidateObject %ZENVersion
BuildDrive CheckFileExt CheckPath CheckRootDir
ConvertParameter Decrypt Encrypt EscapeHTML
EscapeURL EvalResult GetDirFile GetDirectory
GetSubDir GetViewContents HyperEventCall HyperEventHead
Include InsertHiddenField InsertHiddenFields IsPrivate
IsTopLevel Link OnHTTPHeader OnPage
OnPageError OnPostHTTP OnPostHyperEvent OnPreHTTP
OnPreHyperEvent Page QuoteJS RebuildLookin
RewriteURL ShowError StartTimer StopTimer
ThrowError UnescapeHTML UnescapeURL XMLDTD
XMLExport XMLExportToStream XMLExportToString XMLNew
XMLSchema XMLSchemaNamespace XMLSchemaType addChild
addChildAfter addChildBefore adjustSize btnApply
btnOK cancelPopup changeDrive changeFileType
changeSortOrder changeView childrenMutated correctIELayering
createComponent createComponentNS ctrlKeyDown deleteComponent
dialogApply dialogCancel dialogFinish dialogTitleGet
disableButtons dragFinishHandler dragHandler dragNotifyHandler
dragStartHandler dropHandler dropStartHandler endModal
exposeComponent findElement fireOnResizeEvent fireOnUnloadEvent
fireOnUpdateEvent firePopupAction getChildIndex getComponent
getComponentById getDialogValue getEnclosingDiv getHidden
getHintElement getLabelElement getOpener getProperty
getSettings getType gotoPage hasdelimiter
invokeSuper isOfType itemClicked itemSelected
launchPopupWindow makeId onCreate onDelete
onDisplayHandler onEndModalHandler onPopupAction onRefreshContents
onSerialize onServerMethodCall onServerMethodError onServerMethodReturn
onStartModalHandler ondialogCancel ondialogFinish ondialogStart
ondisabledHandler onkeydownHandler onkeyupHandler onlayoutHandler
onloadHandler onlogoutHandler onoverlayHandler onresizeHandler
onunloadHandler onupdateHandler popupActionHandler refreshContents
reloadLookin removeChild render renderContents
renderSVG resetMsg setComponentId setHidden
setOverlayMode setProperty setPropertyAll setTraceOption
showMsg startModal startProgressBar stopProgressBar
upOneLevel validateRequired


• parameter DOMAIN = "%ZEN";
Localization domain
• parameter VALIDATEXML = 0;
Validate user pages


• property DefaultDirectory as %ZEN.Datatype.string;
Composed Default Directory path. After much checking, this is the final default directory that is used as default.
• property DirFile as %ZEN.Datatype.string(ZENURL="Dir");
Original Directory path and/or filename passed in. If null is passed in, then manager directory will be used.
• property FileName as %ZEN.Datatype.string(ZENURL="File");
Original File name passed in (optional)
• property isVMS as %Boolean [ InitialExpression = "0" ];
• property isWINDOWS as %Boolean [ InitialExpression = "0" ];
• property showdirectoryonly as %ZEN.Datatype.string(ZENURL="showdirectoryonly");
Whether to show directory only or with files


• method %OnAfterCreatePage() as %Status
This callback is called after the server-side page object and all of its children are created.
Subclasses can override this to add, remove, or modify items within the page object model, or to provide values for controls.
• method %OnGetSubtitle() as %String
Get the (localized) subtitle string for the dialog. This should be implemented in a subclass.
• method %OnGetTitle() as %String
Get the (localized) title string for the dialog. This should be implemented in a subclass.
• method BuildDrive(Output drives As %String, drive As %String, Output lastexistingdir As %String)
Get drive list
• classmethod CheckFileExt(File, FileType) as %String [ ZenMethod ]
Check if file has extension. If not, add it.
• classmethod CheckPath(Path As %String, File As %String, FileType As %String) as %String [ ZenMethod ]
****** The Following Methods are Called from UtilFile*.csp Also ******
If user enters a directory but without drive, we add the drive here. This overrides the "Look in" directory. For Windows and VMS only.
• classmethod CheckRootDir(File As %String) as %String [ ZenMethod ]
Check if user entered filename ends with ":". If yes, then we should add "/" or [000000] to make valid drive.
For Windows: If user enters : without \ then we add it here.
For VMS: If user enters : without any [directory] then add [000000] here.
If we don't do this then directory would be invalid.
• classmethod GetDirFile(LookinDir, File, FileType) as %String [ ZenMethod ]
Construct new new file name, if it does not have dir yet
• method GetDirectory(Dir As %String) as %String [ ZenMethod ]
Check if user entered directory exists. Return a valid directory.
• classmethod GetSubDir(LookinDir, Dir) as %String [ ZenMethod ]
Construct new directory given the Look in directory and selected directory from the middle frame
• method GetViewContents(ByRef pParms As %String, Output pContents As %String, ByRef pHeader As %String) as %Status
Build file and directory list
• classmethod IsTopLevel(currentDir, newDir) as %Boolean [ ZenMethod ]
This is mainly for Windows. e.g. If you are already on the D:\ drive then don't go up to C:\.
• method RebuildLookin(Dir, wildcard) [ ZenMethod ]
Construct new directory given the Look in directory and selected directory from the middle frame
• method changeDrive(thisobj) [ Language = javascript ]
User selected a different directory from "Lookin" drop-down. If FileName is available, add to the newly selected directory.
• method changeFileType() [ Language = javascript ]
This method refreshes the contents with the current file type and directory/file name
• method changeSortOrder(value) [ Language = javascript ]
• method changeView(viewtype) [ Language = javascript ]
• method getDialogValue() [ Language = javascript ]
Get the value that will be applied when the user presses the OK button. This is implemented by subclasses.
• method hasdelimiter(file) [ Language = javascript ]
• method itemClicked(viewobj) [ Language = javascript ]
User clicked an item. We put it in the File name field. User can OK it or [Enter] to drill down.
• method itemSelected(viewobj) [ Language = javascript ]
User has selected a new item (double click).
• method ondialogFinish(action) as %Boolean [ Language = javascript ]
This callback, if defined, is called when the user presses the OK or Apply action buttons. If this returns false, then the action is cancelled.
Check FileName value. If user entered a path, then return as is.
If user enters something but not including a path, then add selected path in front of it.
It is possible that user is entering a sub directory or file, therefore as a curtersey we add the path for them.
In addition, if user enters a filename without a file extension, then we add the filetype choice from the drop-down.
• method ondialogStart() [ Language = javascript ]
This callback, if defined, is called when the dialog page is loaded.
• method onkeydownHandler(evt) [ Language = javascript ]
Examine if user hit the Return key. If yes, start the search. This method handles all keydown events on the window. Works for both IE and NS.
• method onresizeHandler() [ Language = javascript ]
This client event, if present, is fired when the page is resized.
• method reloadLookin(driveobj, tvalue) [ Language = javascript ]
• method upOneLevel() [ Language = javascript ]
up one level