Busy Plugin - Servoy 7.4.10 - block dialog?

Questions and answers on developing, deploying and using plugins and JavaBeans

Busy Plugin - Servoy 7.4.10 - block dialog?

Postby bcusick » Fri Jan 25, 2019 12:03 am

Hey Guys,

I *know* there is something that I'm doing wrong...

I have a modal dialog up and I want to use the busy plugin to block (shade) the modal dialog (not the background behind it).

I have added the window name - not sure if that's the "dialogName" the parameter is expecting...

Code: Select all
function callback_chooseFile(aFiles){
   
   var w = application.getWindow("oncoreProtocolAttach"),
      oSettings = {
      processFunction: getAttachment,
      message: "Uploading - please wait...",
      dialogName: "oncoreProtocolAttach",
        paneColor: '#000000',
        textColor: '#FF0000',
      opacity: 0.5,
      showCancelButton: false,
      cancelButtonText: 'Stop!',
      processArgs: aFiles
   };
   
   plugins.busy.block(oSettings);

}
Bob Cusick
bcusick
 
Posts: 1255
Joined: Wed Apr 23, 2003 11:27 pm
Location: Thousand Oaks, CA USA

Re: Busy Plugin - Servoy 7.4.10 - block dialog?

Postby mboegem » Fri Jan 25, 2019 2:46 am

Hi Bob,

'dialogName' is not covering what it does, although the property name is correct it should have been 'windowName' because that's what it is.

So if you have your smart client solution running and you have a main window and for example a separate calendar window with the name 'cal_window', you should have the 'dialogName' property set with 'cal_window'
You will then see the busy plugin does block the calendar window and not your main window.

So FID are not covered unless you make it a separate window.

Hope this helps
Marc Boegem
Solutiative / JBS Group, Partner
• Servoy Certified Developer
• Servoy Valued Professional
• Freelance Developer

Image

Partner of Tower - The most powerful Git client for Mac and Windows
User avatar
mboegem
 
Posts: 1743
Joined: Sun Oct 14, 2007 1:34 pm
Location: Amsterdam

Re: Busy Plugin - Servoy 7.4.10 - block dialog?

Postby bcusick » Fri Jan 25, 2019 5:06 pm

Thanks, Marc.

This is the WebClient - and when I create the window - the "name" I give it is "oncoreProtocolAttach" as in my code:

Code: Select all
var w = application.createWindow("oncoreProtocolAttach",JSWindow.MODAL_DIALOG);
   
   if(w){
      w.title = "Add Attachment";
      w.resizable = false;
      w.storeBounds = true;
      w.show(forms.oncore_api_dlg_add_attachment);
   }


Ideas?
Bob Cusick
bcusick
 
Posts: 1255
Joined: Wed Apr 23, 2003 11:27 pm
Location: Thousand Oaks, CA USA

Re: Busy Plugin - Servoy 7.4.10 - block dialog?

Postby mboegem » Fri Jan 25, 2019 7:13 pm

Hi Bob,

I had a quick look into the plugin after decompiling it.
The dialogName property simply isn't used in the code which is used in the web client....
Seems to be a valid reason for not getting it to work ;-)

Code: Select all
public void busy(String msg, String dialogName, float opacity, boolean showCancelButton, String cancelBtnText, Font fontType)
  {
    if ((useAjax()) && (!this.busy.get()))
    {
      removeCanceled();
     
      IPageContributor pc = initialize();
     
      StringBuffer js = new StringBuffer(this.jQueryPrefix + ".busy(");
      if (msg == null)
      {
        js.append("null");
      }
      else
      {
        js.append("'");
        js.append(msg.replaceAll("\\n", "<br/>"));
        js.append("'");
      }
      js.append(", ");
     
      js.append(opacity);
      js.append(", ");
     
      js.append(showCancelButton);
      js.append(", ");
     
      String script = null;
      try
      {
        script = this.behaviorCancel.getScriptCallBack();
      }
      catch (Exception ex)
      {
        script = null;
      }
      if ((!showCancelButton) || (script == null))
      {
        js.append("null");
      }
      else
      {
        js.append("function() { ");
        js.append(script);
        js.append("}");
      }
      Color paneColor = this.parent.getPaneColor();
      if (paneColor == null)
      {
        js.append(", null");
      }
      else
      {
        String color = PersistHelper.createColorString(this.parent.getPaneColor());
        js.append(", '");
        js.append(color);
        js.append("'");
      }
      Color textColor = this.parent.getTextColor();
      if (textColor == null)
      {
        js.append(", null");
      }
      else
      {
        String color = PersistHelper.createColorString(this.parent.getTextColor());
        js.append(", '");
        js.append(color);
        js.append("'");
      }
      if (fontType == null)
      {
        js.append(", null");
      }
      else
      {
        String fontName = fontType.getFontName();
        int fontStyle = fontType.getStyle();
        int fontSize = fontType.getSize();
        String fs = "";
        switch (fontStyle)
        {
        case 1:
          fs = "bold";
          break;
        case 2:
          fs = "italic";
          break;
        case 3:
          fs = "italic bold";
        }
        js.append(", '");
        js.append(fs);
        js.append(' ');
        js.append(fontSize);
        js.append("px ");
        js.append(fontName);
        js.append("'");
      }
      if (cancelBtnText != null)
      {
        js.append(", '");
        js.append(cancelBtnText);
        js.append("'");
      }
      js.append(");\n");
      js.append(this.behaviorStart.getScriptForCallback());
      pc.addDynamicJavaScript(js.toString());
     
      setCanceled(false);
    }
  }
Marc Boegem
Solutiative / JBS Group, Partner
• Servoy Certified Developer
• Servoy Valued Professional
• Freelance Developer

Image

Partner of Tower - The most powerful Git client for Mac and Windows
User avatar
mboegem
 
Posts: 1743
Joined: Sun Oct 14, 2007 1:34 pm
Location: Amsterdam

Re: Busy Plugin - Servoy 7.4.10 - block dialog?

Postby bcusick » Mon Jan 28, 2019 6:42 pm

AH! Thank you very much for looking! :)
Bob Cusick
bcusick
 
Posts: 1255
Joined: Wed Apr 23, 2003 11:27 pm
Location: Thousand Oaks, CA USA


Return to Plugins and Beans

Who is online

Users browsing this forum: No registered users and 9 guests