IDEMPIERE-5219 Sales Order Window: initial focus not on header tab's field (#1222)
This commit is contained in:
parent
7cabc12ebd
commit
e3555e5fff
|
@ -1416,7 +1416,7 @@ DataStatusListener, IADTabpanel, IdSpace, IFieldEditorContainer
|
||||||
} else {
|
} else {
|
||||||
if (activate) {
|
if (activate) {
|
||||||
formContainer.setVisible(activate);
|
formContainer.setVisible(activate);
|
||||||
if (!isMobile())
|
if (!isMobile() && !isDetailPaneMode())
|
||||||
focusToFirstEditor();
|
focusToFirstEditor();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -2331,4 +2331,9 @@ DataStatusListener, IADTabpanel, IdSpace, IFieldEditorContainer
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public AbstractADWindowContent getADWindowContent()
|
||||||
|
{
|
||||||
|
return windowPanel;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1170,12 +1170,31 @@ public abstract class AbstractADWindowContent extends AbstractUIPart implements
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* restore focus to last known focus editor (if any)
|
* restore focus to last known focus editor (if any)
|
||||||
|
* @return true if there's last focus editor
|
||||||
*/
|
*/
|
||||||
public void focusToLastFocusEditor() {
|
public boolean focusToLastFocusEditor() {
|
||||||
|
return focusToLastFocusEditor(false);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* restore focus to last known focus editor (if any)
|
||||||
|
* @param defer true to schedule for later/defer execution
|
||||||
|
* @return true if there's last focus editor
|
||||||
|
*/
|
||||||
|
public boolean focusToLastFocusEditor(boolean defer) {
|
||||||
if (lastFocusEditor != null && lastFocusEditor instanceof HtmlBasedComponent &&
|
if (lastFocusEditor != null && lastFocusEditor instanceof HtmlBasedComponent &&
|
||||||
lastFocusEditor.getPage() != null && LayoutUtils.isReallyVisible(lastFocusEditor))
|
lastFocusEditor.getPage() != null && LayoutUtils.isReallyVisible(lastFocusEditor)) {
|
||||||
|
if (defer) {
|
||||||
|
final HtmlBasedComponent editor = (HtmlBasedComponent) lastFocusEditor;
|
||||||
|
Executions.schedule(getComponent().getDesktop(), e -> editor.focus(), new Event("onScheduleFocusToLastFocusEditor"));
|
||||||
|
} else {
|
||||||
((HtmlBasedComponent)lastFocusEditor).focus();
|
((HtmlBasedComponent)lastFocusEditor).focus();
|
||||||
}
|
}
|
||||||
|
return true;
|
||||||
|
} else {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Invoke when quick form is click
|
* Invoke when quick form is click
|
||||||
|
|
|
@ -388,6 +388,10 @@ public class CompositeADTabbox extends AbstractADTabbox
|
||||||
if (tabPanel != headerTab && headerTab.getDetailPane() != null) {
|
if (tabPanel != headerTab && headerTab.getDetailPane() != null) {
|
||||||
if (b != null && b.booleanValue()) {
|
if (b != null && b.booleanValue()) {
|
||||||
onActivateDetail(tabPanel);
|
onActivateDetail(tabPanel);
|
||||||
|
if (headerTab instanceof ADTabpanel) {
|
||||||
|
if (!((ADTabpanel) headerTab).getADWindowContent().focusToLastFocusEditor(true))
|
||||||
|
((ADTabpanel) headerTab).getADWindowContent().focusToActivePanel();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -189,4 +189,9 @@ public class ComboEditorBox extends Div {
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void focus() {
|
||||||
|
txt.focus();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -162,4 +162,9 @@ public class EditorBox extends Div {
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void focus() {
|
||||||
|
txt.focus();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -170,4 +170,9 @@ public class Urlbox extends Div
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void focus() {
|
||||||
|
txt.focus();
|
||||||
|
}
|
||||||
}
|
}
|
Loading…
Reference in New Issue