Disable a row based on condition from database in Liferay Search Container - liferay

I have to disable a row that I retrieve from the database using Liferay search container. I have certain conditions stored in the database.
What I wish to achieve is this:
I am displaying a list of students whose attendance need to be marked.
Sometimes the students may take a leave in advance in which case the attendance is pre-marked in the database.
So when the form for marking attendance is displayed, I want to disable marking attendance by disabling the row containing the data of student whose attendance is already marked.
What I want to do is, if the attendance is pre-marked, show the row on the form with pre-marked attendance and do not allow the user to mark attendance for that student i.e. disable the row.
How can I achieve this?
EDITED:
The code snippet
Mark Attendance for Today:
<%=new java.util.Date()%>
<portlet:actionURL name="updateAtt" var="updateAttURL" />
<aui:form name="updateAtt" action="<%=updateAttURL.toString() %>" method="post" >
Choose Date to mark Attendance:
<liferay-ui:input-date formName="attendanceDate" yearRangeStart="<%=year %>" yearRangeEnd="<%=year %>"
yearValue="<%=year %>" monthValue="<%=month %>" dayValue="<%=day %>"
dayParam="datt" monthParam="matt" yearParam="yatt" />
<portlet:renderURL var="viewstudentDataURL"/>
<liferay-ui:search-container delta="20" emptyResultsMessage="No Results Found">
<liferay-ui:search-container-results total="<%= studentAttendanceDetails .size() %>"
results="<%= ListUtil.subList(studentAttendanceDetails , searchContainer.getStart(), searchContainer.getEnd()) %>" />
<liferay-ui:search-container-row modelVar="search"
className="com.corpserver.mis.portal.model.Student">
<%
String LImageId = String.valueOf(search.getFileEntryId());
long ImageId = Long.valueOf(LImageId);
DLFileEntry image = DLFileEntryLocalServiceUtil .getFileEntry(ImageId );
String imageURL = "/documents/" + image.getGroupId() + "/" + image.getFolderId() + "/" + image.getTitle()+"/"+image.getUuid();
%>
<liferay-ui:search-container-column-text name="student Photo" href = "">
<img src="<%=imageURL%>" height="50" width="50"/>
</liferay-ui:search-container-column-text>
<!-- Code to display student Image -->
<%
String eol = System.getProperty("line.separator");
%>
<liferay-ui:search-container-column-text name='student Name' value='<%=String.valueOf(search.getstudentFname()) + String.valueOf(search.getstudentLname()) + "<br>" + String.valueOf(search.getstudentTitle()) %>' href="" >
</liferay-ui:search-container-column-text>
<liferay-ui:search-container-column-text name="Attendance Status">
<label>Present</label><input type = "radio" name ='updateattendance<%=String.valueOf(search.getstudentId())%>' value = "Present" />
<label>Absent</label><input type = "radio" name= 'updateattendance<%=String.valueOf(search.getstudentId())%>' value = "Absent"/>
</liferay-ui:search-container-column-text>
</liferay-ui:search-container-row>
<liferay-ui:search-iterator searchContainer="<%=searchContainer %>" paginate="<%=true %>" />
</liferay-ui:search-container>
<input type = "submit" value = "Update"/>
</aui:form>
</body>
</html>

You can use conditional statements to just show the label instead of the input control or disabled the input control, as follows:
<%
String LImageId = String.valueOf(search.getFileEntryId());
long ImageId = Long.valueOf(LImageId);
DLFileEntry image = DLFileEntryLocalServiceUtil .getFileEntry(ImageId );
String imageURL = "/documents/" + image.getGroupId() + "/" + image.getFolderId() + "/" + image.getTitle()+"/"+image.getUuid();
// you can define a flag for the pre-marked attendance
boolean preMarkFlag = isStudentPreMarked(); // have value true (student is premarked) or false (if the student is not pre-maked)
%>
<liferay-ui:search-container-column-text name="Attendance Status">
<label>Present</label>
<input type = "radio"
name ='updateattendance<%=String.valueOf(search.getstudentId())%>'
value = "Present"
<%= preMarkFlag ? "disabled" : "" %> />
<label>Absent</label>
<input type = "radio"
name ='updateattendance<%=String.valueOf(search.getstudentId())%>'
value = "Absent"
<%= preMarkFlag ? "disabled" : "" %> />
</liferay-ui:search-container-column-text>
Or another way is to just show a label and not show the input radio-button at all
<liferay-ui:search-container-column-text name="Attendance Status">
<%
// I am assuming if preMarkFlag is true then the student is absent
// as mentioned in your question
if (preMarkFlag) {
%>
<label>Absent</label>
<%
} else {
%>
<label>Present</label>
<input type = "radio"
name ='updateattendance<%=String.valueOf(search.getstudentId())%>'
value = "Present"
<%= preMarkFlag ? "disabled" : "" %> />
<label>Absent</label>
<input type = "radio"
name ='updateattendance<%=String.valueOf(search.getstudentId())%>'
value = "Absent"
<%= preMarkFlag ? "disabled" : "" %> />
<%
}
%>
</liferay-ui:search-container-column-text>

