IDEMPIERE-369 Master Detail layout improvements. Make use of the ad_tab.isSingleRow for detail tabs and onNew event - only auto switch to form view if isSingleRow=Y.

This commit is contained in:
Heng Sin Low 2013-01-30 11:23:39 +08:00
parent 15208de636
commit 226a1d9b86
4 changed files with 30 additions and 4 deletions

View File

@ -1526,6 +1526,18 @@ public abstract class AbstractADWindowContent extends AbstractUIPart implements
toolbar.enableIgnore(true);
toolbar.enablePrint(adTabbox.getSelectedGridTab().isPrinted());
toolbar.enableReport(true);
if (adTabbox.getSelectedGridTab().isSingleRow())
{
if (adTabbox.getSelectedTabpanel().isGridView())
{
adTabbox.getSelectedTabpanel().switchRowPresentation();
}
}
if (adTabbox.getSelectedTabpanel().isGridView())
{
adTabbox.getSelectedTabpanel().getGridView().editCurrentRow();
}
}
else
{

View File

@ -108,9 +108,16 @@ public class CompositeADTabbox extends AbstractADTabbox
@Override
public void onCallback(Boolean result) {
if (result) {
if (getSelectedDetailADTabpanel().getGridTab().isSingleRow()) {
onEditDetail(row, true);
if (!adWindowPanel.getActiveGridTab().isNew())
adWindowPanel.onNew();
} else {
if (!getSelectedDetailADTabpanel().getGridTab().isNew()) {
getSelectedDetailADTabpanel().getGridTab().dataNew(false);
getSelectedDetailADTabpanel().getGridView().editCurrentRow();
}
}
}
}
});

View File

@ -232,7 +232,7 @@ public class DetailPane extends Panel implements EventListener<Event>, IdSpace {
}
}
if (adtab != null && adtab.isDetailPaneMode()) {
onEdit(false);
onEdit(adtab.getGridTab().isSingleRow());
}
}
});

View File

@ -820,4 +820,11 @@ public class GridView extends Vbox implements EventListener<Event>, IdSpace
public GridField[] getFields() {
return gridField;
}
public void editCurrentRow() {
if (!renderer.isEditing()) {
renderer.editCurrentRow();
renderer.setFocusToEditor();
}
}
}