I have the following requirement: Our company has several different labels, and thus different styles for their web applications. So, i need to apply a different CSS for different customers. I know which initial style i need to apply, because i can add a bookmark to the URL like #CSSNAME when i start the application. On application apnPreOpen i can check the bookmark, but then i want to apply a specific CSS before anything loads.
Any ideas how i can solve this?
It might be an idea to add an API later to do this, but i need this quite urgent for a presentation i need to do.
asked 09 Nov '12, 08:09
Then define a js function which calls an already defined method of fs application:
Dont forget to include this script on main.jsp. Also keep in mind that this loadCss method does not remove other css files and just appends new css file to the header, so its better you dont set a custom css for your app and handle all on postOpen.
Now you can invoke this em with the specific css file name (using bookmark value) on postOpen event.
Here is the tutorial for externalMethods for more information:
answered 09 Nov '12, 09:22
cssFileName will be the link to the css, like
Calling the changeCSS function (from external method) will replace the application css and will cause the css to reload. This can be used in apnPreOpen, but also in the application like a theme changer.
EDIT: i noticed that calling this on apnPreOpen or apnPostOpen will crash Internet Explorer 8/9. I am lookimh for a solution, but if anybody has an idea....