Related

How to make AUI validation apply only when a check box is selected?

I have fields in an aui form that I only want to be required when a corresponding checkbox is selected, otherwise they're not required. I'll enable these input fields using <aui:script> once the check box is enabled and only then aui validation should work.
I have tried with hiding the <aui:validator> depending condition in script.
How do I enable the validation only if my check box is selected in aui?
<aui:form action="" method="post">
<aui:input type="checkbox" name="employeeId" id="employeeId"></aui:input>
<div id="employeeDetails">
<aui:input type="text" name="name" id="employeeId2">
<%
if (true) { //default i kept true how to check this condition on check box basic
%>
<aui:validator name="required"' />
<%
}
%>
</aui:input>
<aui:input type="text" name="email" id="employeeId3">
<%
if (true) {
%>
<aui:validator name="required" />
<%
}
%>
</aui:input>
</div>
<aui:button-row>
<aui:button type="submit" />
</aui:button-row>
</aui:form>
<aui:script>
AUI().use('event', 'node', function(A) {
A.one('#employeeDetails').hide(); // to hide div by default
var buttonObject = A.all('input[type=checkbox]');
buttonObject.on('click', function(event) {
if (A.one("#<portlet:namespace/>employeeId").attr('checked')) {
A.one('#employeeDetails').show(); //for checked condition
} else {
A.one('#employeeDetails').hide(); // for non checked condition
}
});
});
</aui:script>
Reference images:
Before enabling the check box
[]
Check box enabled:
[]
This sample if(true) bothers me - it's evaluated server side on the JSP and won't have any effect, since true is always true.
However, your question is well documented within Liferay's documentation: Look for "Conditionally Requiring A Field"
Sometimes you’ll want to validate a field based on the value of
another field. You can do this by checking for that condition in a
JavaScript function within the required validator’s body.
Below is an example configuration:
<aui:input label="My Checkbox" name="myCheckbox" type="checkbox" />
<aui:input label="My Text Input" name="myTextInput" type="text">
<aui:validator name="required">
function() {
return AUI.$('#<portlet:namespace />myCheckbox').prop('checked');
}
</aui:validator>
</aui:input>

Liferay: How to place values (or not lose values) in ParamUtil in case of exception?

