如何将隐藏字段值或html列值传递到另一个jsp页面,并在liferay portlet中使用?
我在liferay的自定义portlet中有一个html表。 我想给编辑功能,点击那个特定的链接 我知道liferay ui:search container提供了类似的功能,但我使用了我的html表和一些jquery来实现这一点。所以,在那个特定的column上悬停时,我有一个编辑图标,我希望在点击那个编辑图标时,我将重定向到编辑页面。但我想知道的是,我如何获得该行编辑图标的主键是选定 我有以下jquery用于图标显示和重定向到编辑页面如何将隐藏字段值或html列值传递到另一个jsp页面,并在liferay portlet中使用?,liferay,portlet,liferay-6,Liferay,Portlet,Liferay 6,我在liferay的自定义portlet中有一个html表。 我想给编辑功能,点击那个特定的链接 我知道liferay ui:search container提供了类似的功能,但我使用了我的html表和一些jquery来实现这一点。所以,在那个特定的column上悬停时,我有一个编辑图标,我希望在点击那个编辑图标时,我将重定向到编辑页面。但我想知道的是,我如何获得该行编辑图标的主键是选定 我有以下jquery用于图标显示和重定向到编辑页面 <script>
<script>
$(document).ready(function() {
$(".editable").hover(function(){
$(this).append("<i class='splashy-pencil_right'></i>")
}, function(){
$(this).children("i").remove();
});
$(".editable").click(function(){
$.colorbox({
initialHeight: '0',
initialWidth: '0',
href: "#confirm_dialog",
inline: true,
opacity: '0.3',
onComplete: function(){
$('.confirm_yes').click(function(e){
e.preventDefault();
window.location.href = "<%=editURL.toString() %> ";
$.colorbox.close();
});
$('.confirm_no').click(function(e){
e.preventDefault();
$.colorbox.close();
});
}
});
});
//* show all elements & remove preloader
setTimeout('$("html").removeClass("js")',1000);
});
</script>
$(文档).ready(函数(){
$(“.editable”).hover(函数(){
$(this.append(“”)
},函数(){
$(this.children(“i”).remove();
});
$(“.editable”)。单击(函数(){
$彩色盒({
初始高度:“0”,
initialWidth:'0',
href:“确认对话框”,
是的,
不透明度:“0.3”,
onComplete:function(){
$('.确认_是')。单击(函数(e){
e、 预防默认值();
window.location.href=“”;
$.colorbox.close();
});
$('.确认编号')。单击(功能(e){
e、 预防默认值();
$.colorbox.close();
});
}
});
});
//*显示所有元素并删除预加载程序
setTimeout(“$”(“html”).removeClass(“js”)”,1000);
});
下面是我要重定向的portletaction url
<portlet:actionURL name="editRestaurant" var="editURL">
<portlet:param name="key" value="<%=restId%>" />
</portlet:actionURL>
下面的代码是我的field of view类的代码,其中我将主键值(restID)作为隐藏字段
<form action="<%=editURL.toString() %>" method="post">
<table class="table table-bordered table-striped" id="dt_gal_res">
<thead>
<tr>
<th class="table_checkbox"><input type="checkbox" name="select_rows" class="select_rows" data-tableid="dt_gal_rest" /></th>
<th>Name</th>
<th>Contact Person</th>
<th>Website</th>
<th>Emenu</th>
<th>Status</th>
</tr>
</thead>
<%
List<restaurant> rest_listOBJ= restaurantLocalServiceUtil.getAllAvailableRestaurant();
for(int i=0;i<(rest_listOBJ.size());i++)
{
restaurant temprest=rest_listOBJ.get(i);
%>
<tbody>
<tr>
<td><input type="checkbox" name="row_sel" class="row_sel" /></td>
<td style="visibility: hidden;"><input type="text" name="primerykey" value="<%= temprest.getPrimaryKey()%>"></td>
<td class="editable"><%=temprest.getName() %></td>
<td><%=temprest.getContactno() %></td>
<td><%=temprest.getWebsite() %></td>
<td><%=temprest.getNoofemenuagent() %></td>
<td><a href="#" class="pop_over" data-content="Ad Displayed on </br> <b>Restaurant</b> : ABC" data-original-title="( Ad name )" data-placement="left">Pending</a></td>
</tr>
</tbody>
名称
联系人
网站
埃门努
地位
那么,如何将这个单击的行或collumn值传递到edit_restaurant.jsp页面?创建一个链接并添加id作为参数
<% PortletURL link = RenderResponse.createRenderURL();
link.setParameter("paramName", "paramValue");
link.setParameter("jspPage", "/page.jsp"); %>
使用链接:
在jsp上,您可以使用以下mvc方式使用此参数:
ParamUtil.getString(ActionRequest,“paramName”)代码>谢谢..我已经用一些javascript代码解决了我的问题,这些代码调用按钮单击,在隐藏字段中获取该按钮的id,然后在重定向页面上通过请求获取该值。getattribute…您的问题对我有所帮助