0

Inplace size problems

asked 2012-05-31 09:53:31 +0800

mgvv gravatar image mgvv
127 2

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

delete flag offensive retag edit

2 Replies

Sort by ยป oldest newest

answered 2012-06-13 09:39:55 +0800

dennis gravatar image dennis
3679 1 6
http://www.javaworld.com....

could you provide any reproducible zul file?

link publish delete flag offensive edit

answered 2012-06-26 15:34:57 +0800

mgvv gravatar image mgvv
127 2

Hi Dennis,

I created ZkFiddle example:

ZKFiddle-Link

TestComposer.java
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");
}
}


index.zul
<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

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: 2012-05-31 09:53:31 +0800

Seen: 165 times

Last updated: Jun 26 '12

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