I am new to developing on Liferay and am currently using Liferay 6.2 on Eclipse Kepler IDE.
I am currently making a small webpage based on the following view & add/update example in the development guide
In the example the method paramUtil.getLong(long) is used to pass the id of the row to be updated to the add/update page.
My issue is that when an exception occurs (on the back end) this data is lost and the page changes to an add entry page.
How do I retain the data sot that ParamUtil can retrieve it when an exception is thrown on the back end?
I have included snippets of the example front end code below.
VIEW.JSP:
<liferay-ui:search-container-row
className="com.nosester.portlet.eventlisting.model.Location"
keyProperty="locationId"
modelVar="location" escapedModel="<%= true %>"
>
<liferay-ui:search-container-column-text
name="name"
value="<%= location.getName() %>"
/>
<liferay-ui:search-container-column-text
name="description"
value="<%= location.getDescription() %>"
/>
<liferay-ui:search-container-column-text
name="streetAddress"
value="<%= location.getStreetAddress() %>"
/>
<liferay-ui:search-container-column-text
name="city"
value="<%= location.getCity() %>"
/>
<liferay-ui:search-container-column-text
name="stateOrProvince"
value="<%= location.getStateOrProvince() %>"
/>
<liferay-ui:search-container-column-text
name="country"
value="<%= location.getCountry() %>"
/>
<liferay-ui:search-container-column-jsp
align="right"
path="/html/locationlisting/location_actions.jsp"
/>
</liferay-ui:search-container-row>
<liferay-ui:search-iterator />
ACTIONS.JSP
<%
ResultRow row = (ResultRow) request
.getAttribute(WebKeys.SEARCH_CONTAINER_RESULT_ROW);
Location location = (Location) row.getObject();
long groupId = location.getGroupId();
String name = Location.class.getName();
long locationId = location.getLocationId();
String redirect = PortalUtil.getCurrentURL(renderRequest);
%>
<liferay-ui:icon-menu>
<portlet:renderURL var="editURL">
<portlet:param name="mvcPath" value="/html/locationlisting/edit_location.jsp" />
<portlet:param name="locationId" value="<%= String.valueOf(locationId) %>" />
<portlet:param name="redirect" value="<%= redirect %>" />
</portlet:renderURL>
<liferay-ui:icon image="edit" url="<%= editURL.toString() %>" />
EDIT.JSP
<%
Location location = null;
long locationId = ParamUtil.getLong(request, "locationId");
if (locationId > 0) {
location = LocationLocalServiceUtil.getLocation(locationId);
}
String redirect = ParamUtil.getString(request, "redirect");
%>
<aui:model-context bean="<%= location %>" model="<%= Location.class %>" />
<portlet:renderURL var="viewLocationURL" />
<portlet:actionURL name='<%= location == null ? "addLocation" : "updateLocation" %>' var="editLocationURL" windowState="normal" />
<liferay-ui:header
backURL="<%= viewLocationURL %>"
title='<%= (location != null) ? location.getName() : "New Location" %>'
/>
<aui:form action="<%= editLocationURL %>" method="POST" name="fm">
<aui:fieldset>
<aui:input name="redirect" type="hidden" value="<%= redirect %>" />
<aui:input name="locationId" type="hidden" value='<%= location == null ? "" : location.getLocationId() %>'/>
<aui:input name="name" />
<aui:input name="description" />
<aui:input name="streetAddress" />
<aui:input name="city" />
<aui:input name="stateOrProvince" />
<aui:input name="country" />
</aui:fieldset>
<aui:button-row>
<aui:button type="submit" />
<aui:button onClick="<%= viewLocationURL %>" type="cancel" />
</aui:button-row>
UPDATE 1:
Adding back end logic as requested by Parkash Kumar:
LocationListingPortlet.java (Link to Example from Document)
public void updateLocation(ActionRequest request, ActionResponse response)
throws Exception {
_updateLocation(request);
sendRedirect(request, response);
}
private Location _updateLocation(ActionRequest request)
throws PortalException, SystemException {
long locationId = (ParamUtil.getLong(request, "locationId"));
String name = (ParamUtil.getString(request, "name"));
String description = (ParamUtil.getString(request, "description"));
String streetAddress = (ParamUtil.getString(request, "streetAddress"));
String city = (ParamUtil.getString(request, "city"));
String stateOrProvince = (ParamUtil.getString(request, "stateOrProvince"));
String country = (ParamUtil.getString(request, "country"));
ServiceContext serviceContext = ServiceContextFactory.getInstance(
Location.class.getName(), request);
Location location = null;
if (locationId <= 0) {
location = LocationLocalServiceUtil.addLocation(
serviceContext.getUserId(), serviceContext.getScopeGroupId(), name, description,
streetAddress, city, stateOrProvince, country, serviceContext);
}
else {
location = LocationLocalServiceUtil.getLocation(locationId);
location = LocationLocalServiceUtil.updateLocation(
serviceContext.getUserId(), locationId, name,
description, streetAddress, city, stateOrProvince, country,
serviceContext);
}
return location;
}
private static Log _log = LogFactoryUtil.getLog(LocationListingPortlet.class);
}
In-case exception occurs, handle it in _updateLocation and reset required parameters in catch, as following:
Location location = null;
try {
if (locationId <= 0) {
location = LocationLocalServiceUtil.addLocation(
serviceContext.getUserId(), serviceContext.getScopeGroupId(),
name, description, streetAddress, city, stateOrProvince,
country, serviceContext);
} else {
location = LocationLocalServiceUtil.getLocation(locationId);
location = LocationLocalServiceUtil.updateLocation(
serviceContext.getUserId(), locationId, name,
description, streetAddress, city, stateOrProvince, country,
serviceContext);
}
}catch(Exception ex){
_log.error(ex);
// set render parameters
request.setRenderParameter("locationId", locationId);
}

