Vista Combinata Vista Piatta Vista ad Albero
Discussioni [ Precedente | Successivo ]
Natalie D
liferay-ui:logo-selector inside JSF page
21 marzo 2012 1.40
Risposta

Natalie D

Punteggio: Junior Member

Messaggi: 55

Data di Iscrizione: 6 febbraio 2012

Messaggi recenti

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:

 1
 2    <div>
 3        <c:if test="<%= selUser != null %>">
 4            <portlet:renderURL windowState="<%= LiferayWindowState.POP_UP.toString() %>" var="editUserPortraitURL">
 5                <portlet:param name="struts_action" value="/users_admin/edit_user_portrait" />
 6                <portlet:param name="redirect" value="<%= currentURL %>" />
 7                <portlet:param name="p_u_i_d" value="<%= String.valueOf(selUser.getUserId()) %>" />
 8                <portlet:param name="portrait_id" value="<%= String.valueOf(selUser.getPortraitId()) %>" />
 9            </portlet:renderURL>
10
11            <liferay-ui:logo-selector
12                defaultLogoURL="<%= UserConstants.getPortraitURL(themeDisplay.getPathImage(), selUser.isMale(), 0) %>"
13                editLogoURL="<%= editUserPortraitURL %>"
14                imageId="<%= selUser.getPortraitId() %>"
15                logoDisplaySelector=".user-logo"
16                showBackground="<%= false %>"
17            />
18        </c:if>
19    </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?
David H Nebinger
RE: liferay-ui:logo-selector inside JSF page
21 marzo 2012 6.23
Risposta

David H Nebinger

Punteggio: Liferay Legend

Messaggi: 7851

Data di Iscrizione: 1 settembre 2006

Messaggi recenti

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...
Natalie D
RE: liferay-ui:logo-selector inside JSF page
27 marzo 2012 1.48
Risposta

Natalie D

Punteggio: Junior Member

Messaggi: 55

Data di Iscrizione: 6 febbraio 2012

Messaggi recenti

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.
David H Nebinger
RE: liferay-ui:logo-selector inside JSF page
27 marzo 2012 6.32
Risposta

David H Nebinger

Punteggio: Liferay Legend

Messaggi: 7851

Data di Iscrizione: 1 settembre 2006

Messaggi recenti

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
Natalie D
RE: liferay-ui:logo-selector inside JSF page
27 marzo 2012 7.20
Risposta

Natalie D

Punteggio: Junior Member

Messaggi: 55

Data di Iscrizione: 6 febbraio 2012

Messaggi recenti

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.
David H Nebinger
RE: liferay-ui:logo-selector inside JSF page
28 marzo 2012 8.14
Risposta

David H Nebinger

Punteggio: Liferay Legend

Messaggi: 7851

Data di Iscrizione: 1 settembre 2006

Messaggi recenti

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.
Sunil Rai
RE: liferay-ui:logo-selector inside JSF page
3 aprile 2012 3.38
Risposta

Sunil Rai

Punteggio: Junior Member

Messaggi: 45

Data di Iscrizione: 31 gennaio 2012

Messaggi recenti

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
Neil Griffin
RE: liferay-ui:logo-selector inside JSF page
10 aprile 2012 4.53
Risposta

Neil Griffin

LIFERAY STAFF

Punteggio: Liferay Legend

Messaggi: 2206

Data di Iscrizione: 26 luglio 2005

Messaggi recenti

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