-
FEATURED COMPONENTS
First time here? Check out the FAQ!
Is it possible to use the following with createComponentsDirectly?
<?link rel="stylesheet" type="text/css" href="/css/theme.css"?>
<vlayout>
<label sclass="s1">Hello</label>
</vlayout>
Does not seem to work for me. The css link does not get processed.
Hey there,
The processing instruction will add the link (or script if using ?script) to the page headers during initial page rendering.
If you are creating this content with createComponents (or createComponentsDirectly), you are not creating a page. You are creating a set of components from a page definition.
As a result, that set of components doesn't contain a style component, since it's not in the page definition, but a processing instruction.
You have a few options here. You can move the style into the actual zul content with a style component
plus side: this will add the style as a component in the page, so you can do it at any point (initial page rendering, page update), and it will work through createComponents and derivated methods.
Other option would be to use org.zkoss.zk.ui.sys.PageCtrl.addAfterHeadTags(String) (from the page object) to add the tag manually into the page definition.
IMPORTANT NOTE: this will only work during page rendering. If you are loading this content post page creation, use style component instead.
Asked: 2023-05-27 06:06:41 +0800
Seen: 6 times
Last updated: May 31 '23
bug with intboxes on mobile devices
zk keikai-how to add custom button/label to formulabar?
zk-keikai- update multiple cells parallel at same time asynchronously
zk-keikai-How to auto fit column width based on text
zk-keikai-ClipboardPateEvent-called twice
Reference a spring bean from VariableResolver