Can it possible to make liferay-ui:search-container rows as non editable in Life ray?

I have a page where I need to set assign the site roles for user in my custom portlet. So I am able to get the "User existing roles" in one list and all "Available site roles" in another list. So how can I do conditioning Or any validation that I need to make non editable for the rows which user has been assigned. Let's say( we have four site type roles i.e, Site Administrator, Site Owner, Site Member and Site Content Reviewer Now the respective user has already assigned with Site Administrator role. So Now In the search container rows I need to make the Site Administrator row as non editable because the user has already has this role). My code is as follows,
<%# page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1"%>
<%#include file="/html/users/init.jsp"%>
<portletefineObjects />
<%
List<Role> siteRoleList = (List) request.getAttribute("allsiteRolesList");
List<Role> existingRoles = (List) request.getAttribute("existingRoles");
String sel_userID = renderRequest.getParameter("sel_userID");
String backURL = ParamUtil.getString(request, "backURL");
%>
<%!
List<Role> roles = null;
int totalNoOfroles=0;
String value = null;
%>
<%
totalNoOfroles = siteRoleList.size();
roles = siteRoleList;
%>
<liferay-ui:header backURL="<%= backURL %>" title="Available Site Roles" />
<liferay-ui:search-container delta="5" emptyResultsMessage="no-site-roles-were-found" rowChecker="<%= new RowChecker(renderResponse) %>" >
<liferay-ui:search-container-results
results="<%= ListUtil.subList(roles,searchContainer.getStart(),searchContainer.getEnd()) %>"
total="<%= totalNoOfroles %>">
</liferay-ui:search-container-results>
<liferay-ui:search-container-row className="com.liferay.portal.model.Role" keyProperty="roleId" modelVar="role">
<liferay-ui:search-container-row-parameter name="roleIds" value="<%= role.getRoleId() %>"></liferay-ui:search-container-row-parameter>
<liferay-ui:search-container-row-parameter name="userIds" value="<%= sel_userID %>"></liferay-ui:search-container-row-parameter>
<liferay-ui:search-container-column-text name="title" value="<%= role.getName()%>" />
<liferay-ui:search-container-column-text name="type" value="<%= role.getTypeLabel() %>">
</liferay-ui:search-container-column-text>
<liferay-ui:search-container-column-text name="description" value="<%= role.getDescription() %>">
</liferay-ui:search-container-column-text>
<liferay-ui:search-container-column-jsp align="right" path="/html/users/user_assign_site_role_actions.jsp" />
</liferay-ui:search-container-row>
<liferay-ui:search-iterator />
</liferay-ui:search-container>
<liferay-ui:search-container delta="5" emptyResultsMessage="no-users-were-found" />
Action Class:
public void assignUserSiteRoles(ActionRequest request, ActionResponse response) throws com.liferay.portal.kernel.exception.PortalException, com.liferay.portal.kernel.exception.SystemException{
String sel_userID = ParamUtil.getString(request, "selectedId");
long userid = Long.valueOf(sel_userID);
String backURL = ParamUtil.getString(request, "backURL");
ThemeDisplay themeDisplay = (ThemeDisplay)request.getAttribute(WebKeys.THEME_DISPLAY);
long companyId = themeDisplay.getCompanyId();
long mySite = themeDisplay.getSiteGroupId();
List<Role> allsiteRolesList = new ArrayList<Role>();
List<Role> existing roles = new ArrayList<Role>();
List<UserGroupRole> userGroupRoleList = UserGroupRoleLocalServiceUtil.getUserGroupRoles(userid, mySite);
if (userGroupRoleList != null) {
for (UserGroupRole userGroupRole : userGroupRoleList) {
/* Get Role object based on userGroupRole.getRoleId() */
Role role = RoleLocalServiceUtil.getRole(userGroupRole.getRoleId());
if(role.getTypeLabel().equalsIgnoreCase("Site"))
{
existingroles.add(role);
}
}
}
List<Role> rolesList = RoleLocalServiceUtil.getRoles(companyId);
if (rolesList != null) {
for (Role role : rolesList) {
if(role.getTypeLabel().equalsIgnoreCase("Site"))
{
allsiteRolesList.add(role);
}
}
}
request.setAttribute("allsiteRolesList", allsiteRolesList);
response.setRenderParameter("sel_userID", sel_userID);
response.setRenderParameter("backURL", backURL);
response.setRenderParameter("mvcPath","/html/users/assign_user_site_roles.jsp");
}
In my code, siteRoleList has list of all available roles and existingRoles list has roles which has already assigned for that respective user. So how can make editable for only those rows which user does's have that roles.
actionJSP
<%# include file="/html/users/init.jsp" %>
<%
ResultRow resultRow = (ResultRow)request.getAttribute(WebKeys.SEARCH_CONTAINER_RESULT_ROW);
Role role = (Role)resultRow.getObject();
String rowUserId = (String)resultRow.getParameter("userIds");
%>
<liferay-ui:icon-menu>
<portlet:actionURL name="UserSiteRoleAssign" var="UserSiteRoleAssign">
<portlet:param name="selectedId" value="<%=String.valueOf(role.getRoleId()) %>" />
<portle:pgaram name="rowUserId" value="<%= rowUserId %>" />
</portlet:actionURL>
<liferay-ui:icon iconCssClass="icon-signin" message="Assign Role" url="<%= UserSiteRoleAssign.toString() %>" />
</liferay-ui:icon-menu>
Any suggestions please..
I am not sure how are you evaluating condition to check that certain user has that specific role.
Anyway, in you actionJSP, if you can manage to identify that selected user has that particular role through checking in existingRoles list as following, should do the trick for you:
<%
ResultRow resultRow = (ResultRow)request.getAttribute(WebKeys.SEARCH_CONTAINER_RESULT_ROW);
Role role = (Role)resultRow.getObject();
String rowUserId = (String)resultRow.getParameter("userIds");
/* Get user existingRoles list here. */
boolean hasSiteRole = false;
for(Role userRole : existingRoles){
if(userRole.getRoleId() == role.getRoleId())
hasSiteRole = true;
}
%>
<liferay-ui:icon-menu>
<portlet:actionURL name="UserSiteRoleAssign" var="UserSiteRoleAssign">
<portlet:param name="selectedId" value="<%=String.valueOf(role.getRoleId()) %>" />
<portle:pgaram name="rowUserId" value="<%= rowUserId %>" />
</portlet:actionURL>
<%
String url = !hasSiteRole ? UserSiteRoleAssign.toString() : "javascript: void();";
String styleClass = !hasSiteRole ? "icon-signin" : "icon-signin-diabled";
%>
<liferay-ui:icon iconCssClass="<%=styleClass %>" message="Assign Role" url="<%=url %>" />
</liferay-ui:icon-menu>
Based on hasSiteRole property, you can control href, class or rendering for the icon. You can also check that on your main view as well. Hide icon and style class as disabled in case if certain role already exists for the user in existingRoles list.
Note: This is just an idea, you have to give it concrete implementation.

