bcusick
January 24, 2019, 10:03pm
1
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…
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);
}
mboegem
January 25, 2019, 12:46am
2
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
Thanks, Marc.
This is the WebClient - and when I create the window - the “name” I give it is “oncoreProtocolAttach” as in my code:
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?
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
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", "
"));
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);
}
}
AH! Thank you very much for looking!