如何阻止 Richfaces 添加边框到面板和日历?

发布于 2024-07-14 21:11:17 字数 449 浏览 12 评论 0原文

我希望使用自定义的 richfaces 皮肤来处理我的大部分演示工作。 不幸的是,richfaces 在日历组件中的每个单元格和每个面板周围呈现边框。 我想将它们关闭,以便那天的数字位于一个没有边界的开放网格中。 没有明显的方法可以使用日历控件的外观或属性来做到这一点。

我可以使用自定义 CSS,但我更愿意使用框架从 richfaces 创建的样式表中完全删除与边框相关的属性,而不是对抗框架并使用丑陋的 CSS 覆盖所有内容。

那么如何阻止富人向面板和日历添加边框呢?


这家伙有一个类似的问题

I'm hoping to use a custom richfaces skin to handle the bulk of my presentation work. Unfortunately richfaces renders borders around every cell in a calendar component and around each panel. I would like to turn them off so that day numbers site in an open grid with no borders. There is no obvious way to do that using skins or attributes of the calendar control.

I could use custom CSS but I'd prefer to work with the framework to completely remove the border related properties from the stylesheets created by richfaces rather than work against the framework and override everything using ugly CSS.

So how do I stop richfaces adding borders to panels and calendars?


This guy has a similar problem

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

我不在是我 2024-07-21 21:11:17

从版本 3.3.0.GA 开始,无法要求 richfaces 停止渲染边框和背景的 CSS。 有必要覆盖内置样式表中的每个属性(org.richfaces.renderkit.html.css 中包含的属性,它是 richfaces-ui-3.3.0.GA.jar 的一部分)。

插件和外观 为您提供了必要的能力来做到这一点,就像使用常用技术添加自定义 CSS 一样,尽管插件和皮肤可以说更好,因为您可以引用抽象颜色定义来补偿缺失的背景,如下所示:

<u:style name="color" skin="abstractColorName" />

以下 CSS 属性对于快速中和边框和背景相关的属性很有用。

border: none;
background: transparent;

要开始使用插件和皮肤,您可以使用以下 Maven2 命令序列:

mvn archetype:generate -DarchetypeGroupId=org.richfaces.cdk -DarchetypeArtifactId=maven-archetype-plug-n-skin -DarchetypeVersion=3.3.0.GA -DartifactId=fil-skins -Dpackage=com.feelitlive.richfaces -DgroupId=com.feelitlive.server -Dversion=0.0.1-SNAPSHOT -DarchetypeRepository=http://repository.jboss.com/maven2/
cd fil-skins
mvn cdk:add-skin -Dname=fil -Dpackage=com.feelitlive.richfaces.skins

最好从命令行完成,因为不幸的是 Eclipse 插件无法在 jboss 存储库中找到原型(其他 IDE 可能会更好地处理这个问题)。 您需要更改 artifactId、groupId、package、version 和 name 属性以适合您的项目。 选择反映保存多个皮肤定义的工件范围的工件和包名称。


尽管需要做很多工作,但可以添加对通用格式 xxxBackgroundEnabled 和 xxxBorderEnabled 的外观属性的支持,以根据具体情况关闭这些边框和背景 CSS 的渲染。