Pagination with several Searchcontainer

Try to how to implement Pagination the mapping several Searchcontainer to container page by byi independent.
Here 2 Searchcontainer with different list to display.
I need to change page in first Searchcontainer and dont change page in second.(vice versa)
<aui:form action="<%= renderURL.toString()%>" method="post" name="fm" showEmptyOption="<%= true%>">
<div>
<%
List list = ServiceOrderSearchUtil.simpleSearch(themeDisplay, keywords, serviceOrdersForUserExt);
int count = ServiceOrderSearchUtil.searchCount();
%>
<liferay-ui:panel-container extended="true" accordion="true" id="lfrpc1">
<liferay-ui:panel title='<%= LanguageUtil.get(pageContext, "MaisOrders") + " (" + count + ")"%>' collapsible="true" defaultState="open" id="lfrp1" >
<liferay-ui:search-container iteratorURL="<%= iterURL%>" emptyResultsMessage="no-service-orders-were-found" delta="<%= delta%>">
<liferay-ui:search-container-results>
<%
results = list;
total = count;
results = ListUtil.subList(results, searchContainer.getStart(), searchContainer.getEnd());
pageContext.setAttribute("results", results);
pageContext.setAttribute("total", total);
%>
</liferay-ui:search-container-results>
<%# include file="/jsp/dizo-chief-panel/serviceorder_columns.jspf"%>
<liferay-ui:search-iterator searchContainer="<%= searchContainer%>" paginate="true" />
</liferay-ui:search-container>
</liferay-ui:panel>
</liferay-ui:panel-container>
</div>
<div>
<%
list = ServiceOrderSearchUtil.simpleSearchMV(themeDisplay, keywords, serviceOrdersExt);
count = ServiceOrderSearchUtil.searchCount();
%>
<liferay-ui:panel-container extended="true" accordion="true" id="lfrpc2">
<liferay-ui:panel title='<%= LanguageUtil.get(pageContext, "MVRequests") + " (" + count + ")"%>' collapsible="true" defaultState="close" id="lfrp2" >
<liferay-ui:search-container iteratorURL="<%= iterURL%>" emptyResultsMessage="no-service-orders-were-found" delta="<%= delta%>">
<liferay-ui:search-container-results>
<%
results = list;
total = count;
results = ListUtil.subList(results, searchContainer.getStart(), searchContainer.getEnd());
pageContext.setAttribute("results", results);
pageContext.setAttribute("total", total);
%>
</liferay-ui:search-container-results>
<%# include file="serviceorder_columns.jspf"%>
<liferay-ui:search-iterator searchContainer="<%= searchContainer%>" paginate="false" />
</liferay-ui:search-container>
</liferay-ui:panel>
</liferay-ui:panel-container>
</div>
</aui:form>
sorry for my English ;)
You will need to use 2 Iterator Urls , one for each search container, then use the 'curParam' in each search:container
for example :
String table1Cur = ParamUtil.getString(renderRequest,"table1Cur");
PortletURL table1Url = renderResponse.createRenderURL();
table1Url.setParameter("table1Cur", table1Cur);
<liferay-ui:search-container id="Table1Search" iteratorURL="<%= table1Url %>" curParam="table1Cur" >

