Created
January 28, 2015 22:42
-
-
Save evaldeslacasa/e13da74b5c48dceb57ca to your computer and use it in GitHub Desktop.
Add pop up URLs for each user displayed in a search container column text (URLs stored in an arraylist)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<% | |
List<String> popUpURLs = new ArrayList(); | |
for(String userId:userIds){ | |
User user = UserLocalServiceUtil.getUser(Long.valueOf(userId)); | |
%> | |
<portlet:renderURL var="viewUserPopUp" windowState="pop_up"> | |
<portlet:param name="userId" | |
value="<%=String.valueOf(user.getUserId())%>" /> | |
<portlet:param name="page" value="display_user" /> | |
</portlet:renderURL> | |
<% | |
String popUpURL = "javascript:openSizedPopup('" | |
+ viewUserPopUp + "','User Details',640)"; | |
popUpURLs.add(popUpURL); | |
} | |
%> | |
<liferay-ui:search-container-column-text | |
buffer="buffer" | |
name="User Name" | |
orderable="<%= true %>" | |
orderableProperty="userName" > | |
<% | |
for(int i=0; i<userIdsArray.length; i++){ | |
String userId = userIdsArray[i]; | |
User student = UserLocalServiceUtil.getUser(Long.valueOf(userId)); | |
buffer.append("<span class=\"user-name\" id=\""); | |
buffer.append(userId); | |
buffer.append("\">"); | |
buffer.append("<a href=\"" + popUpURLs.get(i) + "\">"); | |
buffer.append(LanguageUtil.get(pageContext,user.getFullName())); | |
buffer.append("</a>"); | |
buffer.append("</span>"); | |
if(i < (userIdsArray.length-1)){ | |
buffer.append("<br/>"); | |
} | |
} | |
%> | |
</liferay-ui:search-container-column-text> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Liferay includes the javascript:openSizedPopup(url,title,width) for this.