您需要与 richfaces 团队合作来修补 org.richfaces.renderkit.html.css 中的 xcss 文件。 您还需要 XCSS JSF 标记库之一中的某种条件输出功能(由 XCSS 文件中的 http://jsf.exadel.com/template/util 或 http:/jsf.exadel.com/template 标识)我预计会使用它来将 CSS 属性组包装在 XCSS 文件中。

如果您对 richfaces 进行了这样的修改,那么您将能够从任何皮肤的属性文件中禁用有争议的 CSS 渲染。

As of version 3.3.0.GA it is not possible to ask richfaces to stop rendering CSS for borders and backgrounds. Its necessary to override each of the properties from the built in stylesheets (the ones contained in org.richfaces.renderkit.html.css which is part of richfaces-ui-3.3.0.GA.jar).

Plug and skin gives you the necessary power to do that, as would custom CSS added using the usual techniques, though plug and skin is arguably better as you can reference abstract colour definitions to compensate for missing backgrounds, like this:

<u:style name="color" skin="abstractColorName" />

The following CSS properties are useful for quickly neutralising the border and background related properties.

border: none;
background: transparent;

To get started with plug and skin you can use the following Maven2 command sequence:

mvn archetype:generate -DarchetypeGroupId=org.richfaces.cdk -DarchetypeArtifactId=maven-archetype-plug-n-skin -DarchetypeVersion=3.3.0.GA -DartifactId=fil-skins -Dpackage=com.feelitlive.richfaces -DgroupId=com.feelitlive.server -Dversion=0.0.1-SNAPSHOT -DarchetypeRepository=http://repository.jboss.com/maven2/
cd fil-skins
mvn cdk:add-skin -Dname=fil -Dpackage=com.feelitlive.richfaces.skins

This is best done from the command line as unfortunately the Eclipse plugins cannot locate the archetypes in the jboss repository (other IDEs may handle that better). You'll need to change artifactId, groupId, package, version and name properties to suit your project. Choose an artefact and package name that reflects the scope of the artefact for holding mulitple skin definitions.


It would be possible - though a lot of work - to add support for skin properties in the general format xxxBackgroundEnabled and xxxBorderEnabled to switch off rendering of those border and background CSS on a case by case basis.

You would need to work with the richfaces team to patch the xcss files in org.richfaces.renderkit.html.css. You'd also need some kind of conditional output functionality in one of the XCSS JSF tag libraries (identified by http:/jsf.exadel.com/template/util or http:/jsf.exadel.com/template in the XCSS files) which I'd anticipate using to wrap groups of CSS properties in the XCSS files.

If you made such a modification to richfaces then you would be able to disable rendering of the controversial CSS from the properties file of any skin.

慕烟庭风 2024-07-21 21:11:17

有一种名为 plain 的皮肤,几乎没有附加任何样式。

以下是文档摘录

皮肤“普通”是从 3.0.2 版本添加的。 它没有任何
参数。 嵌入 RichFaces 组件是必要的
现有的项目有自己的风格。

激活它

<context-param>
    <param-name>org.richfaces.SKIN</param-name>
    <param-value>plain</param-value>
</context-param>

您可以通过添加到 web.xml


阻止 RichFaces 加载任何样式

<context-param>
     <param-name>org.richfaces.LoadStyleStrategy</param-name>
     <param-value>None</param-value>
</context-param>

。 您还可以通过web.xml 中的设置

。 但请注意,因为它在 JBoss Portlet Bridge 1.0.0 中不起作用

There is a skin called plain that's got nearly no styles at all attached to it.

Here's an excerpt from the documentation:

Skin 'plain' was added from 3.0.2 version. It doesn't have any
parameters. It's necessary for embedding RichFaces components into
existing projecst which have its own styles.

You can activate it by adding

<context-param>
    <param-name>org.richfaces.SKIN</param-name>
    <param-value>plain</param-value>
</context-param>

to the web.xml.


You can also hinder RichFaces to load any styles at all with

<context-param>
     <param-name>org.richfaces.LoadStyleStrategy</param-name>
     <param-value>None</param-value>
</context-param>

set in the web.xml.

But beware, since it won't work in JBoss Portlet Bridge 1.0.0.

抹茶夏天i‖ 2024-07-21 21:11:17

RichFaces 有一个内置的皮肤系统,称为 Skinnablity。 Skinnability 是标准 CSS 的高级扩展。 您可以创建自己的皮肤文件以在应用程序中使用(jboss 文档)。

在 richfaces-impl jar 中,文件夹 /META-INF/skins 包含所有皮肤文件 (.skin.properties)。 复制一份并重命名,修改你想要的内容。 你将不得不重建罐子。

或者

您可以使用 richfaces 的即插即用功能,我以前从未尝试过,但看起来它也适用于您想要做的事情。

RichFaces has a skin system built in called Skinnablity. Skinnability is a high-level extension of standard CSS. You can create your own skin file to use in your application(jboss documentation).

In the richfaces-impl jar, the folder /META-INF/skins contains all the skin files (.skin.properties). Copy one and rename name it, modify what you want. You will have to rebuild the jar.

OR

You can use the plug-n-skin feature of richfaces, which i've never tried before but looks like it would also work for what you are trying to do.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文