0

hflex does not take scrollbars into account

asked 2011-02-15 14:40:48 +0800

Matze2 gravatar image Matze2
773 7

updated 2011-02-15 14:41:36 +0800

I did some experiments to have a page which is fully resizable. To achieve this, I use hflex like in the following two examples:

A window with a scrollable div containing a listbox:

<?init class="org.zkoss.zkplus.databind.AnnotateDataBinderInit" arg0="./win"?>
<?page title="Scrollable Div with a listbox" contentType="text/html;charset=UTF-8"?>
<window id="win" border="none" height="100%" width="100%">
	<div style="overflow:auto" height="100%" width="100%" vflex="1">
		<listbox id="qssList" rows="10" hflex="1">
			<listhead>
				<listheader label="Col1" />
				<listheader label="Col2" width="70px" />
				<listheader label="Col3" width="70px" />
				<listheader label="Col4" width="70px" />
				<listheader label="Col5" width="200px" />
			</listhead>
		</listbox>
	</div>
</window>

The same, but with a grid instead of a listbox:

<?init class="org.zkoss.zkplus.databind.AnnotateDataBinderInit" arg0="./win"?>
<?page title="Scollable div with a grid" contentType="text/html;charset=UTF-8"?>
<window id="win" border="none" height="100%" width="100%">
	<div style="overflow:auto" height="100%" width="100%" vflex="1">
		<grid zclass="none" hflex="1">
			<columns>
				<column width="120px" />
				<column />
				<column width="120px" />
				<column />
			</columns>
			<rows>
				<row>
					<label value="Label1:" />
					<textbox maxlength="6" width="100px" />
					<label value="Label2:" />
					<datebox width="100px" format="dd.MM.yyyy" />
				</row>
				<row spans="1,3">
					<label value="Label5:" />
					<div id="div5" />
				</row>
				<row>
					<label value="Label6:" />
					<datebox width="100px" format="dd.MM.yyyy" />
					<label value="Label7:" />
					<checkbox />
				</row>
				<row spans="1,3">
					<label value="Label7:" />
					<hbox align="center" pack="stretch">
						<intbox cols="3" width="30px" />
						<label value="label8" />
					</hbox>
				</row>
			</rows>
		</grid>
	</div>
</window>

In both cases, resizing the page works quite nice. Now shrink the vertical space until the vertical scrollbar appears.
In the same moment, also the horizontal scrollbar is displayed.
My guess: hflex calculates the width without taking a vertical scrollbar into account.

Any ideas how to solve this?

delete flag offensive retag edit

2 Replies

Sort by ยป oldest newest

answered 2011-02-18 04:28:14 +0800

SimonPai gravatar image SimonPai
1696 1

Hi Matze2,

I have post the issue to the bug tracker here.

Regards,
Simon

link publish delete flag offensive edit

answered 2011-02-18 16:57:54 +0800

Matze2 gravatar image Matze2
773 7

Thank you, Simon.

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: 2011-02-15 14:40:48 +0800

Seen: 180 times

Last updated: Feb 18 '11

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