Select the search type
  • Site
  • Web
Search
You are here:  Support/Forums
Support

Bring2mind Forums

Double Click Behavior
Last Post 05/22/2013 12:01 PM by Peter Donker. 12 Replies.
Sort:
PrevPrev NextNext
You are not authorized to post a reply.
Author Messages
Synoptek Web Team
New Member
New Member
Posts:10


--
12/15/2011 10:06 PM
Is it possible to change the double click behavior? My client states that before I updated the module to version 6.0 they were able to double click a PDF and view it. However, now their browsers download the file rather than open it up.

Is there a way to allow them to double click PDFs to view them again?
Peter Donker
Veteran Member
Veteran Member
Posts:4536


--
12/19/2011 2:54 PM
This is actually not the double click itself, but the way a PDF download is handled. If you go to the File Types page and you edit the "View By Default" setting then you get the old behavior. Note that some combinations of browser and Acrobat had faulty behavior which prompted us to change the default to the safer "Save or Open" behavior.
Synoptek Web Team
New Member
New Member
Posts:10


--
12/19/2011 6:30 PM
Peter,



Thank you for your reply. Currently, the Default Action for PDF documents in the File Types list is View. However, when testing with Adobe Reader X (10.1.1) and the latest versions of IE, Firefox and Chrome, the document is immediately downloaded rather than opened.



The settings for my PDF file type are below (pipe-delimited). Do you see anything incorrectly set here to achieve the behavior I am looking for?



Base Type|Specific Type|Control Extension(s)|Mime Type|Default Action

File|Adobe.Acrobat|{defaultview}|pdf|application/pdf|View




Thanks again for your help. It is much appreciated.
Peter Donker
Veteran Member
Veteran Member
Posts:4536


--
12/19/2011 7:50 PM
That looks correct. Then the server does it just fine and it's the web browser that handles it thus. Note that the actual way in which the browser (and plugin) handle this is not in our hands. We just have a a flag we can put in the http headers to show "inline" or as "attachment". You should be able to see that in Fiddler. Then the browser is "supposed" to open inside itself if the download is marked as inline.

Peter
Synoptek Web Team
New Member
New Member
Posts:10


--
12/22/2011 12:53 AM
Peter,

Thanks for your response. I appreciate your time.

I fired up Fiddler and it appears that regardless of whether the Default Action for my PDF type is set to View or Download, the Content-Disposition response header remains as 'attachment'.

Content-Disposition: attachment; filename="myfilename.pdf"

Do you have any other suggestions for me to try?

Thanks again.
Peter Donker
Veteran Member
Veteran Member
Posts:4536


--
12/23/2011 12:53 PM
You'd need to tweak the following function in ViewCollection.ascx (in ViewThreeePanel.js there is the same bit of code which is used if you use the 3-panel layout):

GridItemDoubleClick()

There is the following bit of code:
if (eventArgs.get_item().getMember('EntryType').get_value().startsWith('File')) {
window.open(baseUrl + baseUrlSuffix + 'Command=Core_Download&EntryId=' + eventArgs.get_item().getMember('EntryId').get_value(), '', '');
}

Now you can add a parameter here called "Method" and set it to "inline". So it becomes:

if (eventArgs.get_item().getMember('EntryType').get_value().startsWith('File')) {
window.open(baseUrl + baseUrlSuffix + 'Command=Core_Download&Method=inline&EntryId=' + eventArgs.get_item().getMember('EntryId').get_value(), '', '');
}

That should make the browser try to open every double-clicked item inside itself.

Peter
villers frederic
New Member
New Member
Posts:4


--
05/07/2012 6:37 PM
Hi peter,

I have exactly the same settings and configuration (dnn 6 + doc exch 6.02) and face the same problem.

furthermore i do not even see a view icon when i right click on a pdf file.

Well when it is on an image.(jpeg)

With other web site i do not have this problem with pdf(with the same browser and config of course).

What am i doing wrong ?

I thank you in advance for your help.

Best regards

frédéric

villers frederic
New Member
New Member
Posts:4


--
05/07/2012 7:14 PM
Update to my previous post

I did the modification in ViewThreeePanel.js and it is working in the 3 panel template (double click now open the pdf in the browser).

It is a good point.

But it do not function in the 2 panel view or in template view as i did not find the function described by peter in ViewCollection.ascx !

Also when i right click on a pdf file i do not see the 'view' icon.

When i do the same on a picture (jpg) i do well see the 'view' icon !

Help please

best regards

frédéric
Peter Donker
Veteran Member
Veteran Member
Posts:4536


--
05/14/2012 12:03 PM
Hi Frederic,

It's there in the ViewCollection.js which is now for the 2-panel layout. The template view is a completely different UI and has no JS for double click nor the Ajax grid. So it doesn't apply there. The template view can be adjusted in any way you like and you can add JS by adding a file template.js to the template. That will get loaded automatically.

The "view" icon I guess you mean to say you don't see the menu option. This depends on the availability of a so-called ViewControl. The table DMX_Extensions is where all file types are stored. There you'll find the column ViewControl as well. Is that set for the pdf file type? It should be "Bring2mind/DMX/Controls/View/File.Adobe.Acrobat.ascx"

Peter
BartS
New Member
New Member
Posts:12


--
05/14/2013 9:46 PM
Hi Peter
I have a similar problem but this time with AVI files.
When you double click on an AVI file he browser tries to open the file and it looks like it is trying to open the file as if it is a document meaning you end up with a page full of garbage characters.


I've edited the file types for avi to various different known mime types for avi but the result is the same every time.

I then tried to change the default behavior to download for .avi files but it still tries to open the file.

Any ideas of what might be wrong?
Peter Donker
Veteran Member
Veteran Member
Posts:4536


--
05/15/2013 3:08 PM
Hi Bart,

And when you right-click to download it downloads, right?

Peter
BartS
New Member
New Member
Posts:12


--
05/15/2013 5:20 PM
Hi Peter
Yes, when I right-click on the file and then select download it downloads.

But when a user double-click on the file it tries to open it even though I've set this file type to download and not open.
Peter Donker
Veteran Member
Veteran Member
Posts:4536


--
05/22/2013 12:01 PM
Then the browser must somehow be overriding the setting. If you use Fiddler you should be able to see the call to download.aspx that is the result of the double click. If you've set the item to download, in the headers you should see "Content-Disposition: " and then "attachment" or "inline". The former tells the browser to go for download. What does it say in your case?

Peter
You are not authorized to post a reply.