on 10-16-2006 1:45 PM
Hi,
Sorry for the beginner question but I can't find sufficient documentation for that.
I would like to use my own css in my portal component and override the default theme design, could someone please point me to what I should do ?
Thanks,
Elad.
Hi there,
In SAP Developer studio you can keep your CSS file at Project -> dist -> css folder.
Now you can add this css file in your project by writing
IResource jspResource = request.getResource(IResource.CSS, "css/GlobalReportStyles.css");
String URL = jspResource.getResourceInformation().getURL(request);
This URL can be used in your application to access the css file.
Regards,
Vishal
PS: Reward points if answer is helpful
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Vishal,
For some reson the solution you suggested didn't work, and my css doesn't affect the layout of my component.
Here is what I did:
In my jsp, after getting the URL of the css file according to your instructions,
I've added a <link rel="stylesheet" type="text/css" href="<%=resUrl%>" /> statement in the html's head section,
and for each element like a label or a textView I add the proper "class" attribute.
Is that correct ? Is that enough ?
What am I missing ?
Thanks,
Elad.
Hi Elad,
For JSPs to access this css file here is the sample code. Make sure that you keep your css file inside dist->css folder.
<Html>
<Head>
<%@ page import="com.sapportals.portal.prt.component.IPortalComponentResponse"%>
<%@ page import="com.sapportals.portal.prt.resource.IResource"%>
<%
IPortalComponentResponse componentResponse =
(IPortalComponentResponse)pageContext.getAttribute(javax.servlet.jsp.PageContext.RESPONSE);
IResource suckerfishCss = componentRequest.getResource(IResource.CSS, "css/GlobalReportStyles.css");
componentResponse.include(componentRequest, suckerfishCss);
%>
</Head>
<body>
</body>
</html>
Now the class files must be availble to you.
Regards,
Vishal
User | Count |
---|---|
94 | |
11 | |
11 | |
10 | |
9 | |
8 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.