IDEMPIERE-3269 Field to show read-only grid (TrekGlobal contribution 1006181) / fix on zk 8.6.0.1

This commit is contained in:
Carlos Ruiz 2019-03-24 14:07:59 -03:00
parent 7ee9d5e7cd
commit 216a84c478
1 changed files with 15 additions and 13 deletions

View File

@ -27,6 +27,7 @@ import org.adempiere.webui.component.Label;
import org.adempiere.webui.component.ListHead; import org.adempiere.webui.component.ListHead;
import org.adempiere.webui.component.ListHeader; import org.adempiere.webui.component.ListHeader;
import org.adempiere.webui.component.Listbox; import org.adempiere.webui.component.Listbox;
import org.adempiere.webui.util.ZKUpdateUtil;
import org.compiere.model.GridField; import org.compiere.model.GridField;
import org.compiere.model.GridTab; import org.compiere.model.GridTab;
import org.compiere.model.GridTable; import org.compiere.model.GridTable;
@ -37,10 +38,9 @@ import org.compiere.util.Msg;
import org.zkoss.zk.ui.event.Event; import org.zkoss.zk.ui.event.Event;
import org.zkoss.zk.ui.event.EventListener; import org.zkoss.zk.ui.event.EventListener;
import org.zkoss.zk.ui.event.Events; import org.zkoss.zk.ui.event.Events;
import org.zkoss.zul.Borderlayout; import org.zkoss.zul.Box;
import org.zkoss.zul.Center;
import org.zkoss.zul.ListModel; import org.zkoss.zul.ListModel;
import org.zkoss.zul.South; import org.zkoss.zul.Vlayout;
import org.zkoss.zul.ext.Selectable; import org.zkoss.zul.ext.Selectable;
/** /**
@ -48,7 +48,7 @@ import org.zkoss.zul.ext.Selectable;
* @author Low Heng Sin * @author Low Heng Sin
* *
*/ */
public class GridTabSelectionListView extends Borderlayout public class GridTabSelectionListView extends Vlayout
{ {
/** /**
* *
@ -78,7 +78,7 @@ public class GridTabSelectionListView extends Borderlayout
private GridTabSelectionListViewRenderer renderer; private GridTabSelectionListViewRenderer renderer;
private South south; private Box labelBox;
private Map<Integer, String> columnWidthMap; private Map<Integer, String> columnWidthMap;
@ -98,8 +98,8 @@ public class GridTabSelectionListView extends Borderlayout
listbox = new Listbox(); listbox = new Listbox();
listbox.setCheckmark(true); listbox.setCheckmark(true);
listbox.setMultiple(multiple); listbox.setMultiple(multiple);
south = new South(); labelBox = new Box();
this.appendChild(south); this.appendChild(labelBox);
//default paging size //default paging size
pageSize = MSysConfig.getIntValue(MSysConfig.ZK_PAGING_SIZE, 100); pageSize = MSysConfig.getIntValue(MSysConfig.ZK_PAGING_SIZE, 100);
@ -269,18 +269,20 @@ public class GridTabSelectionListView extends Borderlayout
private void render() private void render()
{ {
listbox.setStyle("min-height: 200px"); listbox.setStyle("min-height: 200px");
listbox.setVflex(true); ZKUpdateUtil.setVflex(listbox, "1");
listbox.setHflex("1"); ZKUpdateUtil.setHflex(listbox, "1");
listbox.setSizedByContent(true); listbox.setSizedByContent(true);
updateModel(); updateModel();
Center center = new Center(); Box listboxbox = new Box();
center.appendChild(listbox); listboxbox.appendChild(listbox);
this.appendChild(center); ZKUpdateUtil.setVflex(listboxbox, "1");
ZKUpdateUtil.setHflex(listboxbox, "1");
this.appendChild(listboxbox);
selectedLabel = new Label(Msg.getMsg(Env.getCtx(), "Selected") + " : 0"); selectedLabel = new Label(Msg.getMsg(Env.getCtx(), "Selected") + " : 0");
south.appendChild(selectedLabel); labelBox.appendChild(selectedLabel);
} }
private void updateModel() { private void updateModel() {