Forums

Home » Liferay Portal » English » 3. Development

Combination View Flat View Tree View
Threads [ Previous | Next ]
toggle
Luca Lupo
Button open Documents and Media
October 15, 2012 3:36 AM
Answer

Luca Lupo

Rank: Regular Member

Posts: 106

Join Date: October 1, 2012

Recent Posts

Hi Guys,

Do you know how can I create a button (Select) that opens the select documents and media?

Thanks
Luca Lupo
RE: Button open Documents and Media
October 16, 2012 12:32 AM
Answer

Luca Lupo

Rank: Regular Member

Posts: 106

Join Date: October 1, 2012

Recent Posts

somebody?
Alex Curtui
RE: Button open Documents and Media
August 20, 2013 12:28 AM
Answer

Alex Curtui

Rank: Junior Member

Posts: 30

Join Date: November 8, 2012

Recent Posts

Hello,

Have you found a solution?
Zsigmond Rab
RE: Button open Documents and Media
August 20, 2013 12:21 PM
Answer

Zsigmond Rab

LIFERAY STAFF

Rank: Liferay Master

Posts: 650

Join Date: January 4, 2010

Recent Posts

Hi Guys,

for selecting folder, you can find an example in the code of the configuration of the "Document and Media Display" portlet. Find the Select button for the "Root Folder".

If you need a complete selector with having files on it also, you can start at the web content editor with a structure which has a "Document and Media" type field.

Regards,
Zsigmond
Alex Curtui
RE: Button open Documents and Media
August 21, 2013 12:59 AM
Answer

Alex Curtui

Rank: Junior Member

Posts: 30

Join Date: November 8, 2012

Recent Posts

Hello again, and thank you emoticon

This is the working solution I ended with, in case someone needs it in the future:

 1<liferay-portlet:renderURL portletName="15" windowState="<%= LiferayWindowState.POP_UP.toString() %>" var="selectDLURL">
 2    <liferay-portlet:param name="struts_action" value="/journal/select_document_library" />
 3    <liferay-portlet:param name="currentURL" value="<%= PortalUtil.getCurrentURL(request) %>" />
 4    <liferay-portlet:param name="groupId" value="<%= String.valueOf(themeDisplay.getDoAsGroupId()) %>" />
 5</liferay-portlet:renderURL>
 6
 7<img id="<portlet:namespace/>imageDisplay" class="group-image-preview" src=""/>
 8
 9<aui:button
10    id="imageLookup"
11    name="imageLookup"
12    value="select"
13/>
14
15<aui:script use="aui-base">
16    var <portlet:namespace/>imagePopup;
17
18    _15_selectDocumentLibrary = function(url){
19        <portlet:namespace/>imagePopup.close();
20        A.one("#<portlet:namespace/>imageDisplay").set("src","<%= themeDisplay.getPortalURL() %>" + url);
21    };
22
23    A.one("#<portlet:namespace/>imageLookup").on("click", function(event){
24        <portlet:namespace/>imagePopup = window.open('${ selectDLURL }', 'Select image', 'directories=no,height=640,location=no,menubar=no,resizable=yes,scrollbars=yes,status=no,toolbar=no,width=680');
25    });
26</aui:script>
Kiran Yalavali
RE: Button open Documents and Media
July 20, 2015 10:54 PM
Answer

Kiran Yalavali

Rank: Regular Member

Posts: 118

Join Date: October 15, 2014

Recent Posts

Hi Alex,
I can follow that code but not working properly,
can u send me code for PopUp image.
pls help me.


Thanks,
kiran
Liferay Dev
RE: Button open Documents and Media
July 21, 2015 3:56 AM
Answer

Liferay Dev

Rank: Junior Member

Posts: 53

Join Date: May 17, 2015

Recent Posts

http://liferayguide.blogspot.in/2013/02/document-and-media-select-option-in.html

https://www.liferay.com/community/forums/-/message_boards/message/39211598

http://liferaypower.blogspot.com/2013/04/getting-images-from-document-and-media.html?_sm_au_=iVVZZ7ftM5NTNkq7
Kiran Yalavali
RE: Button open Documents and Media
July 23, 2015 4:05 AM
Answer

Kiran Yalavali

Rank: Regular Member

Posts: 118

Join Date: October 15, 2014

Recent Posts

Thank you so much krishna,