rejetto forum
May 25, 2012, 07:10:36 PM *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News: This forum is free, you do NOT need to register to post. But you may.
PROBLEMS? QUESTIONS? CLICK HERE!
Fill the survey!
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: Exec on button trigger  (Read 292 times)
0 Members and 1 Guest are viewing this topic.
vbn
Experienced poster
***
Offline Offline

Singapore Singapore

Posts: 36


View Profile Email
« on: August 19, 2010, 03:06:24 AM »

I wanted to have a button next to each file in last column which when clicked is supposed to call an exe with the full file path as argument.

In then [+file] section , I added following in last column :
<form><input type='submit' onClick="{.exec|C:\prog.exe|out=#temp.}"></form>

however, this seems to be getting called for each file that is being 'displayed' and not waiting for any clicks....can someone guide me to a proper way of doing this ... also page needs to refresh once exe is done
Logged
TSG
Operator
Insane poster
*****
Offline Offline

Australia Australia

Posts: 1919



View Profile WWW
« Reply #1 on: August 19, 2010, 08:53:55 AM »

It is a server side macro, not client side.

You would have to redirect to a 'virtual page' that executes the file you want, then redirects you back... or use AJAX for it to happen without page changing. It is a bit complex to explain... you seem to know the basics so here goes nothing, this will be untested but just a suggestion for how to manually do it.

Send the file name and the page you are on to a 'virtual page' in the HFS template:

Code:
onclick="window.location('/application.html?location=%encoded-folder%');"

Now for the 'virtual page', this is where it happens:

Code:
[application = application.html]

{.comment| Execute the file before sending the page and redirecting. .}
{.exec|C:\prog.exe|out=#temp.}

{.comment| Show some information and redirect. .}
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Run Application</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<meta name="robots" content="noindex,nofollow"/>
<meta http-equiv="REFRESH" content="2;url={.?location.}">
<script type="text/javascript">
// You can use this if meta wont work!
// window.location = "{.?location.}"
</script>
</head>
<body>
<h3>- Application <i>"prog.exe"</i> was executed, redirecting back to location <i>"{.?location.}"</i>...</h3>
</body>
</html>

« Last Edit: August 21, 2010, 08:00:51 AM by TSG » Logged

Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.16 | SMF © 2011, Simple Machines Valid XHTML 1.0! Valid CSS!


Google visited last this page May 19, 2012, 12:32:15 PM
anything