delagoutte Posted March 24, 2016 Posted March 24, 2016 hello, i have a unidbgrid linked to a datasource that displayed a list of filename. Actually if i'm using the event onDblClick and i have this code : procedure TUniForm.GridDCEDblClick(Sender: TObject); var urlFile : string; begin urlfile := UniMainModule.GetUrlFileServer+'/?'+UniMainModule.getParameterCurrentFile; UniSession.AddJS('window.open('''+urlfile +''',''_blank'');'); end; end; urlfile is a url that is on another webserver than unigui webserver. SO when i double click on cell that must launch a file download. WIth this methode i'm blocked by webbrowser because it think it is a popup. If i unblock popup security the file download is launched. It's working but i think there must be a better solution without unblock popup security. how would you do? hope I was clear enough Quote
Skepsis IT Posted March 24, 2016 Posted March 24, 2016 Check download demos. Maybe something will help you. Quote
delagoutte Posted March 24, 2016 Author Posted March 24, 2016 the download demos work with stream or file that are on the unigui web server but in my case the file are on other server. Quote
delagoutte Posted March 24, 2016 Author Posted March 24, 2016 issue : i had a TUniURLFrame with property visible := false and ir replace UniSession.AddJS('window.open('''+urlfile +''',''_blank'');'); with UniURLFrame1.URL:= urlfile ; Quote
zilav Posted March 25, 2016 Posted March 25, 2016 Create a new calculated field, put link to the file there in OnCalcFields DataSet.FieldByName('download').AsString := '<a href="' + UniMainModule.GetUrlFileServer+'/?'+UniMainModule.getParameterCurrentFile + '">Download</a>' User will see an ordinary link in this cell which he can click. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.