0

style gone after redirecting in 3.5.0 freshly

asked 2008-06-26 22:55:23 +0800

admin gravatar image admin
18691 1 10 130
ZK Team


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



delete flag offensive retag edit

1 Reply

Sort by ยป oldest newest

answered 2008-06-30 04:51:14 +0800

admin gravatar image admin
18691 1 10 130
ZK Team


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.

link publish delete flag offensive edit
Your reply
Please start posting your answer anonymously - your answer will be saved within the current session and published after you log in or create a new account. Please try to give a substantial answer, for discussions, please use comments and please do remember to vote (after you log in)!

[hide preview]

Question tools

Follow

RSS

Stats

Asked: 2008-06-26 22:55:23 +0800

Seen: 110 times

Last updated: Jun 30 '08

Support Options
  • Email Support
  • Training
  • Consulting
  • Outsourcing
Learn More