Search in sources :

Example 6 with DivDialogAction

use of com.servoy.j2db.server.headlessclient.PageJSActionBuffer.DivDialogAction in project servoy-client by Servoy.

the class MainPage method toBack.

public void toBack() {
    touch();
    if (isShowingInDialog() && callingContainer != null) {
        callingContainer.touch();
        ServoyDivDialog divDialog = callingContainer.divDialogs.get(getContainerName());
        if (divDialog != null) {
            callingContainer.addJSAction(new DivDialogAction(divDialog, DivDialogAction.OP_TO_BACK));
        }
    } else {
        appendJavaScriptChanges("window.blur();");
    }
}
Also used : DivDialogAction(com.servoy.j2db.server.headlessclient.PageJSActionBuffer.DivDialogAction)

Example 7 with DivDialogAction

use of com.servoy.j2db.server.headlessclient.PageJSActionBuffer.DivDialogAction in project servoy-client by Servoy.

the class MainPage method setDialogBounds.

public void setDialogBounds(String windowName, int x, int y, int width, int height) {
    touch();
    if (callingContainer != null) {
        callingContainer.touch();
        ServoyDivDialog divDialog = callingContainer.divDialogs.get(windowName);
        if (divDialog != null) {
            callingContainer.addJSAction(new DivDialogAction(divDialog, DivDialogAction.OP_SET_BOUNDS, new Object[] { x, y, width, height }));
        }
    }
}
Also used : DivDialogAction(com.servoy.j2db.server.headlessclient.PageJSActionBuffer.DivDialogAction)

Example 8 with DivDialogAction

use of com.servoy.j2db.server.headlessclient.PageJSActionBuffer.DivDialogAction in project servoy-client by Servoy.

the class MainPage method showOpenFileDialog.

@SuppressWarnings("nls")
public void showOpenFileDialog(final IMediaUploadCallback callback, boolean multiSelect, String acceptFilter, String title) {
    if ((isShowingInDialog() || isClosingAsDivPopup()) && callingContainer != null) {
        callingContainer.showOpenFileDialog(callback, multiSelect, acceptFilter, title);
    } else {
        touch();
        this.mediaUploadMultiSelect = multiSelect;
        this.mediaUploadFilter = acceptFilter;
        this.mediaUploadCallback = new IMediaUploadCallback() {

            boolean uploaded = false;

            public void uploadComplete(IUploadData[] fu) {
                touch();
                uploaded = true;
                mediaUploadCallback = null;
                addJSAction(new DivDialogAction(fileUploadWindow, DivDialogAction.OP_CLOSE));
                callback.uploadComplete(fu);
            }

            public void onSubmit() {
                if (!uploaded) {
                    mediaUploadCallback = null;
                    divDialogs.remove(FILE_UPLOAD_PAGEMAP);
                    fileUploadWindow.setPageMapName(null);
                    fileUploadWindow.remove(fileUploadWindow.getContentId());
                    addJSAction(new DivDialogAction(fileUploadWindow, DivDialogAction.OP_CLOSE));
                }
            }
        };
        fileUploadWindow.setPageMapName(FILE_UPLOAD_PAGEMAP);
        if (title == null) {
            fileUploadWindow.setTitle(client.getI18NMessage("servoy.filechooser.title"));
        } else if (!"".equals(title)) {
            fileUploadWindow.setTitle(title);
        }
        divDialogs.put(FILE_UPLOAD_PAGEMAP, fileUploadWindow);
        addJSAction(new DivDialogAction(fileUploadWindow, DivDialogAction.OP_SHOW, new Object[] { FILE_UPLOAD_PAGEMAP }));
    }
}
Also used : IUploadData(com.servoy.j2db.plugins.IUploadData) DivDialogAction(com.servoy.j2db.server.headlessclient.PageJSActionBuffer.DivDialogAction) IMediaUploadCallback(com.servoy.j2db.plugins.IMediaUploadCallback)

Aggregations

DivDialogAction (com.servoy.j2db.server.headlessclient.PageJSActionBuffer.DivDialogAction)8 FormController (com.servoy.j2db.FormController)1 FormManager (com.servoy.j2db.FormManager)1 IFormController (com.servoy.j2db.IFormController)1 IMainContainer (com.servoy.j2db.IMainContainer)1 IMediaUploadCallback (com.servoy.j2db.plugins.IMediaUploadCallback)1 IUploadData (com.servoy.j2db.plugins.IUploadData)1 WicketEvent (com.servoy.j2db.server.headlessclient.eventthread.WicketEvent)1 IComponent (com.servoy.j2db.ui.IComponent)1 IFieldComponent (com.servoy.j2db.ui.IFieldComponent)1 Point (java.awt.Point)1 Rectangle (java.awt.Rectangle)1 Component (org.apache.wicket.Component)1 Page (org.apache.wicket.Page)1 AjaxRequestTarget (org.apache.wicket.ajax.AjaxRequestTarget)1 ModalWindow (org.apache.wicket.extensions.ajax.markup.html.modal.ModalWindow)1 WebPage (org.apache.wicket.markup.html.WebPage)1 FormComponent (org.apache.wicket.markup.html.form.FormComponent)1