How to define more than one stylesheet in adf framework

只愿长相守 提交于 2019-12-13 15:31:24

问题


I am facing a problem with adf skining. My style sheet crossed 1800 classes. IE has a limitation of 4000 style classes. While rendering, ADF adds its own classes. So it crosses 4000 and the styles I am referring at the last of my sheet are not working in IE alone. I need to define a new style sheet for same application.

I have tried adding one more skin-family in adf-faces-config.xml. Did not work.

Please help.

Thanks in advance.


回答1:


I am not 100% sure if creating a separate CSS will resolve your issue, and I do agree that after being used to multiple css definition and only loading a css for a particular page has its own advantages.

One thing that you can do though is organize the CSS, having 1800 classes might not be the appropriate way to go in a WebApp since a webapp should promote consistency in look and feel.

There is a good discussion in oracle forums that might help you on this, especially on the use of an el expression check on your current view to switch your skin on the fly.

Multiple Skin in the same application

I also mentioned in that forum about using skin-addition as well as my reason on taking up skin addition for our app, even though we didn't get to the number of styleClasses that you have, our css is already hitting 3k lines with only 600 lines for component specific and everything else is styleClass. We've also dramatically used the "inhertance" which trinidad skin offers -tr-inherit this really saved us in a lot of coding.




回答2:


Use of extends property you can use multiple style sheet for same application.

trinidad-skins.xml

 <id>skin_1.desktop</id>
    <family>skin_1</family>
    <extends>simple.desktop</extends>
    <render-kit-id>org.apache.myfaces.trinidad.desktop</render-kit-id>
    <style-sheet-name>css/stylesheet_1.css</style-sheet-name>
  </skin>

  <skin>
    <id>skin_2.desktop</id>
    <family>skin_2</family>
    <extends>skin_1.desktop</extends>
    <render-kit-id>org.apache.myfaces.trinidad.desktop</render-kit-id>
    <style-sheet-name>css/stylesheet_2.css</style-sheet-name>
  </skin>

in trinidad-config.xml

<trinidad-config xmlns="http://myfaces.apache.org/trinidad/config">

  <skin-family>skyros</skin-family>
  <skin-version>v1</skin-version>

  <skin-family>skin_2</skin-family>

</trinidad-config>


来源:https://stackoverflow.com/questions/5447741/how-to-define-more-than-one-stylesheet-in-adf-framework

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!