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.

Comments

Dmitry Maslennikov · May 30, 2019

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.

0
lamont thomas  May 30, 2019 to lamont thomas

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.
 

0
lamont thomas · May 30, 2019

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.

0
lamont thomas  Jun 26, 2019 to Marco Blom

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

0
Robert Cemper · May 30, 2019

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

0
lamont thomas  Jun 26, 2019 to Suman Samanta

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

0
Marco Blom · Jun 21, 2019

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

0
Suman Samanta · Jun 24, 2019

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;
}
}

0