-6ren">
gpt4 book ai didi

java - 获取搜索容器列的主键

转载 作者:行者123 更新时间:2023-11-30 08:48:33 26 4
gpt4 key购买 nike

这是我的搜索容器代码,我正在尝试为我的留言簿 portlet 集成更新和删除方法。我必须获得主键才能做到这一点。这是我到目前为止得到的

<liferay-ui:search-container>
<liferay-ui:search-container-results
results="<%=EntryLocalServiceUtil.getEntries(scopeGroupId,
guestbookId, searchContainer.getStart(),
searchContainer.getEnd())%>" />

<liferay-ui:search-container-row
className="com.liferay.docs.guestbook.model.Entry" modelVar="entry">


<portlet:renderURL var="updateEntryURL">
<portlet:param name="mvcPath" value="/html/guestbook/update_entry.jsp"/>
<portlet:param name="entryId" value="entryId"/>
</portlet:renderURL>

<liferay-ui:search-container-column-text property="message" />

<liferay-ui:search-container-column-text property="name" />


<liferay-ui:search-container-column-text name="Edit" href="#" value="EDIT">
</liferay-ui:search-container-column-text>
<liferay-ui:search-container-column-text name="Delete" href="#" value="DELETE">
</liferay-ui:search-container-column-text>


</liferay-ui:search-container-row>

<liferay-ui:search-iterator />

我正在努力通过这一部分

    <portlet:renderURL var="updateEntryURL">
<portlet:param name="mvcPath" value="/html/guestbook/update_entry.jsp"/>
<portlet:param name="entryId" value="entryId"/>
</portlet:renderURL>

但我目前不知道如何获得条目 ID。我对这个框架很陌生。

谢谢!

最佳答案

线

<liferay-ui:search-container-row
className="com.liferay.docs.guestbook.model.Entry" modelVar="entry">

掌握着你答案的关键:modelVar="entry" .

在那个标签的范围内,你可以做,例如<%=entry.getId()%> (或使用此表达式的 EL 版本)。您基本上有一个名为 entry 的变量在范围内可用

关于java - 获取搜索容器列的主键,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31869356/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com