NetTalk Central

Author Topic: Export button not working  (Read 6257 times)

terryd

  • Hero Member
  • *****
  • Posts: 759
    • View Profile
    • Davcomm
    • Email
Export button not working
« on: August 08, 2014, 03:59:29 AM »
HI Bruce
Problem in a specific app with Export button. The app has both MSSQL and tps tables so it's not possible to post an example since it seems to be restricted to this one application that I can see.
I know the export button works because Example78 and another app where I added the export button both export the correct data.
In this specific app I have XFiles2.54 installed.
I leave the default Include Export Button on browses OFF
In the Browse form tab Export sub tab I set Include Export button to Yes
Compiling and clicking the button has no effect.This is happening on any browse in the application, not just this one.
I found that the exportTo routine is only called from the TakeEvent routine where the value of p_web.Event is 'export', and the TakeEvent routine is only called just before the end of procedure section.
I placed a trace p_web._trace('p_web.Event ' & p_web.event) in the start of TakeEvent before event handling.

Doing operations like clicking on a row would give a value in  debugview of 'p_web.event rowclicked' but clicking the export button does nothing.
'
Adding the same code to the web78 example gives the result in debugview of 'p_web.event export' when the export button is clicked.

What can I check to see why clicking on the export button does not generate the p_web.event?

Nothing, I think, to do with the above but I notice that the export button will only display if one of the other (insert/change etc. ) buttons are also selected. Is this something that is necessary or would it be possible to only display the browse with the Export button. My primary usage of the export button is to generate an In-memory or tps file and display it in a browse allowing the user to export a specific set of results rather than possibly a 1 million record table in error.
Terry Davidson
Windows 10 64 bit/Windows7 64bit
Clarion 9.1.11529/Clarion10 12567
Nettalk 913
Nettalk 1015
StringTheory267/Winevent515/XFiles298/MessageBox239/Cryptonite186

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: Export button not working
« Reply #1 on: August 10, 2014, 11:08:31 PM »
do you see anything in the log when you press the Export button?
Does anything appear in the firebug console?

cheers
Bruce

terryd

  • Hero Member
  • *****
  • Posts: 759
    • View Profile
    • Davcomm
    • Email
Re: Export button not working
« Reply #2 on: August 11, 2014, 05:04:08 AM »
Hi Bruce
No starting firebug and selecting console\errors  then clicking the export button does not display anything
Terry Davidson
Windows 10 64 bit/Windows7 64bit
Clarion 9.1.11529/Clarion10 12567
Nettalk 913
Nettalk 1015
StringTheory267/Winevent515/XFiles298/MessageBox239/Cryptonite186

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: Export button not working
« Reply #3 on: August 11, 2014, 05:42:09 AM »
inspect the button using firebug, and paste the actual html of the button here please.

terryd

  • Hero Member
  • *****
  • Posts: 759
    • View Profile
    • Davcomm
    • Email
Re: Export button not working
« Reply #4 on: August 11, 2014, 10:18:17 AM »
<button data-do="export" title="Click here to export the data in this browse" class="nt-export-button ui-button ui-widget ui-state-default ui-button-text-icon-primary ui-corner-right" value="Export" id="export_btnxby9" name="export_btn" type="button" role="button" aria-disabled="false"><span class="ui-button-icon-primary ui-icon ui-icon-arrowreturnthick-1-e"></span><span class="ui-button-text">Export</span></button>
Terry Davidson
Windows 10 64 bit/Windows7 64bit
Clarion 9.1.11529/Clarion10 12567
Nettalk 913
Nettalk 1015
StringTheory267/Winevent515/XFiles298/MessageBox239/Cryptonite186

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: Export button not working
« Reply #5 on: August 11, 2014, 09:39:17 PM »
[given that you have to debug this on your side, my goal here is to step you through the process].

Note: turn off combine/compress when debugging JavaScript, and make sure the Cache is also off - all on Performance tab of web server.

The key attribute on the html is data-do. It's a signal to the JavaScript to add some functionality to the element. In this case;

 data-do="export"

So your next step is to open \web\scripts\jquery.nt-browse.js

if you search that for data-do="export" you'll find the line;

$(this.element).off('click.bt','[data-do="export"]')
.on('click.bt','[data-do="export"]',function(e){_this.exportTo('excel',this);});

basically this is "binding" the function exportTo to this button.

search for exportTo. there are a cluster of 3 funtions here that work together. exportTo, exportProgress and setTimer.  You can add lines
console.log('something')
as a debugging tool to make stuff appear in the firebug console.

your goal is to see if the call to ntbrowse.timer is made. You might want to inspect the value of this.options.divId. Obviously you should compare what happens in the working example with what happens in your app.

Cheers
Bruce

terryd

  • Hero Member
  • *****
  • Posts: 759
    • View Profile
    • Davcomm
    • Email
