在 XPage 中使用主题的好处 [英] Benefits of using themes in XPages

查看:33
本文介绍了在 XPage 中使用主题的好处的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

StackOverflow 上的这个问题让我对主题产生了兴趣.但是问题中的示例只是将主题文件中的 CSS 类分配给一个 themeId,然后将其分配给 XPage 上具有各自 themeId 的元素.我也可以直接将类名分配给 XPage 中的组件.

This question on StackOverflow got me interested into Themes. But the example in the question just assigns a CSS class in theme file to a themeId which is in turn assigned to the element with respective themeId on XPage. I could also directly assign the class name to component in XPage.

所以我的第一个问题是主题给 XPage 带来什么好处?

So my first question is what benefit does a theme bring to an XPage?

我试图探索可以通过主题分配哪些其他属性,似乎我们可以在主题文件中分配其他属性,例如 valignstyle,如下所示:

I was trying to explore what other properties could be assigned via themes and it seems we can assign other properties like valign and style in the theme file like this:

<control>
    <name>HtmlTd</name>
    <property>
        <name>styleClass</name>
        <value>tdclass</value>
    </property>
    <property>
        <name>style</name>
        <value>font-family: Courier</value>
    </property>
    <property>
        <name>valign</name>
        <value>top</value>
    </property>
</control>

上述代码实际上为 XPage 中的所有 <td> 标记设置了 valignstyle.所以我的第二个问题是所有属性都可以通过主题设置吗?

The above code actually sets the valign and style for all the <td> tags in XPage. So my second question is what all properties could be set via themes?

推荐答案

主题非常强大.XPage 中几乎每个控件都是真的是一个bean的意思您可以使用主题设置几乎其所有属性(请参阅 Paul 的回答中对此的说明).

Themes are very powerful. Almost every control in XPages is really a bean meaning that you can set almost all of its properties using themes (see clarification of this in the answer from Paul).

这里有一些有用的资源:

Here some useful resources:

  • Tim Tripcony has created a presentation called Taking Themes to the Next Level which highlights some of the powerful features of themes.
  • The XPageswiki.com has a page on themes

这篇关于在 XPage 中使用主题的好处的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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