留言板

liferay-ui:logo-selector inside JSF page

thumbnail
Natalie D,修改在12 年前。

liferay-ui:logo-selector inside JSF page

Junior Member 帖子: 55 加入日期: 12-2-6 最近的帖子
Question is: how to place link for changing user's avatar on the JSF page?
From JSP it is obvious: just copy & paste following code from Liferay built-in html/portlet/users_admin/user/details.jsp:


	<div>
		<c:if test="<%= selUser != null %>">
			<portlet:renderurl windowstate="<%= LiferayWindowState.POP_UP.toString() %>" var="editUserPortraitURL">
				<portlet:param name="struts_action" value="/users_admin/edit_user_portrait" />
				<portlet:param name="redirect" value="<%= currentURL %>" />
				<portlet:param name="p_u_i_d" value="<%= String.valueOf(selUser.getUserId()) %>" />
				<portlet:param name="portrait_id" value="<%= String.valueOf(selUser.getPortraitId()) %>" />
			</portlet:renderurl>

			<liferay-ui:logo-selector defaultLogoURL="<%= UserConstants.getPortraitURL(themeDisplay.getPathImage(), selUser.isMale(), 0) %>" editLogoURL="<%= editUserPortraitURL %>" imageId="<%= selUser.getPortraitId() %>" logoDisplaySelector=".user-logo" showBackground="<%= false %>" />
		</c:if>
	</div>


But code above is JSP mixed with alloy-ui & scriptlets... and produces higly complicated HTML content with "onclick" javascript methods.. And thus I cannot port it to my JSF portlet.

Ps. It may be that whole job is to open pop-up window with editUserPortraitURL - but how to do that without AlloyUI?
thumbnail
David H Nebinger,修改在12 年前。

RE: liferay-ui:logo-selector inside JSF page

Liferay Legend 帖子: 14916 加入日期: 06-9-2 最近的帖子
I believe the portlet-bridges.org site has some JSF-compatible tags for some of the Liferay and AUI tags. You might want to see if they have one for the logo...
thumbnail
Natalie D,修改在12 年前。

RE: liferay-ui:logo-selector inside JSF page

Junior Member 帖子: 55 加入日期: 12-2-6 最近的帖子
David H Nebinger:
I believe the portlet-bridges.org site has some JSF-compatible tags for some of the Liferay and AUI tags. You might want to see if they have one for the logo...


NO, portlet bridges doesn't not have such a tag. I have to implement this popup window on my own - but now I have more important tasks.

Ps. this should be so easy - why it is not? AlloyUI make me headache every day I have to work with it.
thumbnail
David H Nebinger,修改在12 年前。

RE: liferay-ui:logo-selector inside JSF page

Liferay Legend 帖子: 14916 加入日期: 06-9-2 最近的帖子
Alloy and JSF are two different beasts entirely and cannot be natively mixed.

The site that I was trying to remember was portletfaces.org, try their site for possibilities:

http://www.portletfaces.org/projects/alloyfaces
http://www.portletfaces.org/projects/liferayfaces
thumbnail
Natalie D,修改在12 年前。

RE: liferay-ui:logo-selector inside JSF page (答复)

Junior Member 帖子: 55 加入日期: 12-2-6 最近的帖子
David H Nebinger:
Alloy and JSF are two different beasts entirely and cannot be natively mixed.

The site that I was trying to remember was portletfaces.org, try their site for possibilities:

http://www.portletfaces.org/projects/alloyfaces
http://www.portletfaces.org/projects/liferayfaces


I perfectly know what you did mean. And I know that JSF and Alloy are two totally different worlds.
But only what I was looking for, was the way to open a pop-up window (the one that is bundled within liferay: to edit user avatar/logo) from the JSF page. I've carefully looked into code generated by liferay-ui:logo-selector but there is so many <span> tags and genereated javascript that opens the popup that I've decided to post my question here.


Note for the others: now I know that choosing JSF for new portlet was not a perfect idea - although JSF is nice and clean - I cannot use any existing Liferay's functionality - which unfortunately have been entirely written with AlloyUI in scriptlet way...
If I would have some free time and solve this problem I'll post my solution in the future.

Thanks for your time David. Topic to close.
thumbnail
David H Nebinger,修改在12 年前。

RE: liferay-ui:logo-selector inside JSF page

Liferay Legend 帖子: 14916 加入日期: 06-9-2 最近的帖子
JSF is a good option for new portlets, portlets that need to leverage Liferay services, etc., but as you've said is not the best option if you need to use and/or leverage Liferay and Alloy tags.

The links I provided above can help mitigate using Liferay and/or Alloy tags in JSF, but they do not provide complete coverage (I think mostly due to difference in tag architectures of JSP vs JSF in combination w/ architectural differences between the frameworks).

I'm glad you found a solution that will work for you, Natalie.
thumbnail
Sunil Rai,修改在12 年前。

RE: liferay-ui:logo-selector inside JSF page

Junior Member 帖子: 57 加入日期: 12-1-31 最近的帖子
I want to hide the avatars in message board thread but I am not getting any such option in the interface of configuration.

As per my understanding I got an idea how to edit User profile Picture in Message Board. Inside message_board portlet file "view_thread_message.jspf" is having following code: <liferay-ui:user-display userId="<%= message.getUserId() %>" userName="<%= message.getUserName() %>" displayStyle="<%= 2 %>" >
But not sure which part I have to remove for user profile picture removal. Any guidance will be great for me. Thanks
thumbnail
Neil Griffin,修改在12 年前。

RE: liferay-ui:logo-selector inside JSF page

Liferay Legend 帖子: 2655 加入日期: 05-7-27 最近的帖子
I just moved this thread to the new "Liferay Faces" forum and created a feature request in JIRA:
http://issues.liferay.com/browse/FACES-1165