-
FEATURED COMPONENTS
First time here? Check out the FAQ!
Orignial message at:
https://sourceforge.net/forum/message.php?msg_id=5056687
By: zebra100
Hi!
I have two .zul files with a listbox and my own style attribute (some other
colors)
After redirecting to a second .zul page (page2) my own style is gone and the listboxes have standard colors.
You can test this behavior with 3.1.0 and 3.5.0 freshly versions.
here are the three zul files for testing:
testpage.zul:
-----------------------------------------------------------------
<?page id="pageroot" title="Style Test"?> <zk> <zscript> void redirect(String option){
Include inc=(Include)Path.getComponent("//pageroot/includearea");
inc.setSrc(option);
}
</zscript>
<borderlayout>
<north size="200px" border="0">
<include id="includearea" src="page1.zul" />
</north>
<center flex="true" border="0">
<div style="background:#E0E0E0">
<label value="- Page 1 -" style='cursor:hand'
onClick='redirect("page1.zul")'/>
<label value="- Page 2 -" style='cursor:hand'
onClick='redirect("page2.zul")'/> </div>
</center>
</borderlayout>
</zk>
page1.zul:
-----------------------------------------------------------------
<zk>
<style>
.mystyle tr.item{
background: #AAAAAA;
color:#447744;
}
</style>
<listbox width="100px" sclass="listbox mystyle">
<listitem>
<listcell label="page1 item1" />
</listitem>
<listitem>
<listcell label="page1 item2" />
</listitem>
</listbox>
</zk>
page2.zul:
-----------------------------------------------------------------
<zk>
<style>
.mystyle tr.item{
background: #AAAAAA;
color:#447744;
}
</style>
<listbox width="100px" sclass="listbox mystyle">
<listitem>
<listcell label="page2 item1" />
</listitem>
<listitem>
<listcell label="page2 item2" />
</listitem>
</listbox>
</zk>
just load the first file "testpage.zul" and then click on the label "page2", now the style is gone.
What can I do to have the style alive in page2
Bye, zebra100
Orignial message at:
https://sourceforge.net/forum/message.php?msg_id=5062664
By: waterbottle
since you will change the style dynamically , please assign dynamic="true" in style component.
Asked: 2008-06-26 22:55:23 +0800
Seen: 110 times
Last updated: Jun 30 '08