-
FEATURED COMPONENTS
First time here? Check out the FAQ!
Hello,
how can I achieve it that the text field always takes the entire row height. Currently the textbox only fills a portion of the row.
Press the button, to see the various behavior. I have tested it with ZK 6.
Thanks in advance
Kai
<zk> <zscript> ListModelList values= new ListModelList(new Integer[] { 0}); void add_row(Component grid) { values.add(new Integer(values.size())); g.getFellow("c").invalidate(); } </zscript> <grid id="g"> <rows> <row> <cell hflex="true"> <listbox model="${values}"> <template name="model"> <listitem> <listcell>Label ${each+ 1}</listcell> <listcell><textbox hflex="1" rows="3"></textbox></listcell> <listcell> <button label="Add row"> <attribute name="onClick"><![CDATA[add_row(g);self.setVisible(false);]]></attribute> </button> </listcell> </listitem> </template> </listbox> </cell> <cell id="c" hflex="1" vflex="true"> <textbox hflex="1" vflex="1" multiline="true"></textbox> </cell> </row> </rows> </grid> </zk>
Hi,
render entire row to solve this issue.
void add_row(Component grid) { ... g.getFellow("r").invalidate(); } </zscript> <row id="r" vflex="true"> ... </row>
Hi Hawk,
I must come back to my earlier question. If I specify the attribute "sizedByContent" to true, the width of the column 0 in the version ZK 7.0.4 will probably miscalculated after invalidate(). I know that I not have full control as soon as "sizedByContent" is set to true. With ZK version 6.5 the column width was as expected (if <column> element is removed, then however, the width was not as expected too).
Thanks in advance Kai
<?xml version="1.0" encoding="UTF-8"?><zk>
<zscript>
ListModelList values= new ListModelList(new Integer[] { 0 });
void add_row(Component grid)
{
values.add(new Integer(values.size()));
g.getFellow("r").invalidate();
}
</zscript>
<grid id="g" sizedByContent="true">
<columns id="cols" width="100%">
<column hflex="1" align="left"/>
<column hflex="1" align="left"/>
</columns>
<rows>
<row id="r">
<cell hflex="1">
<listbox model="${values}">
<template name="model">
<listitem>
<listcell>Label ${each+ 1}</listcell>
<listcell><textbox hflex="1" rows="3"></textbox></listcell>
<listcell>
<button label="Add row">
<attribute name="onClick"><![CDATA[add_row(g);self.setVisible(false);]]></attribute>
</button>
</listcell>
</listitem>
</template>
</listbox>
</cell>
<cell hflex="1">
<textbox hflex="1" vflex="1" multiline="true"></textbox>
</cell>
</row>
</rows>
</grid></zk>
Asked: 2012-03-20 09:26:44 +0800
Seen: 188 times
Last updated: Jan 13 '15