Question
lamont thomas · May 30, 2019

Call windows explorer from a Zen page

I need to open a Windows explorer window by pressing button on a Zen page.

Is this possible.?  I

performed a search but I did not find anything.

The command I used in the terminal was  D $zf(-2,"START C:\WINDOWS\SYSTEM32").

I am not sure how to use this in a Zen application.

Any help will be greatly  appreciated.

0
0 390
Discussion (8)3
Log in or sign up to continue

ZEN page means that it works somewhere outside of your server. $zf calls some executable right on the server, and with some limitations.

So, short answer NO, you can't do it.

It would be better if you would explain why you need it. So, we may help to find you the right way or more to solve it.

I found that if  I create a link

<a href="C:\TEMP">Open folder</a>

When the user press the open folder windows explorer will open to c:\temp.

Now I need to create the link dynamically using the content of the input box.
 

ok. Thank you for the reply.

I need to open to the windows' path based on the user input in a text box on the Zen page.

for example 

1) User inputs c:\test\ in a text box

2) user click button and windows explorer opens to c:\test\ on the local machine.

Thank you for your response but I need to learn more JavaScript before I can use you example.

give your anchor tag an ID and modify it using some JS script.

or use %ZEN.Auxiliary.locatorLink or any other element that allows a  HREF.

or trigger it with JS from any onclick event or similar. 

It's not much ZEN but pure JS

The request was for client side explorer but I think I will have to use server side. Thank you.

Hi Lamont,

I do use the following in one of my applications:

ClientMethod Webbutton() [ Language = javascript ]
{
var table this.getComponentById('relationTable');
        var index table.getProperty('selectedIndex');
        if (index 0) {
                alert('No row is selected in the table.');
                return;
        }
        var data table.getRowData(index);
        if (data == null) {
                alert('Table is not in snapshot mode or invalid request.');
        }
        else {

                   var person=data.Website
                   var tpref "http://"
                   
                   
                   
                   alert (person)
                   ///alert (tWeb)
                   var url "http://www.google.com/"
                   
                   var url "http://" person;
                    window.open(url);
                  /// window.open(person);

}
}

It opens a URL from  a record selected in a TablePane. I think it opens the default browser (in my case Firefox).

Maybe this example helps you. (yes, the name of the variable [person] looks odd.)

For myself it works great

Do you want server side explorer?

If so please have a look at this

/// Demonstration of launching a file selector window. 
ClientMethod showFileSelectionWindow() [ Language = javascript ]
{
zenLaunchPopupWindow('%ZEN.Dialog.fileSelect.cls','FileSelection','status,scrollbars,resizable,width=500,height=700');
}

/// This client event, if present, is fired when the a popup page
/// launched from this page fires an action.
ClientMethod onPopupAction(popupNameactionvalue) [ Language = javascript ]
{
switch(popupName) {
case 'FileSelection':
if (action=='ok');{
alert('My File is:'value);
///Do something...
}
break;
}
}