liferay-ui view selecting a row

I'm working on a portlet for showing a list of rules, for selection.
And I want to focus the row of content selected on my database (rules variable loaded on init.jsp).
What I should do for focusing/highlighting exactly one row?
Should I use <c:when <c:otherwhise for all the .jsp:
I show a list of rules with this code:
<%# taglib uri="http://java.sun.com/portlet_2_0" prefix="portlet" %>
<portlet:defineObjects />
<liferay-ui:search-container emptyResultsMessage="there-are-no-products" delta="5">
<liferay-ui:search-container-results>
<%
List<IRRule> tempResults = ActionUtil.getRules(renderRequest);
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.everis.oriol.inputrules.model.IRRule"
keyProperty="ruleId"
modelVar="rule">
<liferay-ui:search-container-column-text
name="ruleName"
property="ruleName"
/>
<liferay-ui:search-container-column-text
name="ruleDescription"
property="ruleDescription"
/>
<liferay-ui:search-container-column-jsp
path="/row.jsp"
align="right"
/>
</liferay-ui:search-container-row>
<liferay-ui:search-iterator />
</liferay-ui:search-container>
In the init.jsp file I have...
<%
long groupId = themeDisplay.getScopeGroupId();
List<IRSelect> rulesPas = IRSelectLocalServiceUtil.getRule(groupId);
String rules = rulesPas.get(0).getRuleName();
%>
I exactly want to compare...
<liferay-ui:search-container-column-text
name="ruleName"
property="ruleName"
/>
with...
rules
Thank you for your help
One of the ways I can think of is by setting the bold attribute of <liferay-ui:search-container-row> tag
which would show the element as bold if its value is true:
<liferay-ui:search-container-row
className="com.everis.oriol.inputrules.model.IRRule"
keyProperty="ruleId"
modelVar="rule"
bold="<%=rules.equals(rule.getRuleName()) %>">
...
</liferay-ui:search-container-row>
Or by setting a CSS class for the entire row if you want more options to style the row:
<liferay-ui:search-container-row
className="com.everis.oriol.inputrules.model.IRRule"
keyProperty="ruleId"
modelVar="rule">
<%
if (rules.equals(rule.getRuleName())) {
// here "row" is the ResultRow object, instance for each row
row.setClassName("my-custom-css-class");
}
%>
<liferay-ui:search-container-column-text
name="ruleName"
property="ruleName"
/>
...
</liferay-ui:search-container-row>
If you want that only the rule column text in that one row should be shown differently and not the entire row then:
<liferay-ui:search-container-column-text
name="ruleName"
property="ruleName"
cssClass="<%=rules.equals(rule.getRuleName()) ? \"my-custom-css-class\" : \"\" %>"
/>

Resources