Foren
action button with popup menu
Ketan Savaliya, geändert vor 13 Jahren.
action button with popup menu
Regular Member Beiträge: 117 Beitrittsdatum: 03.03.11 Neueste Beiträge
i want action button like in liferay role in control panel, each role have action button and it's open like view, assign member etc...
if i click any of option then go to specific jsp page, so, where is the mapping of this action in which file?
if i click any of option then go to specific jsp page, so, where is the mapping of this action in which file?
Sandeep Nair, geändert vor 13 Jahren.
RE: action button with popup menu
Liferay Legend Beiträge: 1744 Beitrittsdatum: 06.11.08 Neueste Beiträge
Hi,
Check out view_users and user_action.jsp of liferay src
You have to use following to include the jsp which has actions
<liferay-ui:search-container-column-jsp
align="right"
path="/html/portlet/enterprise_admin/user_action.jsp"
/>
And to show buttons you have to use <liferay-ui:icon-menu> in the action.jsp. Check out user_action.jsp to see the action urls defined.
Regards,
Sandeep
Check out view_users and user_action.jsp of liferay src
You have to use following to include the jsp which has actions
<liferay-ui:search-container-column-jsp
align="right"
path="/html/portlet/enterprise_admin/user_action.jsp"
/>
And to show buttons you have to use <liferay-ui:icon-menu> in the action.jsp. Check out user_action.jsp to see the action urls defined.
Regards,
Sandeep
Ketan Savaliya, geändert vor 13 Jahren.
RE: action button with popup menu
Regular Member Beiträge: 117 Beitrittsdatum: 03.03.11 Neueste Beiträge
thankx for reply,
i test your code, it display action button and also option, but when i click on any one option then i want to go some jsp page then where i mention that file maping?
my code is
================
<liferay-ui:icon-menu>
<portlet:actionURL name="updateStudType" var="editStudTypeURL">
<portlet:param name="resourcePrimKey" value="<%=primKey %>" />
</portlet:actionURL>
</liferay-ui:icon-menu>
i test your code, it display action button and also option, but when i click on any one option then i want to go some jsp page then where i mention that file maping?
my code is
================
<liferay-ui:icon-menu>
<portlet:actionURL name="updateStudType" var="editStudTypeURL">
<portlet:param name="resourcePrimKey" value="<%=primKey %>" />
</portlet:actionURL>
</liferay-ui:icon-menu>
Sandeep Nair, geändert vor 13 Jahren.
RE: action button with popup menu
Liferay Legend Beiträge: 1744 Beitrittsdatum: 06.11.08 Neueste Beiträge
Is it you custom portlet? If so you need to create an action or renderURL and forward it to your respective jsp page from doView Method.
Suresh Chinna Pillai, geändert vor 13 Jahren.
RE: action button with popup menu
New Member Beiträge: 16 Beitrittsdatum: 14.02.11 Neueste Beiträge
Hi Sandeep,
I am new to Liferay, where can I get the src code of the Liferay?
For example as you said that"user_action.jsp","user_action.jsp"
Thanks,
-Suresh.
Hi,
Check out view_users and user_action.jsp of liferay src
You have to use following to include the jsp which has actions
<liferay-ui:search-container-column-jsp
align="right"
path="/html/portlet/enterprise_admin/user_action.jsp"
/>
And to show buttons you have to use <liferay-ui:icon-menu> in the action.jsp. Check out user_action.jsp to see the action urls defined.
Regards,
Sandeep
I am new to Liferay, where can I get the src code of the Liferay?
For example as you said that"user_action.jsp","user_action.jsp"
Thanks,
-Suresh.
Sandeep Nair, geändert vor 13 Jahren.
RE: action button with popup menu
Liferay Legend Beiträge: 1744 Beitrittsdatum: 06.11.08 Neueste Beiträge
You can get it from sourceforge. Following are the links for 6.0.5 and 6.0.6
http://sourceforge.net/projects/lportal/files/Liferay%20Portal/6.0.6/liferay-portal-src-6.0.6-20110225.zip/download
http://sourceforge.net/projects/lportal/files/Liferay%20Portal/6.0.5/liferay-portal-src-6.0.5.zip/download
Regards,
Sandeep
http://sourceforge.net/projects/lportal/files/Liferay%20Portal/6.0.6/liferay-portal-src-6.0.6-20110225.zip/download
http://sourceforge.net/projects/lportal/files/Liferay%20Portal/6.0.5/liferay-portal-src-6.0.5.zip/download
Regards,
Sandeep
Suresh Chinna Pillai, geändert vor 13 Jahren.
RE: action button with popup menu
New Member Beiträge: 16 Beitrittsdatum: 14.02.11 Neueste Beiträge
Hi Sandeep,
Thank you for your reply..
I have two doubts.
1) I want to display the list of users in search container.I achieved it.Please view the attached image.
I want to do when I clicking on a particular UserName on the search container,it will go to another page(for example: edit mode of the same portlet).In that I have to display the details of the selected user.I tried with session but it will result the last user in that page.
How can I achieve this?
2)And I want to know how to use the row checkers in search container.for example, If I select 2 users from the list to delete how can I get the screen name/user id of the selected users in action class?
Please verify my code..
/html/checkportlet/view.jsp
/html/checkportlet/edit.jsp
This code will result last user(for example : 'sbmuser2' according to the attached image).
Action class(CheckPortlet.java)
Thank you for your reply..
I have two doubts.
1) I want to display the list of users in search container.I achieved it.Please view the attached image.
I want to do when I clicking on a particular UserName on the search container,it will go to another page(for example: edit mode of the same portlet).In that I have to display the details of the selected user.I tried with session but it will result the last user in that page.
How can I achieve this?
2)And I want to know how to use the row checkers in search container.for example, If I select 2 users from the list to delete how can I get the screen name/user id of the selected users in action class?
Please verify my code..
/html/checkportlet/view.jsp
<%@ taglib uri="http://java.sun.com/portlet_2_0" prefix="portlet" %>
<%@ taglib uri="http://liferay.com/tld/ui" prefix="liferay-ui" %>
<%@ page import="java.util.List"%>
<%@ page import="com.liferay.portal.model.UserGroup" %>
<%@ page import="com.liferay.portal.model.User" %>
<%@ page import="com.liferay.portal.service.*" %>
<%@ page import="com.liferay.portal.util.PortalUtil"%>
<%@ page import="com.liferay.portal.kernel.util.ListUtil"%>
<%@ page import="com.liferay.portal.service.UserLocalServiceUtil" %>
<%! List<user> users = null;
int totalNoOfUsers=0;
String value;
%>
<%
out.println(UserLocalServiceUtil.getUsersCount());
totalNoOfUsers = UserLocalServiceUtil.getUsersCount();
users=UserLocalServiceUtil.getUsers(0,totalNoOfUsers);
%>
<%@page import="javax.portlet.PortletMode"%>
<%@page import="javax.portlet.ActionRequest"%>
<%@page import="javax.portlet.ActionResponse"%>
<%@page import="com.liferay.portal.kernel.dao.search.RowChecker" %>
<%@page import="com.liferay.portal.kernel.util.PropsUtil"%><portlet:defineobjects />
<h1>HAI!!!</h1>
<form name="frmList" method="post" action="<portlet:actionURL></portlet:actionURL>">
<liferay-ui:search-container delta="10" emptyresultsmessage="No Users were found" rowchecker="<%=new RowChecker(renderResponse) %>">
<liferay-ui:search-container-results results="<%= ListUtil.subList(users,searchContainer.getStart(),searchContainer.getEnd()) %>" total="<%= totalNoOfUsers %>">
</liferay-ui:search-container-results>
<liferay-ui:search-container-row classname="com.liferay.portal.model.User" modelvar="user">
<liferay-ui:search-container-row-parameter name="rowIds" value="<%= user.getUserId()%>"></liferay-ui:search-container-row-parameter>
<liferay-ui:search-container-column-text name="UserName" value="<%= user.getScreenName()%>" href="javascript:submitForm();" />
<script type="text/javascript">
function submitForm(){
<%
session.setAttribute("ses1",user.getScreenName());
%>
document.forms["form1"].submit();
}
</script>
<liferay-ui:search-container-column-text name="First Name" value="<%= user.getFirstName() %>">
</liferay-ui:search-container-column-text>
<liferay-ui:search-container-column-text name="Last Name" value="<%= user.getLastName() %>">
</liferay-ui:search-container-column-text>
<liferay-ui:search-container-column-text name="Title" value="<%= user.getJobTitle() %>">
</liferay-ui:search-container-column-text>
</liferay-ui:search-container-row>
<liferay-ui:search-iterator />
</liferay-ui:search-container>
<input type="submit" value="edit">
</form>
This is the <b>CheckPortlet</b> portlet in View mode.
</user>
/html/checkportlet/edit.jsp
<%@ taglib uri="http://java.sun.com/portlet_2_0" prefix="portlet" %>
<portlet:defineobjects />
<h1>EDIT</h1>
<%
out.print("\n"+session.getAttribute("ses1"));
%>
This is the <b>CheckPortlet</b> portlet in Edit mode.
This code will result last user(for example : 'sbmuser2' according to the attached image).
Action class(CheckPortlet.java)
package com.test;
import java.io.IOException;
import javax.portlet.ActionRequest;
import javax.portlet.ActionResponse;
import javax.portlet.PortletException;
import javax.portlet.PortletMode;
import javax.portlet.RenderRequest;
import javax.portlet.RenderResponse;
import com.liferay.portal.kernel.util.ParamUtil;
import com.liferay.util.bridges.mvc.MVCPortlet;
import com.liferay.portal.kernel.dao.search.RowChecker;
public class CheckPortlet extends MVCPortlet {
public void processAction(ActionRequest request,ActionResponse response)throws PortletException,IOException{
System.out.print("\nAction");
long val[]=ParamUtil.getLongValues(request, "rowIds");
System.out.print("\n RowIds :"+val.length);
for(int i=0;i<val.length;i++){ system.out.print("\n"+val[i]); } response.setportletmode(portletmode.edit); @override public void doview(renderrequest renderrequest, renderresponse renderresponse) throws ioexception, portletexception { super.doview(renderrequest, renderresponse); < code></val.length;i++){>
<br><br> In this case the count of selected rows displayed correctly.But all of the values returns 0(zero). <br><br>Please reply me.<br>I am in a critical situation that I will finish this for my project before this month end.<br>If you have any sample code please send me to email "acm_7888@yahoo.com"<br><br>I am using Liferay6.0.5 bundled with Tomcat.<br>I hope that you will help me..<br><br>Thank You,<br>-Suresh.
Anhänge:
Sandeep Nair, geändert vor 13 Jahren.
RE: action button with popup menu
Liferay Legend Beiträge: 1744 Beitrittsdatum: 06.11.08 Neueste Beiträge
Hi,
I havent looked in your code but, instead of passing screen name in session pass it in hidden parameter. And in processaction use this "actionResponse.setRenderParameter("paramName", paramValue)". You will then be able to use the same in ur edit jsp.
Similarly for the rows that you have checked you can pass as hidden values. You can get comma separate primary key value of the row select if u use the following
Liferay.Util.listCheckedExcept(nameOfForm, "<portlet:namespace />allRowIds");
Regards,
Sandeep
I havent looked in your code but, instead of passing screen name in session pass it in hidden parameter. And in processaction use this "actionResponse.setRenderParameter("paramName", paramValue)". You will then be able to use the same in ur edit jsp.
Similarly for the rows that you have checked you can pass as hidden values. You can get comma separate primary key value of the row select if u use the following
Liferay.Util.listCheckedExcept(nameOfForm, "<portlet:namespace />allRowIds");
Regards,
Sandeep
Suresh Chinna Pillai, geändert vor 13 Jahren.
RE: action button with popup menu
New Member Beiträge: 16 Beitrittsdatum: 14.02.11 Neueste Beiträge
Thank You for your Reply Sandeep.
It is very helpful to me.
Please keep in touch with me..
Once again Thank you so much!
-Suresh.
It is very helpful to me.
Please keep in touch with me..
Once again Thank you so much!
-Suresh.
Suresh Chinna Pillai, geändert vor 13 Jahren.
RE: action button with popup menu
New Member Beiträge: 16 Beitrittsdatum: 14.02.11 Neueste Beiträge
Hi Sandeep,
Is there any possibility to customize portlet using css?
I want to make effects without creating theme. But only with css.
Thanks,
-Suresh.
Is there any possibility to customize portlet using css?
I want to make effects without creating theme. But only with css.
Thanks,
-Suresh.
Raja Nagendra Kumar, geändert vor 13 Jahren.
RE: action button with popup menu
Expert Beiträge: 484 Beitrittsdatum: 02.03.06 Neueste Beiträge
You can do this by editing the existing theme's CSS file or through Admin Login with Config Mode.
Suresh Chinna Pillai, geändert vor 13 Jahren.
RE: action button with popup menu
New Member Beiträge: 16 Beitrittsdatum: 14.02.11 Neueste Beiträge
Hi All,
I want to restrict the portlet access depending on roles. For example, If a user has required permission he can communicate with the particular portlet. Otherwise, he can do nothing.
Thanks in advance,
-Suresh.
I want to restrict the portlet access depending on roles. For example, If a user has required permission he can communicate with the particular portlet. Otherwise, he can do nothing.
Thanks in advance,
-Suresh.
Raja Nagendra Kumar, geändert vor 13 Jahren.
RE: action button with popup menu
Expert Beiträge: 484 Beitrittsdatum: 02.03.06 Neueste Beiträge
>I want to restrict the portlet access depending on roles. For example, If a user has required permission he can communicate with the particular portlet. Otherwise, he can do nothing.
You can do this using the isUserInRole() api checks with in render, action methods or in View/Edit JSP pages.
More details at API http://portals.apache.org/pluto/portlet-1.0-apidocs/javax/portlet/PortletRequest.html#isUserInRole(java.lang.String)
Regards,
Nagendra
You can do this using the isUserInRole() api checks with in render, action methods or in View/Edit JSP pages.
More details at API http://portals.apache.org/pluto/portlet-1.0-apidocs/javax/portlet/PortletRequest.html#isUserInRole(java.lang.String)
Regards,
Nagendra
srinu sri, geändert vor 10 Jahren.
RE: action button with popup menu
Junior Member Beiträge: 29 Beitrittsdatum: 22.02.13 Neueste Beiträge
Hi,
I have popup with two buttons .But these two button functionality work in fire fox but not in chrome using jquery.please help me
I have popup with two buttons .But these two button functionality work in fire fox but not in chrome using jquery.please help me
Dhana Sekar, geändert vor 13 Jahren.
RE: action button with popup menu
New Member Beiträge: 7 Beitrittsdatum: 14.02.11 Neueste Beiträge
I am new to lifeary
i have created popup,then how to show information within the popup as grid form like search container rows like ....
can you send sample code for that ..
Thanks,
Dhanasekar.S
i have created popup,then how to show information within the popup as grid form like search container rows like ....
can you send sample code for that ..
Thanks,
Dhanasekar.S
Sandeep Nair, geändert vor 13 Jahren.
RE: action button with popup menu
Liferay Legend Beiträge: 1744 Beitrittsdatum: 06.11.08 Neueste Beiträge
I dont have sample code, you have to see existing code of liferay where they are using and try to replicate the same
Suresh Chinna Pillai, geändert vor 13 Jahren.
RE: action button with popup menu
New Member Beiträge: 16 Beitrittsdatum: 14.02.11 Neueste Beiträge
Hi Sandeep,
I added custom attributes to the Users.It was fine.
Is there any possibility to add custom attributes for the UserGroup in Liferay.
Pls help me..
Thanks,
-Suresh.
I added custom attributes to the Users.It was fine.
Is there any possibility to add custom attributes for the UserGroup in Liferay.
Pls help me..
Thanks,
-Suresh.
Ketan Savaliya, geändert vor 13 Jahren.
RE: action button with popup menu
Regular Member Beiträge: 117 Beitrittsdatum: 03.03.11 Neueste Beiträge
Hi, Liferay Master
How can i call javascript function from the <liferay-ui:icon image"" url="/> and then action method?
Please give me idea about that. or sample code for that
Regards
-Ketan
How can i call javascript function from the <liferay-ui:icon image"" url="/> and then action method?
Please give me idea about that. or sample code for that
Regards
-Ketan
Sandeep Nair, geändert vor 13 Jahren.
RE: action button with popup menu
Liferay Legend Beiträge: 1744 Beitrittsdatum: 06.11.08 Neueste Beiträge
Hi,
Havent tried the same.
Regards,
Sandeep
Havent tried the same.
Regards,
Sandeep
Ketan Savaliya, geändert vor 13 Jahren.
RE: action button with popup menu
Regular Member Beiträge: 117 Beitrittsdatum: 03.03.11 Neueste Beiträge
Thankx, Liferay Master
but
so, how can i achieve conformation dialog before any action from the action button?
Regards
ketan
but
so, how can i achieve conformation dialog before any action from the action button?
Regards
ketan
Masroor Khan, geändert vor 13 Jahren.
RE: action button with popup menu
Regular Member Beiträge: 124 Beitrittsdatum: 09.09.08 Neueste Beiträge
Hi,
you can call js onclick function
and in that function you can use
confirm("sometext");
Regards,
Masroor
you can call js onclick function
and in that function you can use
confirm("sometext");
Regards,
Masroor