CGDevTools Forum

Welcome to the Official CGDevTools Support Community Forums.

IW12.2.4: Modal dialogs (trying to duplicate functionality in your demo)

General discussion

by Jorge Sousa » 27 Jul 2012 21:27

Error confirmed

Checking what has changed in Intraweb's

This is going to take a while

Regards
Best Regards
CGDevTools Develop / Support Team
Home Page: http://www.cgdevtools.com
Jorge Sousa
 
Posts: 4261
Joined: 17 May 2012 09:58

by ScottWGast » 27 Jul 2012 22:08

Thank you for confirming the error :)

Really looking forward to the OnLinkClick event!

Thanks,
Scott
ScottWGast
 
Posts: 875
Joined: 23 May 2012 11:02

by ScottWGast » 28 Jul 2012 16:49

Oh... something else that I've figured out: If I create two buttons on the dialog form at design time and assign a stub OnClick event, I am then able to re-asssign the OnClick event at run time. This enables me to utilize a single dialog for multiple purposes. What's odd, though, is that I am unable to change the button caption.

Anyway, thanks!
Scott
ScottWGast
 
Posts: 875
Joined: 23 May 2012 11:02

by Jorge Sousa » 28 Jul 2012 21:14

Hello

Confirmed, we have mistype javascript conversion, in JQDialogOptions.Buttons[].Text property, when in an ajax event handler, it will be fixed for next release.

for now, as an workaround please code this in your ajax event:

uses
IWCGJSSuperObject, IWCGJQCommon;

procedure TIWForm2.IWCGJQDialog1JQDialogOptionsButtons0Click(Sender: TObject; AParams: TStringList);
var
ButtonsJSon: ISuperObject;
js: string;
begin
IWCGJQDialog1.JQDialogOptions.Title:= 'My Title'; // This Works

IWCGJQDialog1.JQDialogOptions.Buttons[0].Text:= 'My Text'; // This is not working for now, due to a mistype

// So please add this to you code this is what you missed to include in our code
ButtonsJSon:= IWCGJQDialog1.JQDialogOptions.Buttons.JSon;
js:= IWCGJQDialog1.GetIDJQuery + format('.dialog("option","buttons",%s)',[ButtonsJSon.AsJSonp]);
CGAddJavaScriptToAjaxResponse(js);
end;


Bur for documentation purposes, please allow me to explain some features of our suited, related to browser jQuery Plugins and CGJQComponents interation.

A brief expalanation on how jQuery Objects work and how our comps core works with them.

And how the interaction between jQuery Objects and IWCGJQ is done.

It's important that we could explain.

Ok, jQuery objects work all the same way

1- They have options , an js object, with set of properties to setup the plugin.

2- An js initialization code where the options are applied to the jQ object,

This init code is executed in the jQuery onReady, that is immediately after the DOM loading, before the document OnLoad.

like

$function({ // onReady
$("#IWCGJQDIALOG1").dialog({title:"MyTitle"}); // This is equivalent to code IWCGJQDialog1.JQDialogOptions.Title:= 'MyTitile'; in Delphi
}

3 - Most of them jQuery have methods, called the "Client API" of the plugin, to perform client actions, like closing a dialog, fi.

Our components always implement the Client API, and its correspondency is on JQOptions classes, like

IWCGJQDialog1.JQDialogOptions.Close , .MoveToTop etc...

For instance, for Dialog, the methods available in

http://jqueryui.com/demos/dialog/#method-option

Tab Methods

are all available in our

IWCGJQDialog1.JQDialogOptions (TIWCGJQDialogOptions) class

When the methtod IWCGJQDialog.JQDialogOptions.Close is called in Delphi

it will generate the script

$("#IWJQDIALOG1").dialog("close")

If this method is called in response to an Ajax Event

The javascript will be added to the ajax XML to be executed when back to browser.

If is in a rendering stage or in a submit event

it will add the script to browser document onLoad

4- There is a kind of jQ plugin methods, called "setters"

For jqDialog is

.dalog("option","optionname",optionvalue)

that allows to change the options, and like component properties in Delphi, they perform internal actions to effectivate the change.

In our suite components, in the Option Classes, like JQDialogOptions,

when the properties are changed in an ajax event

also generate the setter script, if available for the plugin,

For instance, if in ajax event, if we add to code:

IWCGJQDialog1.JQGDialogOptions.Title:= 'Some Other Title';

it will generate the script

$("#IWCGJQDIALOG1").("option","title","Some Other Title")

to be executed when the ajax request back to server.

But, and this is IMPORTANT, there are some options that are simply ignored by the jQ plugin, because for that option, the plugin does not support the change.

And there are some plugins, we use a few, that have only a simple API or no API at all, incliuding the setter methods.

Our hope, is to be able to increase the contribuition and support for these awesome jQuery plugin developers that we are working with, and somehow promoting as well, in order to contribute for to the improvement of the plugins themeselves.

For now, we are very happy to what we have achieved, in these almost 2 months alive :). We're doing a very serious and hard honest job here, this 20+ old software house rocks, and some thousands of happy customers can really testify :)

Nice weekends for all future readers and Best Regards

cgdevtools
Best Regards
CGDevTools Develop / Support Team
Home Page: http://www.cgdevtools.com
Jorge Sousa
 
Posts: 4261
Joined: 17 May 2012 09:58

by Jorge Sousa » 07 Aug 2012 23:33

About
"is that I am unable to change the button caption."

It's now fixed in version 1.0.929

About RenderRegionAsync

it's answered in

http://www.cgdevtools.com/forum/general/iw12-2-4-cgjqgrid-how-do-i-set-an-event-when-a-cell-is-clicked-and-other-grid-questions/
Best Regards
CGDevTools Develop / Support Team
Home Page: http://www.cgdevtools.com
Jorge Sousa
 
Posts: 4261
Joined: 17 May 2012 09:58

Previous

Return to General - Archive

Who is online

Users browsing this forum: No registered users and 1 guest

Contact Us.