Forums

Home » Liferay Portal » English » 3. Development

Combination View Flat View Tree View
Threads [ Previous | Next ]
toggle
Luca Lupo
Open list with button
October 15, 2012 3:34 AM
Answer

Luca Lupo

Rank: Regular Member

Posts: 106

Join Date: October 1, 2012

Recent Posts

Hi Guys,

I'm still new of Liferay and I do not have a lot of experience, especially regarding the view layer. I hope you can help me.

I have to create a button (aui or not?) on a portlet (jsp side) inside a form. By clicking on this button i would like to open (as a sort of popup) a list of entries. Every row is a icon. I try to attach a picture to explain better.

https://dl.dropbox.com/u/1127848/Screen%20Shot%202012-10-07%20at%202.56.46%20PM.png

However, instead icon and text i will use only icon.

Do you have any idea about doing that?

Thanks,

Luca
Bart Simpson
RE: Open list with button
October 7, 2012 7:27 AM
Answer

Bart Simpson

Rank: Liferay Master

Posts: 524

Join Date: August 29, 2011

Recent Posts

The easiest way I could think of is to use the code similar to add_asset.jspf
There is varaible 'message' that contains the text. To render the list, the tag
1<liferay-ui:icon>
is used, you can pass the
1message
attribute as "empty" so the code will look something like:

1<liferay-ui:icon
2                message=""
3                src="<%= assetRendererFactory.getIconPath(renderRequest) %>"
4                url="<%= taglibEditURL %>"
5/>


Hope it helps
Luca Lupo
RE: Open list with button
October 7, 2012 12:26 PM
Answer

Luca Lupo

Rank: Regular Member

Posts: 106

Join Date: October 1, 2012

Recent Posts

Thanks Bart...I'm trying with that...but it seems that it is not possible to use custom images emoticon
Bart Simpson
RE: Open list with button
October 7, 2012 9:52 PM
Answer

Bart Simpson

Rank: Liferay Master

Posts: 524

Join Date: August 29, 2011

Recent Posts

In my comment above, the line
1src="<%= assetRendererFactory.getIconPath(renderRequest) %>"
contains the source of icon image. You can change it to you'r custom value and should be able to get the custom image.
Tanweer .
RE: Open list with button
October 7, 2012 11:09 PM
Answer

Tanweer .

Rank: Expert

Posts: 319

Join Date: March 11, 2010

Recent Posts

Luca Lupo:
Thanks Bart...I'm trying with that...but it seems that it is not possible to use custom images emoticon


Hi Luca,

Try the below Tested solution

In JSP,
1<liferay-ui:icon image="yourImage"
2                                       message=" "
3                               url="put your url here" />


In Themes,
GoTo YourTheme/images/common And put the yourImage.png image there.

Make sure the image format is png.

Let me know if this helps.


Regards,
Tanweer,
LIUG Member