Re: Export button not working
« Reply #6 on: August 11, 2014, 09:43:08 PM »
Thanks Bruce. I'll work on it this morning.
Terry Davidson
Windows 10 64 bit/Windows7 64bit
Clarion 9.1.11529/Clarion10 12567
Nettalk 913
Nettalk 1015
StringTheory267/Winevent515/XFiles298/MessageBox239/Cryptonite186

terryd

  • Hero Member
  • *****
  • Posts: 759
    • View Profile
    • Davcomm
    • Email
Re: Export button not working
« Reply #7 on: August 11, 2014, 11:33:40 PM »
Hi Bruce
As a start I set the following to 0
Combine common file
Serve pre-compressed
Compress static files
compress dynamic data
auto-check cached files
enable file-cache
no javascript check

These were already 0
Frontloaded
Allow keep-alive

I then compiled and ran again and got a slew of javascript errors
I copied the web folders from libsrc to my web folder recompiled and got a clean compile and the export now works.
Terry Davidson
Windows 10 64 bit/Windows7 64bit
Clarion 9.1.11529/Clarion10 12567
Nettalk 913
Nettalk 1015
StringTheory267/Winevent515/XFiles298/MessageBox239/Cryptonite186

terryd

  • Hero Member
  • *****
  • Posts: 759
    • View Profile
    • Davcomm
    • Email
Re: Export button not working
« Reply #8 on: August 12, 2014, 12:33:56 AM »
Further feedback
I set these
Combine common file
Serve pre-compressed
Compress static files
compress dynamic data
auto-check cached files
enable file-cache
back to 1 and the export stopped working again
resetting them back to 0 and it worked
I then decided to go through each setting it to 1 and testing
Immediately I checked combined common files the export stopped.

One thought. The web folder is not a standard folder name and doesn't reside below the database folder
I use the Overrideserversettings embed to set the location of the web folder using this code
    IF HomeWebSiteAddress <> ''
        s_web._SitesQueue.Defaults.WebFolderPath = CLIP(HomeWebSiteAddress)
    END
    IF HTTPPort <> 0
        ThisWebServer.Close()
        ThisWebServer.Port = HTTPPort
        ThisWebServer.Open()
    END
Where the location variables are read out of a control file.
Terry Davidson
Windows 10 64 bit/Windows7 64bit
Clarion 9.1.11529/Clarion10 12567
Nettalk 913
Nettalk 1015
StringTheory267/Winevent515/XFiles298/MessageBox239/Cryptonite186

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: Export button not working
« Reply #9 on: August 12, 2014, 04:45:08 AM »
manually run gzipall.bat, and see if it's getting any errors.

cheers
Bruce

terryd

  • Hero Member
  • *****
  • Posts: 759
    • View Profile
    • Davcomm
    • Email
Re: Export button not working
« Reply #10 on: August 12, 2014, 07:28:42 AM »
Hi Bruce
The folder name is D:\courier so I used copyall.bat from the d drive and then gzipall.bat from the D: drive. I copied the files in the created web folder into the courier folder and set Combine common file
and Serve pre-compressed to 1.
The export now works with these 2 set.
Terry Davidson
Windows 10 64 bit/Windows7 64bit
Clarion 9.1.11529/Clarion10 12567
Nettalk 913
Nettalk 1015
StringTheory267/Winevent515/XFiles298/MessageBox239/Cryptonite186

terryd

  • Hero Member
  • *****
  • Posts: 759
    • View Profile
    • Davcomm
    • Email
Re: Export button not working
« Reply #11 on: August 12, 2014, 11:45:32 PM »
Bruce
Have you any thoughts on this request I made in one of the earlier posts?

I notice that the export button will only display if one of the other (insert/change etc. ) buttons are also selected. Is this something that is necessary or would it be possible to only display the browse with the Export button. My primary usage of the export button is to generate an In-memory or tps file and display it in a browse allowing the user to export a specific set of results rather than possibly a 1 million record table in error.
Terry Davidson
Windows 10 64 bit/Windows7 64bit
Clarion 9.1.11529/Clarion10 12567
Nettalk 913
Nettalk 1015
StringTheory267/Winevent515/XFiles298/MessageBox239/Cryptonite186

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: Export button not working
« Reply #12 on: August 13, 2014, 11:38:48 PM »
from release notes;
>> 8.21 : 24 July 2014

Fix: Export button did not appear if there were no form buttons on a browse.
also
Add: Export button (Browse to Excel) now contains a progress indicator

Cheers
Bruce

terryd

  • Hero Member
  • *****
  • Posts: 759
    • View Profile
    • Davcomm
    • Email
Re: Export button not working
« Reply #13 on: August 14, 2014, 01:24:18 AM »
Thanks Bruce.
I will be moving to 8.25 when it's released to get the code that you mentioned in my other query re restricting number of child records.
Terry Davidson
Windows 10 64 bit/Windows7 64bit
Clarion 9.1.11529/Clarion10 12567
Nettalk 913
Nettalk 1015
StringTheory267/Winevent515/XFiles298/MessageBox239/Cryptonite186