Re: getting Client-side filename function to work
Edgar, if you'd still like this action to work for you... in the way it was intended... then there is a fix you can employ for your build 5028. One of the great things about Alpha is the ability to get around issues like this. You can turn your Action Javascript into code. Sometimes you can then manipulate that code a bit to fix issues like this. Once you turn your Action into Code... you cannot go back to the Action... this is a one way change. So, make sure your Action is set up the way you want it.
Make a copy of your UX.
Get into your Action and select the "Text mode" radio button. You'll get a warning, and the Action will be turned into code. Once in code, you'll see 4 tabs at the bottom of the dialog. These are the 2 tabs we'll be using...
Your Declarations - Global tab will have code like this...
The code will include a guid after "FileDownload". Make sure you do not change your guid. Just work these changes into your code.
Change the code to look like this...
Here, a variable is created to get the client side filename from your client side filename function. Then, that variable is passed into XBasic code as a request variable.
Next... in the tab Xbasic Functions... there will be XBasic code to set up a "p" dot variable with the options that were set in the Genie. There is one line that reads...
Change this line to read...
Here, we are setting the clientSideFilename option to the value of that Request Variable passed into this XBasic function.
I've tested this under 5028 and it works nicely.
Why Alpha would not give this to you as a potential solution I don't know. The Declarations - Global section is all Alpha code... taken from today's pre-release build.
The only thing I added was in the XBasic Function tab to get that client side filename and assign it.
When I read that this bug had been fixed and was in today's pre-release build, I'd hoped it would lead to a fix for your build... and it did.
Edgar, if you'd still like this action to work for you... in the way it was intended... then there is a fix you can employ for your build 5028. One of the great things about Alpha is the ability to get around issues like this. You can turn your Action Javascript into code. Sometimes you can then manipulate that code a bit to fix issues like this. Once you turn your Action into Code... you cannot go back to the Action... this is a one way change. So, make sure your Action is set up the way you want it.
Make a copy of your UX.
Get into your Action and select the "Text mode" radio button. You'll get a warning, and the Action will be turned into code. Once in code, you'll see 4 tabs at the bottom of the dialog. These are the 2 tabs we'll be using...
Code:
Declarations - Global Xbasic Functions
Code:
{dialog.object}._functions.BUTTON_10_ACTIONBUTTON_1 = function() { var data = '__xbfunction=FileDownload_2f39c39661f24522a138a2161e9f1964'; {dialog.Object}.ajaxCallback('','','__a5DownLoadObjectField','',data); }
Change the code to look like this...
Code:
{dialog.object}._functions.BUTTON_10_ACTIONBUTTON_1 = function() { var csfn = getFileName(); var data = '__xbfunction=FileDownload_2f39c39661f24522a138a2161e9f1964&clientsidefilename=' +csfn; {dialog.Object}.ajaxCallback('','','__a5DownLoadObjectField','',data); }
Next... in the tab Xbasic Functions... there will be XBasic code to set up a "p" dot variable with the options that were set in the Genie. There is one line that reads...
Code:
DIM p.clientSideFilename as C = "function:getFileName"
Code:
DIM p.clientSideFilename as C = Request.Variables.clientsidefilename
I've tested this under 5028 and it works nicely.
Why Alpha would not give this to you as a potential solution I don't know. The Declarations - Global section is all Alpha code... taken from today's pre-release build.
The only thing I added was in the XBasic Function tab to get that client side filename and assign it.
When I read that this bug had been fixed and was in today's pre-release build, I'd hoped it would lead to a fix for your build... and it did.
Comment