Awsome, thanks Stephan that worked nicely. I knew it had to be something simple in the end. Thanks.
JustinFrost ( 2015-01-23 00:19:19 +0800 )edit-
FEATURED COMPONENTS
First time here? Check out the FAQ!
I have created a maven project of custom components, this jar is included as a dependancy in my ZK Web project.
I am trying to include static CSS for the project (for components with no javascript) as per the brief outline on this page:
http://books.zkoss.org/wiki/ZKComponentDevelopmentEssentials/PackingasaJar
How does zk know to include the CSS generated when the project is included in a ZK WEB project ? Currently my resources directory of my component project looks like this:
web
foo
bar
css
zk.wcs
macro.css.dsp
other.css.dsp
less
macro.less
other.less
My zk.wcs :
<css language="xul/html">
<stylesheet href="~./foo/bar/css/macro.css.dsp"/>
<stylesheet href="~./foo/bar/css/primitive.css.dsp"/>
</css>
My styles in macro.css.dsp are not applied when using the component project in my web zk project however...
I'm now on place.
One of my the jars have the following structure where i set up the css path:
src/main/resources/metainfo/zk/lang-addon.xml
lang-addon.xml
<?xml version="1.0" encoding="UTF-8"?>
<language-addon>
<!-- The name of this addon. It must be unique -->
<addon-name>zkboost-theme-cyborg</addon-name>
<!-- Specifies what other addon this depends -->
<depends>zul,zkmax</depends>
<!-- Which language this addon will be added to -->
<language-name>xul/html</language-name>
<version>
<zk-version>7.0.0</zk-version><!-- or later -->
</version>
<!-- ##################################################################### -->
<!-- Define this paths dependent from the files packed in the theme jar file -->
<!-- The order of this files is important because we override zk css styles -->
<!-- ##################################################################### -->
<!-- 1. Path to ZK css.dsp -->
<stylesheet href="~./cyborg/zul/css/norm.css.dsp" type="text/css" media="screen" />
<!-- 2. Path to Font-Awesome css.dsp -->
<stylesheet href="~./cyborg/css/fontawesome.css.dsp" type="text/css" media="screen" />
<!-- 3. Path to Bootstrap + Zk customized css.dsp -->
<stylesheet href="~./cyborg/css/cyborg.css.dsp" type="text/css" media="screen" />
<!-- 4. Path to Bootstrap javascript library -->
<javascript src="~./cyborg/less/bootstrap/js/bootstrap.min.js" type="text/javascript" charset="UTF-8" />
</language-addon>
For the exact path you must open the generated jar and look where the used files are. These path should be in the lang-addon.xml
As you said it's a separate jar than you must let ZK know this. For searching a file/class/resource/zul... in a sperarate jar file you should use "~./" in front of your path. It tells ZK to make a classpath scanning for the file.
best Stephan
Awsome, thanks Stephan that worked nicely. I knew it had to be something simple in the end. Thanks.
JustinFrost ( 2015-01-23 00:19:19 +0800 )editSorry i'm not at my machine. put a langaddon.xml file in metainf folder in your jar project. Place there the CSS path.
I have a langaddon.xml file for defining my components, most components have molds and therefore css is specified there. The macro components without molds are what I am having trouble with, how do I add css for these which will be included when the project is added as a dependency to a UI project.
JustinFrost ( 2015-01-21 23:28:16 +0800 )editAsked: 2015-01-19 04:28:42 +0800
Seen: 56 times
Last updated: Jan 22 '15
composite component help [closed]
EL in a forEach @command not working?
Different template for each grid row
Cardlayout animation is broken
Grid RowRender slow using 6.5.1 and sizable=true
setVisible(false), component will load or not
Decimalbox and doublebox value rounded on iPad
history management with page status