Quantcast
Channel: SCN : Discussion List - SAP Enterprise Portal : Administration and Development
Viewing all articles
Browse latest Browse all 2686

CSS stylesheet not loaded on Jquery Ajax Framework SAP EP 7.4

$
0
0

Hi experts,

When displaying Custom Portal Framework derived from (Light Signature AFP Example Based on jQuery), I see that CSS stylesheets and JS files were not loaded. In fact, neither meta nor any other tag was inserted withing head section!

Image 001. CSS not loaded.png

I think the problem is related to jar-provided-by-sap—api (com.sapconsulting.portal.utils.html_api.jar), which is responsible for “insert” link, meta and script tags within head html tag. For some reason, this is not happening. See following screenshot:

Image 002. CSS not loaded (F12 Dev Tools).png

I’m just guessing, but perhaps it is related with some missing or mistyped SharingReferences or PrivateSharingReference. However, I have neither runtime errors nor information related on trace files.


Next is what I've done:


1) downloaded com.customer.sdesign from codeExchange (https://code.sdn.sap.com/svn/sap-portal-ajax-framework/)

2) converted it to Development Component. In fact, I've been forced to create a new (portal) DC because after using NWDS convertion functionality, for some reason, NWDS does not enable the deploy option (it remains disabled).

3) created an external library DC in order to embed com.sapconsulting.portal.utils.html_api.jar and com.sap.portal.runtime.system.connection_api.jar

4) created an J2EE Enterprise Application DC, reference the external library and deployed it to EP server

5) created an Portal DC, updated Dependences and finally, deployed to EP server.

 

Steps 3, 4 and 5 were done by following Raphael Vogel's tutorial:

How to use external libraries in the SAP component model (PART I)

How to use external libraries in the SAP component model (PART II)

 

Below is the doContent code:


public void doContent(IPortalComponentRequest request, IPortalComponentResponse response)

{

     EnhancedPortalResponse epResponse = new EnhancedPortalResponse(request, true, false);

//   epResponse.setDocTypeToHtml5();

     epResponse.addHtmlAttribute("lang", request.getLocale().getLanguage().toString());

     epResponse.setTitle("Signature Design");

 

     epResponse.include(HtmlFactory.createHttpEquivMeta("X-UA-Compatible", "IE=edge"));

 

     request.getServletResponse(false).addHeader("X-UA-Compatible", "IE=edge");

 

     epResponse.include(request.getResource(IResource.CSS, "mimes/framework.css"));

 

     response.include(request, request.getResource(IResource.JSP, "jsp/FrameworkPageComponent.jsp"));

 

     epResponse.defer(request.getResource(IResource.SCRIPT, "mimes/jquery-1.6.1.min.js"));

     epResponse.defer(request.getResource(IResource.SCRIPT, "mimes/jquery-ui-1.8.12.custom.min.js"));

     epResponse.defer(request.getResource(IResource.SCRIPT, "mimes/framework.js"));

     epResponse.defer(HtmlFactory.createComment("sven://kannengiesser"));

}


By the opposite, after I’ve compiled and deployed the original (local) Project from CodeExchange, everything work nicely… As you can see below all the link and scripts tags needed were inserted correctly in the head section.


Image 003. CodeExchange Local Project - CSS Loaded.pngImage 004. CodeExchange Local Project - CSS Loaded. (F12 Dev Tools).png


So, we arrive to the question... why???



Thanks in advance.

 

Marcelo


Viewing all articles
Browse latest Browse all 2686

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>