if(ajaxDeferredBehaviour != null) {
ajaxDeferredBehaviour.initiate(target);
} else {
ActionPromptHeaderPanel titlePanel = new ActionPromptHeaderPanel(actionPrompt.getTitleId(), actionModel);
final ActionPanel actionPanel =
(ActionPanel) getComponentFactoryRegistry().createComponent(
ComponentType.ACTION_PROMPT, actionPrompt.getContentId(), actionModel);
actionPanel.setShowHeader(false);
actionPrompt.setTitle(titlePanel, target);
actionPrompt.setPanel(actionPanel, target);
actionPanel.setActionPrompt(actionPrompt);
actionPrompt.showPrompt(target);
focusOnFirstParameter(target, actionPanel);
}
}
private void focusOnFirstParameter(AjaxRequestTarget target, ActionPanel actionPanel) {
// first, force all parameters to build themselves...
actionPanel.visitChildren(new IVisitor<Component, Component>() {
@Override
public void component(Component object, IVisit<Component> visit) {
if (object instanceof ScalarPanelAbstract) {
ScalarPanelAbstract spa = (ScalarPanelAbstract) object;
spa.forceBuildGui();
visit.dontGoDeeper();
}
}
});
// second, go searching for the first <input> in the action panel.
final Component actionPanelFirstParam = actionPanel.visitChildren(new IVisitor<Component, Component>() {
@Override
public void component(Component object, IVisit<Component> visit) {
if (object instanceof FormComponent &&
!"scalarIfCompact".equals(object.getId()) &&
object.getOutputMarkupId()) {