# Caption align problem in ZK7

ggrimoldi
74 1

I'm trying to migrate a ZK6.5 project to ZK 7. I've a bad layout with captions... all became aligned to left... instead to have a label on left side and other components (buttons in my situation) on right side. I noticed that CSS for caption changed from ZK 6.5 to 7 from a couple of left and right divs to a single content div. But in this way my app GUI must be dramatically changed...

Please, can anyone help me to solve this problem?

Thanks

delete retag edit

Sort by » oldest newest most voted

stream
81 3

You can use some alternative approach,

e.g.:

<window height="100%" width="100%" position="center, center">
<hbox align="center" spacing="0px" width="100%">
<hlayout hflex="min">
<div width="100px" style="text-align:center">
<label value="some label" style="font-weight: bold;color:black"/>
</div>
<div width="120px">
<label value="some label" style="font-weight:bold; color:black"/>
</div>
</hlayout>
<div hflex="1"></div>
<menuitem onClick="@command('someCommand')" src="/images/form_blank_16x16.png" tooltiptext="Save and Stay" autodisable="self"/>
<menuitem onClick="@command('someCommand')" src="/images/form_blank_16x16.png" tooltiptext="Save and Close" autodisable="self"/>
</hbox>
</window>


ggrimoldi
74 1

Thanks for the answer... but I could not apply this... I should refactor and test much code...

I think that in any code migration backward compatibility is a MUST... Ok for cosmetic changes... but not for structural incompatibilities...

I could not use ZK 7 in this way...

I have just recently moved to ZK 7 and can understand frustration in your words. The same time I appreciate the fact that I can change the Theme of the project with less hardship. I created separate project for the Theme only and can modify it any time I want with minimum efforts now.

( 2014-05-01 21:28:27 +0800 )edit

My frustration is simply explained... it's a lot of work! And all app should be hardly tested against all changes... is not a simple css beautifier issue... it's a change of underlying structure... caption was a table with a left and right side in ZK6.5 and became a simple div in ZK 7...

( 2014-05-02 10:32:05 +0800 )edit
( 2014-05-02 21:39:53 +0800 )edit

I'm moving to ZK7, too. It's been more than a week changing things and testing all the application. It is a little bit tiring...

( 2014-07-17 10:41:02 +0800 )edit

jumperchen
3909 2 8
http://jumperchen.blogspo...

You can add a style to force them to right.

For example,

<zk>
<style>
.z-caption .z-label {
float: right;
}
</style>
<window title="My First Window" border="normal" width="200px">
<caption> test</caption>
Hello, World!
</window>
</zk>


stream
81 3

It doesn't work for me. I am using ZK 7.0.2.

etedeschini
6 1

I have similar problem in the portallayout. With 7.0.1 it works well but with evaluation version of 7.0.2 doesn't work as expected. All buttons are not aligned to the right side with maximizable button. Moreover all buttons are positioned under "Panel Title" with double height of caption area. Example for test:

<portallayout >
<portalchildren width="100%" height="50%">
<panel style="padding:2px" height="100%" hflex="1" border="normal" maximizable="true" >
<caption label="Panel Title" >
<div style="display: inline;float:right;margin-right: 4px;" >
<toolbarbutton sclass="small" image="/filled_filter-32.png" />
<toolbarbutton sclass="small" image="/empty_filter-32.png" />
<toolbarbutton sclass="small" image="/edit_property-32.png" />
</div>
</caption>

<panelchildren>
<label value="content"/>
</panelchildren>
</panel>
</portalchildren>
</portallayout>


cor3000
4406 2 7

due to a structural fix in ZK 7.0.2 http://tracker.zkoss.org/browse/ZK-2209 the markup has changed.

[hide preview]