-
FEATURED COMPONENTS
First time here? Check out the FAQ!
Hi,
I'm using ZK CE 6.0.1.
When i use textbox with inplace=true in listbox, size of control is cutted.
Other problem is when refresh data textbox size change to default size.
I'm using hflex to control size. When resize browser window all resize ok.
Please help me to understand inplace.
Thanks,
Miguel Goncalves
could you provide any reproducible zul file?
Hi Dennis,
I created ZkFiddle example:
package j2o8t3cb$v2;import org.zkoss.zk.ui.*;
import org.zkoss.zk.ui.event.*;
import org.zkoss.zk.ui.util.*;
import org.zkoss.zk.ui.ext.*;
import org.zkoss.zk.au.*;
import org.zkoss.zk.au.out.*;
import org.zkoss.zul.*;
import java.util.*;
import org.zkoss.bind.*;public class TestComposer extends GenericForwardComposer{
public class Item {
private Integer id;
private String description;public Item(Integer id,String description) {
super();
this.id=id;
this.description=description;
}
public Integer getId() {return id;}
public String getDescription() { return description;}
public void setId(Integer id) {this.id=id;}
public void setId(String description) {this.description=description;}
}private List<Item> items;
public List<Item> getItems() {
if (items==null)
items=new ArrayList<Item>();
return items;
}
public void doAfterCompose(Component comp) throws Exception {
super.doAfterCompose(comp);AnnotateBinder binder=new AnnotateBinder();
binder.init(comp,this,null);
comp.setAttribute("vm",this);
getItems().add(new Item(1,"Michael"));
binder.loadComponent(comp,true);
}public void onClick$btn(Event e) throws InterruptedException{
Messagebox.show("Hi btn");
}
}
<zk>
<window border="normal" title="hello" apply="j2o8t3cb$v2.TestComposer">
<listbox model="@load(vm.items)">
<listhead>
<listheader label="id"/>
<listheader label="description"/>
</listhead>
<template name="model" var="item">
<listitem>
<listcell>
<textbox value="@bind(item.id)" inplace="true" hflex="1" style="text-align:right"/>
</listcell>
<listcell>
<textbox value="@bind(item.description)" inplace="true" hflex="1"/>
</listcell>
</listitem>
</template>
</listbox>
</window>
</zk>
Thanks,
Miguel
Asked: 2012-05-31 09:53:31 +0800
Seen: 165 times
Last updated: Jun 26 '12