0

Span columns in Litbox [closed]

asked 2012-04-10 06:56:16 +0800

Neus gravatar image Neus
1415 14

Hi,
When setting more than one column span in listbox it doesn't spans all columns just the first.
In <listbox sizedByContent="true" span="1,2"> only column 1 spans.

Is that normal?
Thank you!

delete flag offensive retag edit

The question has been closed for the following reason "the question is answered, right answer was accepted" by Neus
close date 2013-03-06 12:09:16

9 Replies

Sort by ยป oldest newest

answered 2012-04-26 07:35:03 +0800

ashishd gravatar image ashishd flag of Taiwan
1972 6

Hi senthilchettyin,
I have updated the original sample from fiddle

ZKFiddle-Link

index.zul
<zk>
<window border="normal" title="hello">

<listbox span="1,2,3">
<listhead>
<listheader label="Column 1"/>
<listheader label="Column 2"/>
<listheader label="Column 3"/>
<listheader width="100px" label="Column 4"/>
<listheader width="100px" label="Column 5"/>
</listhead>
<listitem>
<listcell label="Cell 1"/>
<listcell label="Cell 2"/>
<listcell label="Cell 3"/>
<listcell label="Cell 4"/>
<listcell label="Cell 5"/>
</listitem>
</listbox>
</window>
</zk>

link publish delete flag offensive edit

answered 2012-04-25 14:51:43 +0800

Neus gravatar image Neus
1415 14

Here an example because it is still happening.

ZKFiddle-Link

index.zul
<zk>
<window border="normal" title="hello">

<listbox sizedByContent="true" span="1,2,3">
<listhead>
<listheader label="Column 1"/>
<listheader label="Column 2"/>
<listheader label="Column 3"/>
<listheader label="Column 4"/>
<listheader label="Column 5"/>
</listhead>
<listitem>
<listcell label="Cell 1"/>
<listcell label="Cell 2"/>
<listcell label="Cell 3"/>
<listcell label="Cell 4"/>
<listcell label="Cell 5"/>
</listitem>
</listbox>
</window>
</zk>

Column 1, 2 and 3 are indicated to span but only Column 2 spans.

link publish delete flag offensive edit

answered 2012-04-26 01:59:56 +0800

ashishd gravatar image ashishd flag of Taiwan
1972 6

Hi Neus,
AFAIK span can only be assigned true or false (default is false I guess). It works along with sizeByContent attribute.

link publish delete flag offensive edit

answered 2012-04-26 06:59:04 +0800

Matze2 gravatar image Matze2
773 7

According to documentation, there are two modes.
(a) If you use sizeByContent, you can only specifiy span=true.
(b) If you use defined widths for columns, you can specify span=true, or assign a span to a specific column.
I haven't found anything about passing more than one column. But I use option (b) frequently.

link publish delete flag offensive edit

answered 2012-04-26 07:04:11 +0800

Neus gravatar image Neus
1415 14

According to the API a column can be assigned to span (http://www.zkoss.org/javadoc/latest/zk/org/zkoss/zul/impl/MeshElement.html#setSpan(java.lang.String)). I think I read that it allows more than one column also. In fact, I'm using it in a grid and all columns that I indicate are spaned. But I never tried it with a listbox and now I realize that it is not working. I don't know if it doesn't work because it only supports one column or because it is working wrong.

link publish delete flag offensive edit

answered 2012-04-26 07:04:47 +0800

Neus gravatar image Neus
1415 14

So I can't use sizedByContent?

link publish delete flag offensive edit

answered 2012-04-26 07:06:44 +0800

Neus gravatar image Neus
1415 14

I tried it deleting sizedByContent and setting a with to the column that I don't want to span and it works! All columns that I assign spans!

link publish delete flag offensive edit

answered 2012-04-26 07:19:55 +0800

Senthilchettyin gravatar image Senthilchettyin flag of India
2611 3 8
http://emrpms.blogspot.in...

Hi Neus
If you arrived the desired output, can you please share the modify code ?

link publish delete flag offensive edit

answered 2012-04-26 08:09:53 +0800

Neus gravatar image Neus
1415 14

Yes, that's the code!

link publish delete flag offensive edit

Question tools

Follow

RSS

Stats

Asked: 2012-04-10 06:56:16 +0800

Seen: 195 times

Last updated: Apr 26 '12

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