如何只为一个 xsp 渲染或隐藏主题资源 [英] How to render or hide theme resources only for one xsp

查看:16
本文介绍了如何只为一个 xsp 渲染或隐藏主题资源的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个在所有 xpages 中加载许多 CSS 和 METAS 的应用程序主题.

I have a theme for application that load many CSS and METAS in all xpages.

我的应用程序只需要 index.xsp 中的所有这些 css,其余页面由 AJAX 加载,我需要这些页面在没有 CSS 的情况下加载,基本上没有主题.

My app only need all these css in the index.xsp, rest of pages are loaded by AJAX and I need that these pages would be loaded without CSS, basically without theme.

有人知道是否可以在 RESOURCES 中添加rendered"属性或添加条件来加载一个 CSS 或其他?我知道我可以在没有主题的情况下从其他 NSF 加载其他页面,但对我来说只有一个 NSF 更好

Somebody know if is possible add "rendered" property in RESOURCES or add condition to load one CSS or other?? I know that I can load other pages from other NSF without theme but is better for me to have only one NSF

<resource>
    <content-type>text/css</content-type>
    <href>css/reset.css</href>
</resource>
<resource>
    <content-type>text/css</content-type>
    <href>css/style.css</href>
</resource>
<resources>
<metaData>
        <name>MobileOptimized</name>
        <content>320</content>
    </metaData>
    <metaData>
        <name>viewport</name>
        <content>width=device-width, initial-scale=1.0,
            maximum-scale=1.0, user-scalable=no</content>
    </metaData>
</resources>

例如我有这个用于 FORM 控件,这个条件对我的应用程序有效.

For example I have this for FORM control, This condition is valid for my app.

<control mode="override">
<name>Form</name>
<property>
    <name>styleClass</name>
    <value>#{javascript:(view.getPageName() == '/index.xsp')?'block wizard same-height':'xspForm'}</value> 
</property>

非常感谢

推荐答案

您确实可以为主题中的资源使用渲染.你可以这样做,例如:

You can indeed use rendered for resources in a theme. You can do this, for instance:

<resource rendered="#{javascript:view.getPageName() == '/index.xsp'}">
    <content-type>text/css</content-type>
    <href>css/reset.css</href>
</resource>

这篇关于如何只为一个 xsp 渲染或隐藏主题资源的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