IDEMPIERE-369 Master Detail layout improvements. 1) Fixed auto goes into detail mode for sort tab. 2) Fixed cna't goes back to parent tab after navigating to sort tab. 3) Fixed wrong icon for sort tab.
This commit is contained in:
parent
6deac69c8e
commit
b6272115b9
|
@ -41,13 +41,13 @@ import org.compiere.util.DB;
|
||||||
import org.compiere.util.Env;
|
import org.compiere.util.Env;
|
||||||
import org.compiere.util.Msg;
|
import org.compiere.util.Msg;
|
||||||
import org.compiere.util.NamePair;
|
import org.compiere.util.NamePair;
|
||||||
import org.zkoss.zhtml.Span;
|
|
||||||
import org.zkoss.zk.au.out.AuFocus;
|
import org.zkoss.zk.au.out.AuFocus;
|
||||||
import org.zkoss.zk.ui.event.DropEvent;
|
import org.zkoss.zk.ui.event.DropEvent;
|
||||||
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.zk.ui.util.Clients;
|
import org.zkoss.zk.ui.util.Clients;
|
||||||
|
import org.zkoss.zul.Hlayout;
|
||||||
import org.zkoss.zul.Vbox;
|
import org.zkoss.zul.Vbox;
|
||||||
import org.zkoss.zul.event.ListDataEvent;
|
import org.zkoss.zul.event.ListDataEvent;
|
||||||
|
|
||||||
|
@ -86,8 +86,8 @@ public class ADSortTab extends Panel implements IADTabpanel
|
||||||
this.gridTab = gridTab;
|
this.gridTab = gridTab;
|
||||||
|
|
||||||
m_AD_Table_ID = gridTab.getAD_Table_ID();
|
m_AD_Table_ID = gridTab.getAD_Table_ID();
|
||||||
this.setHeight("100%");
|
this.setVflex("true");
|
||||||
} // VSortTab
|
} // ADSortTab
|
||||||
|
|
||||||
/** Logger */
|
/** Logger */
|
||||||
static CLogger log = CLogger.getCLogger(ADSortTab.class);
|
static CLogger log = CLogger.getCLogger(ADSortTab.class);
|
||||||
|
@ -254,13 +254,10 @@ public class ADSortTab extends Panel implements IADTabpanel
|
||||||
*/
|
*/
|
||||||
private void init() throws Exception
|
private void init() throws Exception
|
||||||
{
|
{
|
||||||
this.setStyle("height: 100%; width: 100%;");
|
|
||||||
//
|
//
|
||||||
noLabel.setValue("No");
|
noLabel.setValue("No");
|
||||||
yesLabel.setValue("Yes");
|
yesLabel.setValue("Yes");
|
||||||
|
|
||||||
yesList.setHeight("100%");
|
|
||||||
noList.setHeight("100%");
|
|
||||||
yesList.setVflex(true);
|
yesList.setVflex(true);
|
||||||
noList.setVflex(true);
|
noList.setVflex(true);
|
||||||
|
|
||||||
|
@ -287,10 +284,10 @@ public class ADSortTab extends Panel implements IADTabpanel
|
||||||
yesList.setSeltype("multiple");
|
yesList.setSeltype("multiple");
|
||||||
noList.setSeltype("multiple");
|
noList.setSeltype("multiple");
|
||||||
|
|
||||||
bAdd.setImage("images/Detail24.png");
|
bAdd.setImage("images/Next24.png");
|
||||||
bAdd.addEventListener(Events.ON_CLICK, actionListener);
|
bAdd.addEventListener(Events.ON_CLICK, actionListener);
|
||||||
|
|
||||||
bRemove.setImage("images/Parent24.png");
|
bRemove.setImage("images/Previous24.png");
|
||||||
bRemove.addEventListener(Events.ON_CLICK, actionListener);
|
bRemove.addEventListener(Events.ON_CLICK, actionListener);
|
||||||
|
|
||||||
EventListener crossListMouseListener = new DragListener();
|
EventListener crossListMouseListener = new DragListener();
|
||||||
|
@ -306,10 +303,10 @@ public class ADSortTab extends Panel implements IADTabpanel
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
bUp.setImage("images/Previous24.png");
|
bUp.setImage("images/Parent24.png");
|
||||||
bUp.addEventListener(Events.ON_CLICK, actionListener);
|
bUp.addEventListener(Events.ON_CLICK, actionListener);
|
||||||
|
|
||||||
bDown.setImage("images/Next24.png");
|
bDown.setImage("images/Detail24.png");
|
||||||
bDown.addEventListener(Events.ON_CLICK, actionListener);
|
bDown.addEventListener(Events.ON_CLICK, actionListener);
|
||||||
|
|
||||||
EventListener yesListMouseMotionListener = new EventListener()
|
EventListener yesListMouseMotionListener = new EventListener()
|
||||||
|
@ -354,29 +351,28 @@ public class ADSortTab extends Panel implements IADTabpanel
|
||||||
listHeader.appendChild(noLabel);
|
listHeader.appendChild(noLabel);
|
||||||
listHeader.setParent(listHead);
|
listHeader.setParent(listHead);
|
||||||
|
|
||||||
Span span = new Span();
|
Hlayout hlayout = new Hlayout();
|
||||||
span.setParent(this);
|
hlayout.setVflex("true");
|
||||||
span.setStyle("height: 99%; display: inline-block; width: 40%;");
|
hlayout.setHflex("true");
|
||||||
span.appendChild(noList);
|
hlayout.setStyle("margin: auto;");
|
||||||
|
appendChild(hlayout);
|
||||||
|
noList.setHflex("1");
|
||||||
|
noList.setVflex(true);
|
||||||
|
hlayout.appendChild(noList);
|
||||||
Vbox vbox = new Vbox();
|
Vbox vbox = new Vbox();
|
||||||
vbox.appendChild(bAdd);
|
vbox.appendChild(bAdd);
|
||||||
vbox.appendChild(bRemove);
|
vbox.appendChild(bRemove);
|
||||||
span = new Span();
|
vbox.setWidth("46px");
|
||||||
span.setParent(this);
|
hlayout.appendChild(vbox);
|
||||||
span.setStyle("height: 99%; display: inline-block; width: 46px");
|
|
||||||
span.appendChild(vbox);
|
|
||||||
|
|
||||||
span = new Span();
|
yesList.setVflex(true);
|
||||||
span.setParent(this);
|
yesList.setHflex("1");
|
||||||
span.setStyle("height: 99%; display: inline-block; width: 40%");
|
hlayout.appendChild(yesList);
|
||||||
span.appendChild(yesList);
|
|
||||||
vbox = new Vbox();
|
vbox = new Vbox();
|
||||||
vbox.appendChild(bUp);
|
vbox.appendChild(bUp);
|
||||||
vbox.appendChild(bDown);
|
vbox.appendChild(bDown);
|
||||||
span = new Span();
|
vbox.setWidth("46px");
|
||||||
span.setParent(this);
|
hlayout.appendChild(vbox);
|
||||||
span.setStyle("height: 99%; display: inline-block; width: 46px");
|
|
||||||
span.appendChild(vbox);
|
|
||||||
} // Init
|
} // Init
|
||||||
|
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
|
@ -933,6 +929,7 @@ public class ADSortTab extends Panel implements IADTabpanel
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void setDetailPaneMode(boolean detailMode, boolean vflex) {
|
public void setDetailPaneMode(boolean detailMode, boolean vflex) {
|
||||||
|
this.setVflex(Boolean.toString(vflex));
|
||||||
}
|
}
|
||||||
} //ADSortTab
|
} //ADSortTab
|
||||||
|
|
||||||
|
|
|
@ -95,6 +95,7 @@ import org.zkoss.zk.ui.Session;
|
||||||
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.zk.ui.util.Clients;
|
||||||
import org.zkoss.zul.Button;
|
import org.zkoss.zul.Button;
|
||||||
import org.zkoss.zul.Column;
|
import org.zkoss.zul.Column;
|
||||||
import org.zkoss.zul.Columns;
|
import org.zkoss.zul.Columns;
|
||||||
|
@ -1580,7 +1581,7 @@ public abstract class AbstractADWindowContent extends AbstractUIPart implements
|
||||||
}
|
}
|
||||||
if (dirtyTabpanel != null) {
|
if (dirtyTabpanel != null) {
|
||||||
if (dirtyTabpanel == adTabbox.getSelectedDetailADTabpanel())
|
if (dirtyTabpanel == adTabbox.getSelectedDetailADTabpanel())
|
||||||
onDetailRecord();
|
Clients.scrollIntoView(dirtyTabpanel);
|
||||||
focusToTabpanel(dirtyTabpanel);
|
focusToTabpanel(dirtyTabpanel);
|
||||||
} else {
|
} else {
|
||||||
focusToActivePanel();
|
focusToActivePanel();
|
||||||
|
|
|
@ -593,14 +593,14 @@ public class CompositeADTabbox extends AbstractADTabbox
|
||||||
@Override
|
@Override
|
||||||
public boolean dataSave(boolean onSaveEvent) {
|
public boolean dataSave(boolean onSaveEvent) {
|
||||||
IADTabpanel detail = getSelectedDetailADTabpanel();
|
IADTabpanel detail = getSelectedDetailADTabpanel();
|
||||||
if (detail != null && detail.getGridTab().needSave(true, true)) {
|
if (detail != null && !detail.getGridTab().isSortTab() && detail.getGridTab().needSave(true, true)) {
|
||||||
Execution execution = Executions.getCurrent();
|
Execution execution = Executions.getCurrent();
|
||||||
if (execution != null) {
|
if (execution != null) {
|
||||||
execution.setAttribute(getClass().getName()+".dataAction", detail.getUuid());
|
execution.setAttribute(getClass().getName()+".dataAction", detail.getUuid());
|
||||||
}
|
}
|
||||||
return detail.getGridTab().dataSave(onSaveEvent);
|
return detail.getGridTab().dataSave(onSaveEvent);
|
||||||
}
|
}
|
||||||
return headerTab.getGridTab().dataSave(onSaveEvent);
|
return headerTab.getGridTab().isSortTab() ? true : headerTab.getGridTab().dataSave(onSaveEvent);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -637,7 +637,6 @@ public class CompositeADTabbox extends AbstractADTabbox
|
||||||
if (tabPanel instanceof ADSortTab) {
|
if (tabPanel instanceof ADSortTab) {
|
||||||
detailPane.invalidate();
|
detailPane.invalidate();
|
||||||
detailPane.updateToolbar(false, true);
|
detailPane.updateToolbar(false, true);
|
||||||
onDetailRecord();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue