留言板

RowChecker

bcc bcc,修改在10 年前。

RowChecker

New Member 帖子: 16 加入日期: 14-3-20 最近的帖子
Hello all!
I,m use Liferay 6.1. and it doesn`t have Liferay.Util.toggleSearchContainerButton


<liferay-ui:search-container delta="30" emptyresultsmessage="no-nomer-were-found" rowchecker="<%= new RowChecker(renderResponse) %>">
	<liferay-ui:search-container-results results="<%= resultTasksList %>" total="<%= resultTasksList.size() %>" />
		<liferay-ui:search-container-row classname="com.ss.task.model.TaskEntry" modelvar="taskEntry">
		
		<liferay-ui:search-container-column-text>
			iiii
		</liferay-ui:search-container-column-text>
		
		</liferay-ui:search-container-row>
		
		<aui:button disabled="<%= true %>" name="delTask" id="delTask" onClick="<%= renderResponse.getNamespace() + String.valueOf(entryTasks.getTaskId()) + &quot;deleteTask();&quot; %>" value="delete" />
		
		<liferay-ui:search-iterator />

</liferay-ui:search-container>


<aui:script>
	AUI().use('liferay-util-list-fields',function(A) {
		var s1 = A.one('#<portlet:namespace />delTask');
		
		
		var e1 = Liferay.Util.listCheckedExcept(document.<portlet:namespace />fm, "<portlet:namespace />allRowIds").length;
		var e2 = Liferay.Util.listUncheckedExcept(document.<portlet:namespace />fm, "<portlet:namespace />allRowIds").length;
		
		var checkedAll = A.all('<portlet:namespace />allRowIds');
		
		checkedAll.on('click', function(event){
			alert(e1);
			alert(e2);
		});
		
	});
</aui:script>


How does activate delTask button when set rowChecker true, I don`t now any id of check control
thumbnail
mohammad azaruddin,修改在10 年前。

RE: RowChecker

Expert 帖子: 492 加入日期: 12-9-17 最近的帖子
Use this script

<aui:button onClick='<%= renderResponse.getNamespace() + "delete();" %>' value="Delete" />
<aui:script>
Liferay.provide(
window,
'<portlet:namespace />delete',
function() {
var checkBoxValue = Liferay.Util.listCheckedExcept(document.<portlet:namespace />fm, "<portlet:namespace />allRowIds");
alert(checkBoxValue);
},
['liferay-util-list-fields']
);
</aui:script>

Make sure that u have keyProperty


<liferay-ui:search-container-row className="com.ss.task.model.TaskEntry" modelVar="taskEntry" keyProperty="primary column name" >
bcc bcc,修改在10 年前。

RE: RowChecker

New Member 帖子: 16 加入日期: 14-3-20 最近的帖子
Thank you!
thumbnail
ahad bahmanian,修改在10 年前。

RE: RowChecker

New Member 帖子: 8 加入日期: 12-11-7 最近的帖子
Hi bcc,
i am using your example, but i dont knew "entryTasks" class in your sample.
please write complete sample.
thanks.
thumbnail
mohammad azaruddin,修改在10 年前。

RE: RowChecker

Expert 帖子: 492 加入日期: 12-9-17 最近的帖子
That is the entity name you describe in the service.xml or the entity from where you get the data
thumbnail
ahad bahmanian,修改在10 年前。

RE: RowChecker

New Member 帖子: 8 加入日期: 12-11-7 最近的帖子
Hi mohammad,
i write this code:
--------------------------------
<%
Long psId = Long.valueOf(session.getAttribute("p_subjectId").toString());
Integer pRadif = Integer.valueOf(session.getAttribute("p_counter").toString());
List<Question> porseshnamehData = ActionUtil.getQuestionsBySubject(psId);
com.afkarsanji.internet.afkar.portlet.user.EnPorseshNameh enp = new EnPorseshNameh();
long allQuestionCount = 0;
allQuestionCount = porseshnamehData.size();
%>

<portlet:renderURL var="enPorseshNamehURL"/>

