IDEMPIERE-1673 In new state of record. click to print and export throws exception

This commit is contained in:
Elaine Tan 2014-07-15 15:10:52 -05:00
parent 402fa7e782
commit afca73d7b8
2 changed files with 31 additions and 8 deletions

View File

@ -523,6 +523,26 @@ public class ADWindowToolbar extends FToolbar implements EventListener<Event>
{ {
btnCustomize.setDisabled(!enabled); btnCustomize.setDisabled(!enabled);
} }
public void enableArchive(boolean enabled)
{
btnArchive.setDisabled(!enabled);
}
public void enableZoomAcross(boolean enabled)
{
btnZoomAcross.setDisabled(!enabled);
}
public void enableActiveWorkflows(boolean enabled)
{
btnActiveWorkflows.setDisabled(!enabled);
}
public void enableRequests(boolean enabled)
{
btnRequests.setDisabled(!enabled);
}
public void lock(boolean locked) public void lock(boolean locked)
{ {

View File

@ -1081,7 +1081,7 @@ public abstract class AbstractADWindowContent extends AbstractUIPart implements
{ {
ADTabpanel adtab = (ADTabpanel) event.getTarget(); ADTabpanel adtab = (ADTabpanel) event.getTarget();
if (adtab == adTabbox.getSelectedTabpanel()) { if (adtab == adTabbox.getSelectedTabpanel()) {
toolbar.enableProcessButton(adtab.getToolbarButtons().size() > 0); toolbar.enableProcessButton(adtab.getToolbarButtons().size() > 0 && !adTabbox.getSelectedGridTab().isNew());
toolbar.dynamicDisplay(); toolbar.dynamicDisplay();
} }
} }
@ -1271,7 +1271,7 @@ public abstract class AbstractADWindowContent extends AbstractUIPart implements
toolbar.lock(adTabbox.getSelectedGridTab().isLocked()); toolbar.lock(adTabbox.getSelectedGridTab().isLocked());
} }
toolbar.enablePrint(adTabbox.getSelectedGridTab().isPrinted()); toolbar.enablePrint(adTabbox.getSelectedGridTab().isPrinted() && !adTabbox.getSelectedGridTab().isNew());
//Deepak-Enabling customize button IDEMPIERE-364 //Deepak-Enabling customize button IDEMPIERE-364
if(!(adTabbox.getSelectedTabpanel() instanceof ADSortTab)) if(!(adTabbox.getSelectedTabpanel() instanceof ADSortTab))
@ -1596,8 +1596,15 @@ public abstract class AbstractADWindowContent extends AbstractUIPart implements
adTabbox.evaluate(e); adTabbox.evaluate(e);
} }
toolbar.enablePrint(adTabbox.getSelectedGridTab().isPrinted() && !adTabbox.getSelectedGridTab().isNew()); boolean isNewRow = adTabbox.getSelectedGridTab().getRowCount() == 0 || adTabbox.getSelectedGridTab().isNew();
toolbar.enableReport(true); toolbar.enableProcessButton(!isNewRow);
toolbar.enableArchive(!isNewRow);
toolbar.enableZoomAcross(!isNewRow);
toolbar.enableActiveWorkflows(!isNewRow);
toolbar.enableRequests(!isNewRow);
toolbar.enablePrint(adTabbox.getSelectedGridTab().isPrinted() && !isNewRow);
toolbar.enableReport(!isNewRow);
toolbar.enableExport(!adTabbox.getSelectedGridTab().isSortTab()); toolbar.enableExport(!adTabbox.getSelectedGridTab().isSortTab());
toolbar.enableFileImport(!changed && !adTabbox.getSelectedGridTab().isSortTab() && adTabbox.getSelectedGridTab().isInsertRecord()); toolbar.enableFileImport(!changed && !adTabbox.getSelectedGridTab().isSortTab() && adTabbox.getSelectedGridTab().isInsertRecord());
@ -1741,8 +1748,6 @@ public abstract class AbstractADWindowContent extends AbstractUIPart implements
breadCrumb.enableLastNavigation(adTabbox.getSelectedGridTab().getCurrentRow() + 1 < adTabbox.getSelectedGridTab().getRowCount()); breadCrumb.enableLastNavigation(adTabbox.getSelectedGridTab().getCurrentRow() + 1 < adTabbox.getSelectedGridTab().getRowCount());
toolbar.enableTabNavigation(breadCrumb.hasParentLink(), adTabbox.getSelectedDetailADTabpanel() != null); toolbar.enableTabNavigation(breadCrumb.hasParentLink(), adTabbox.getSelectedDetailADTabpanel() != null);
toolbar.enableIgnore(true); toolbar.enableIgnore(true);
toolbar.enablePrint(adTabbox.getSelectedGridTab().isPrinted());
toolbar.enableReport(true);
if (adTabbox.getSelectedGridTab().isSingleRow()) if (adTabbox.getSelectedGridTab().isSingleRow())
{ {
if (adTabbox.getSelectedTabpanel().isGridView()) if (adTabbox.getSelectedTabpanel().isGridView())
@ -1789,8 +1794,6 @@ public abstract class AbstractADWindowContent extends AbstractUIPart implements
breadCrumb.enableLastNavigation(adTabbox.getSelectedGridTab().getCurrentRow() + 1 < adTabbox.getSelectedGridTab().getRowCount()); breadCrumb.enableLastNavigation(adTabbox.getSelectedGridTab().getCurrentRow() + 1 < adTabbox.getSelectedGridTab().getRowCount());
toolbar.enableTabNavigation(false); toolbar.enableTabNavigation(false);
toolbar.enableIgnore(true); toolbar.enableIgnore(true);
toolbar.enablePrint(adTabbox.getSelectedGridTab().isPrinted());
toolbar.enableReport(true);
} }
else else
{ {