Fórum

Are buttons meant to work at this point?

Charles Johnson, modificado 8 Anos atrás.

Are buttons meant to work at this point?

Junior Member Postagens: 25 Data de Entrada: 01/05/15 Postagens Recentes
https://dev.liferay.com/develop/learning-paths/mvc/-/knowledge_base/6-2/creating-action-buttons

that is, on completion of the above? If so, how are they activated?
thumbnail
Alexey Kakunin, modificado 8 Anos atrás.

RE: Are buttons meant to work at this point?

Liferay Master Postagens: 621 Data de Entrada: 07/07/08 Postagens Recentes
Hi Charles!

What do you mean under activation?

====
Alexey Kakunin
Liferay Experts in Russia
Charles Johnson, modificado 8 Anos atrás.

RE: Are buttons meant to work at this point?

Junior Member Postagens: 25 Data de Entrada: 01/05/15 Postagens Recentes
I mean - what causes them to appear? (Because i can't get them to appear)
thumbnail
Andew Jardine, modificado 8 Anos atrás.

RE: Are buttons meant to work at this point?

Liferay Legend Postagens: 2416 Data de Entrada: 22/12/10 Postagens Recentes
Is the entire button missing? or are you just missing the options from the button itself?

Based on what the tutorial is showing (I just scanned it quickly) you're providing features based on a users permissions. Which user are you working with? the default test user or a custom user you have created?
Charles Johnson, modificado 8 Anos atrás.

RE: Are buttons meant to work at this point?

Junior Member Postagens: 25 Data de Entrada: 01/05/15 Postagens Recentes
Well i can't see anything at all. The Add Guestbook Add Entry buttons are there but i don't know where the 'context menu' style buttons this section creates are even meant to appear.

I'm viewing as the default test@liferay.com user
thumbnail
Andew Jardine, modificado 8 Anos atrás.

RE: Are buttons meant to work at this point?

Liferay Legend Postagens: 2416 Data de Entrada: 22/12/10 Postagens Recentes
Ok -- so your user should have permission. Can you share with us the code for the JSP where you have the button defined, as well as the JSP with the button logic?
Charles Johnson, modificado 8 Anos atrás.

RE: Are buttons meant to work at this point?

Junior Member Postagens: 25 Data de Entrada: 01/05/15 Postagens Recentes
<%@include file="/html/init.jsp"%>

<%
	String mvcPath = ParamUtil.getString(request, "mvcPath");

	ResultRow row = (ResultRow) request
			.getAttribute(WebKeys.SEARCH_CONTAINER_RESULT_ROW);

	Entry entry = (Entry) row.getObject();
%>

<liferay-ui:icon-menu>

	<c:if test="<%= EntryPermission.contains(permissionChecker, entry.getEntryId(), ActionKeys.UPDATE) %>">
		<portlet:renderurl var="editURL">
			<portlet:param name="entryId" value="<%= String.valueOf(entry.getEntryId()) %>" />
			<portlet:param name="mvcPath" value="/html/guestbook/edit_entry.jsp" />
		</portlet:renderurl>

		<liferay-ui:icon image="edit" message="Edit" url="<% =editURL.toString() %>" />
	</c:if>

	<c:if test="<%=EntryPermission.contains(permissionChecker, entry.getEntryId(), ActionKeys.PERMISSIONS) %>">

		<liferay-security:permissionsurl modelResource="<%= Entry.class.getName() %>" modelResourceDescription="<%= entry.getMessage() %>" resourcePrimKey="<%= String.valueOf(entry.getEntryId()) %>" var="permissionsURL" />

		<liferay-ui:icon image="permissions" url="<%= permissionsURL %>" />

	</c:if>
	<c:if test="<%=EntryPermission.contains(permissionChecker, entry.getEntryId(), ActionKeys.DELETE) %>">

		<portlet:actionurl name="deleteEntry" var="deleteURL">
			<portlet:param name="entryId" value="<%= String.valueOf(entry.getEntryId()) %>" />
			<portlet:param name="guestbookId" value="<%= String.valueOf(entry.getGuestbookId()) %>" />
		</portlet:actionurl>

		<liferay-ui:icon-delete url="<%=deleteURL.toString() %>" />
	</c:if>

</liferay-ui:icon-menu>

is the button code (currently showing 'bogus' [afaics] error messages in the Liferay IDE)
thumbnail
Andew Jardine, modificado 8 Anos atrás.

RE: Are buttons meant to work at this point?

Liferay Legend Postagens: 2416 Data de Entrada: 22/12/10 Postagens Recentes
What happens if you use this instead --


&lt;%@include file="/html/init.jsp"%&gt;

&lt;%
String mvcPath = ParamUtil.getString(request, "mvcPath");

ResultRow row = (ResultRow) request
.getAttribute(WebKeys.SEARCH_CONTAINER_RESULT_ROW);

Entry entry = (Entry) row.getObject();
%&gt;

<liferay-ui:icon-menu>

<portlet:renderurl var="editURL">
<portlet:param name="entryId" value="<%= String.valueOf(entry.getEntryId()) %>" />
<portlet:param name="mvcPath" value="/html/guestbook/edit_entry.jsp" />
</portlet:renderurl>

<liferay-ui:icon image="edit" message="Edit" url="<% =editURL.toString() %>" />


<liferay-security:permissionsurl modelResource="<%= Entry.class.getName() %>" modelResourceDescription="<%= entry.getMessage() %>" resourcePrimKey="<%= String.valueOf(entry.getEntryId()) %>" var="permissionsURL" />

<liferay-ui:icon image="permissions" url="<%= permissionsURL %>" />


<portlet:actionurl name="deleteEntry" var="deleteURL">
<portlet:param name="entryId" value="<%= String.valueOf(entry.getEntryId()) %>" />
<portlet:param name="guestbookId" value="<%= String.valueOf(entry.getGuestbookId()) %>" />
</portlet:actionurl>

<liferay-ui:icon-delete url="<%=deleteURL.toString() %>" />

</liferay-ui:icon-menu>


(all I have done is removed the permission checks)

EDIT: I mean I remove the conditional logic that might be preventing the button from displaying.
Charles Johnson, modificado 8 Anos atrás.

RE: Are buttons meant to work at this point?

Junior Member Postagens: 25 Data de Entrada: 01/05/15 Postagens Recentes
Unfortunately that doesn't change anything
thumbnail
Richard Sezov, modificado 8 Anos atrás.

RE: Are buttons meant to work at this point?

Regular Member Postagens: 220 Data de Entrada: 07/02/07 Postagens Recentes
Hrm; it looks like you've identified some missing instructions in this Learning Path. There's one step left after you've completed this.

Open the Guestbook portlet's view.jsp file and scroll down to the bottom. You're about to add a column to the Search Container, so place your cursor after the last column, but before the ending tag
. Add this tag:



<liferay-ui:search-container-column-jsp path="/html/guestbook/guestbook_actions.jsp" align="right" />



This causes the action buttons to display for each Guestbook entry.

Thanks for catching this; we'll post an update soon!
Charles Johnson, modificado 8 Anos atrás.

RE: Are buttons meant to work at this point?

Junior Member Postagens: 25 Data de Entrada: 01/05/15 Postagens Recentes
Thanks for catching this; we'll post an update soon!


Thanks. It would have been useful to have a copy of the source code to go along with the tutorial too