Sage SalesLogix
  • Contact Us
  • Sage North America
800-643-6400
Welcome Twitter Facebook LinkedIn
Community Home Blogs Share Ideas Search Request Access Resources
Reply
Copper Super Contributor
gmartinez
Posts: 20
Registered: 05-01-2009

Invoke a smart part as a dialog, via JavaScript

I am able to load a custom smart part as a dialog, using the following server side code.

 

DialogService.SetSpecs(0, 0, 200, 600,
"SmartPartDialogTest");

DialogService.ShowDialog();

 

Is there any equivalent to doing this via JavaScript?

 

The 7.5p1 Quick Lookup appears to launch in a dialog. The following is used to launch such dialog via javascript.

mgr = new Sage.GroupLookupManager();

Sage.Services.addService("GroupLookupManager", mgr);

mgr.showLookup();

Please use plain text.
Moderator
jperona
Posts: 232
Registered: 05-07-2008

Re: Invoke a smart part as a dialog, via JavaScript

[ Edited ]

The Dialog Workspace has a client-side javascript API, as follows:

 

The dialog workspace supports this directly:

 

/* simple */

DialogWorkspace.show('InsertNote');

 

/* with additional parameters */

DialogWorkspace.show({

    id: 'InsertNote',

    width: '500',

    height: '500'

});

 

/* full parameter object */

{

                id: 'SmartPartId',

                width: '500',

                height: '500',

                top: '200',

                left: '200',

                entityType: 'type, assembly',

                entityId: 'DEMO12345678',

                caption: 'My Title',

                keyNames: 'key1,key2',

                parameters: {

                                paramA: 'one',

                                paramB: 'two'

                }

}

 

 

This will be included in our new 7.5.2 documentation.

 

 

 

Message Edited by jperona on 06-17-2009 12:00 PM

John Perona

Director, SalesLogix Engineering

Sage SalesLogix

Sage

Please use plain text.
Copper Elite Contributor
henrycohen29
Posts: 70
Registered: 04-30-2009

Re: Invoke a smart part as a dialog, via JavaScript

Hey John,

 

Thanks, it worked great. Just one question:

 

I noticed that the top and left parameters are being ignored. The dialog is always opening in the center. Any ideas?

 

Thanks!

~ Henry

Please use plain text.
Moderator
jperona
Posts: 232
Registered: 05-07-2008

Re: Invoke a smart part as a dialog, via JavaScript

That's a defect and it's been logged for 7.5.2. Defect# 1-69861

 

John Perona

Director, SalesLogix Engineering

Sage SalesLogix

Sage

Please use plain text.
Silver Contributor
ngaller
Posts: 699
Registered: 04-17-2009

Re: Invoke a smart part as a dialog, via JavaScript


jperona wrote:

The Dialog Workspace has a client-side javascript API, as follows:

 

The dialog workspace supports this directly:

 

/* simple */

DialogWorkspace.show('InsertNote');

 

/* with additional parameters */

DialogWorkspace.show({

    id: 'InsertNote',

    width: '500',

    height: '500'

});

 

/* full parameter object */

{

                id: 'SmartPartId',

                width: '500',

                height: '500',

                top: '200',

                left: '200',

                entityType: 'type, assembly',

                entityId: 'DEMO12345678',

                caption: 'My Title',

                keyNames: 'key1,key2',

                parameters: {

                                paramA: 'one',

                                paramB: 'two'

                }

}

 

 

This will be included in our new 7.5.2 documentation.

 

 

 

Message Edited by jperona on 06-17-2009 12:00 PM

 

Did this make it in 7.5.2?  I forgot to check in the RC... until today when I actually need some documentation on the client-side services... 

 

The DialogWorkspace is not too bad but manipulating the group list is not trivial - would be nice to have some doc on how to do the basic tasks.

Please use plain text.
Silver Contributor
ngaller
Posts: 699
Registered: 04-17-2009

Re: Invoke a smart part as a dialog, via JavaScript

[ Edited ]
Message Edited by ngaller on 12-10-2009 12:00 PM
Please use plain text.
New Member
Nick_Hollis
Posts: 2
Registered: 02-11-2010

Re: Invoke a smart part as a dialog, via JavaScript

Hi,

 

Does anybody know if it is possible to resize a dialog whilst you are in the dialog (by either server side or client side)? I know when you call the dialog you can use SetSpecs and give it the int values for height and width, but calling that from the dialog itself does not work (obviously too late in the dialog lifecycle).

 

This may seem like a bizarre thing to want to do, but my scenario is complicated due to the fact you can only have one dialog window open in the dialog workspace.

 

I have two divs on a dialog, and I am showing and hiding them according to various selections (I would ideally like to open and close different dialog windows but this didnt work at all!). When I show Div A I want the dialog window to shrink accordingly and look the correct size. Vice versa, when I show Div B I want to expand the dialog window.

 

Any help greatly appreciated!

 

Thanks,

Nick

Please use plain text.
Copper Contributor
SteveK
Posts: 197
Registered: 04-20-2009

Re: Invoke a smart part as a dialog, via JavaScript

Nick, Did you ever figure out how to resize a dialog while you are already in it? Thanks

Please use plain text.