Ask Questions and Find Answers
Important:
Ask is now read-only. You can review any existing questions and answers, but not add anything new.
But - don't panic! While ask is no more, we've replaced it with discuss - the new Liferay Discussion Forum! Read more here here or just visit the site here:
discuss.liferay.com
Liferay 7.2 - Change attribute in CSS from JSP
Hi,
I have the following view.jsp:
And the following css:
Now, my problem is that each DataSource object has a different background color String which I want to set it as the background color for my title-container. So, it is possible to change my css to set the background attribute in my title-container class to the one of the DataSource object?
I have the following view.jsp:
<% List<datasource> dataSources = (List<datasource>) request.getAttribute("dataSources"); %>
<aui:container cssclass="my-portlet">
<% for (DataSource dataSource : dataSources) { %>
<aui:container cssClass="title-container" />
<% } %>
</aui:container></datasource></datasource>
And the following css:
.my-portlet {
min-width: 100%;
padding: 50px;
-webkit-column-count: 4;
-moz-column-count: 4;
column-count: 4;
}
.my-portlet .title-container {
width: 100%;
height: 5px;
background: red;
}
Now, my problem is that each DataSource object has a different background color String which I want to set it as the background color for my title-container. So, it is possible to change my css to set the background attribute in my title-container class to the one of the DataSource object?
Copyright © 2025 Liferay, Inc
• Privacy Policy
Powered by Liferay™