<portlet:actionURL name="previousPage" var="PreviousPURL">
<portlet:param name="resQuestionRadif" value="<%=String.valueOf(porseshnamehData.get(pRadif).getRadif())%>"/>
</portlet:actionURL>

<portlet:actionURL name="nextPage" var="NextPURL"/>
<portlet:actionURL name="endOfPorseshname" var="EndOfPorseshnameURL"/>

<aui:form name="fm" action="<%= NextPURL.toString() %>" method="post">
<b>
<a href="<%=enPorseshNamehURL%>"><liferay-ui:message key="btn.back"/></a>
</b>

<aui:fieldset>
<table width="100%" cellspacing="0" cellpadding="0" border="0">
<tbody>
<%--<button onclick="">Increment</button>--%>
<%--<input type="text" name="radif" id="radif" value="<%= enp.cnt %>" size="2" />--%>
<input type="text" name="allQuestionCountT" id="allQuestionCountT" value="<%=allQuestionCount%>"/>
<tr>
<td><liferay-ui:message key="radif"/>:</td>
<td><input type="text" name="radif" id="radif" value="<%= porseshnamehData.get(pRadif).getRadif() %>"
size="2"/>
</td>
</tr>
<tr>
<td><liferay-ui:message key="soal"/>:</td>
<td><input type="text" value="<%= porseshnamehData.get(pRadif).getSoal() %>" size="100%" name="soal"
id="soal"/></td>
<%--<td><input type="hidden" id="soalId" value="<%= porseshnamehData.get(pRadif).getQuestionId() %>" ></td>--%>
</tr>
<tr>
<td><liferay-ui:message key="hoshdar"/>:</td>
<td><input type="text" value="<%= porseshnamehData.get(pRadif).getHoshdar() %>" size="100%"
name="hoshdar"/></td>
</tr>

</tbody>
</table>

</aui:fieldset>
</aui:form>

<%
int i = 0;
%>

<liferay-ui:search-container rowChecker="<%= new RowChecker(renderResponse) %>" emptyResultsMessage="there-are-no-PorseshNameh" delta="10">
<liferay-ui:search-container-results>
<%

List<Answer> tempResults = ActionUtil.getAnswerByQuestion(porseshnamehData.get(pRadif).getQuestionId());

results = ListUtil.subList(
tempResults, searchContainer.getStart(),
searchContainer.getEnd());
total = tempResults.size();

pageContext.setAttribute("results", results);
pageContext.setAttribute("total", total);

%>
</liferay-ui:search-container-results>

<liferay-ui:search-container-row
className="com.afkarsanji.internet.afkar.model.Answer"
escapedModel="<%= true %>"
keyProperty="answerId" modelVar="answer">

<portlet:actionURL name="readUserSelection" var="readUserSelectionURL">
<portlet:param name="resourcePrimKey"
value="<%=String.valueOf(answer.getRadif()) %>"/>
</portlet:actionURL>

<liferay-ui:search-container-column-text>

</liferay-ui:search-container-column-text>
<liferay-ui:search-container-column-text name="#"
value="<%=Integer.toString(searchContainer.getStart()+(++i))%>"/>
<liferay-ui:search-container-column-text name="answer-pasokh" property="pasokh"
href="<%=readUserSelectionURL.toString()%>"/>
</liferay-ui:search-container-row>
<liferay-ui:search-iterator/>
</liferay-ui:search-container>

<center>
<aui:button-row>
<aui:button type="button" value="btn.Previus" onClick="<%=PreviousPURL.toString()%>"/>
<aui:button type="button" value="btn.Next" onClick="<%=NextPURL.toString()%>"/>
<aui:button type="button" value="btn.EndOfProcess" onClick="<%=EndOfPorseshnameURL.toString()%>"/>

</aui:button-row>
</center>
-------------------------------

how to change it to can use checkbox when selected in searchcontiner.
if you can, please write complete!!

thank you.
thumbnail
mohammad azaruddin,修改在10 年前。

RE: RowChecker

Expert 帖子: 492 加入日期: 12-9-17 最近的帖子
ahad bahmanian:

how to change it to can use checkbox when selected in searchcontiner.

Can you elaborate your requirment..