CGDevTools Forum

Welcome to the Official CGDevTools Support Community Forums.

New Event (OnBeforeOpen)

by MCarver » 18 Apr 2016 16:12

CG Gurus,

Is there any chance of getting the new event "OnBEFOREOpen" for the TIWCGJQDialogEx? I have a consistent need to fill Combo;/ DropDowns for the DialogEx, but I find that the current OnOpen event is too late, and that the Combo/DropDowns are not filled as hoped for. I consistently use the DialogEx as a grid editor, where I make the DialogEx visible with a registered CallBack event. Of course you might suggest filling these Combo/DropDowns within the CallBack. My challenge, is that I have created a single generic CallBack, which is used my nearly 30 grids, Because of this approach I am seeking an alternative way to prepare the unique requirements for each DialogEx.

Please consider adding this event.

Regards,
Monte Carver
MCarver
 
Posts: 48
Joined: 27 Sep 2013 19:15

by George » 18 Apr 2016 21:18

Hello!
Use OnCreate event or combobox.ajaxrerender after fill code.
Best regards!
George
 
Posts: 486
Joined: 23 May 2013 15:50
Location: Russia, Moscow

by MCarver » 20 Apr 2016 17:32

After pondering a few days, neither of the suggest approaches will work for my needs. Its not that filling the various comboboxes, DropDowns etc won't occur. But for speed purposes, I only want them filled WHEN a given dialog box is opened. The OnCreate and OnRender events happen regardless of whether the DialogEx is opened or not. This causes the page to render slowly..

So, again. Plz consider my request,

Regards,
Monte Carver
MCarver
 
Posts: 48
Joined: 27 Sep 2013 19:15

by Alexander Bulei » 20 Apr 2016 17:50

Hi MCarver,

I only want them filled WHEN a given dialog box is opened.


Hm...you mean when visible? if yes, so there is only one event: OnOpen

Best Regards.
Group: Developers | Support Team

  • info [at] cgdevtools.com - General information
  • sales [at] cgdevtools.com - Sales department
  • support [at] cgdevtools.com - Product and Technical Support
User avatar
Alexander Bulei
Site Admin
 
Posts: 3635
Joined: 15 May 2012 08:52
Location: Mealhada, Portugal

by MCarver » 20 Apr 2016 20:12

Alexander,

Thanks for the quick reply. Your response got me thinking. The DialogEx(s) in question are owned by a frame and set to Visible := False in the IWFrameRegionCreate event of the given frame. So, my question, is under this condition, WHY is the OnRender event firing for a given DialogEx? Is this expected? I dont have RenderInvisibleControls = True.

When I do open the DialogEx, I use the following little helper, which is called via Async.

procedure fxVisible(aControl : TIWCustomRegion; aIsVisible: boolean); overload;
begin
if aIsVisible then
begin
if CGIsCallbackProcessing then
RenderRegionAsync( aControl )
else
aControl.Visible := True;
end
else
aControl.Visible := False;
end;

Please advise,

Regards
Monte Carver
MCarver
 
Posts: 48
Joined: 27 Sep 2013 19:15

by Alexander Bulei » 21 Apr 2016 09:31

Hi MCarver,

I dont have RenderInvisibleControls = True.


Check this property in the parent of frame.
And for the dialogs, use JQDialogOptions.Open

Best Regards.
Group: Developers | Support Team

  • info [at] cgdevtools.com - General information
  • sales [at] cgdevtools.com - Sales department
  • support [at] cgdevtools.com - Product and Technical Support
User avatar
Alexander Bulei
Site Admin
 
Posts: 3635
Joined: 15 May 2012 08:52
Location: Mealhada, Portugal

by MCarver » 21 Apr 2016 21:14

As I said.. All RenderInvisibleControls are set to FALSE. As for using Open... I assume then that I want to use CLOSE as well? What should I set the MyDialogEx.Visible to?

So.. currently I am doing this. Is this the correct approach? And does opening the dialog have any bearing on my other issue (i.e. The IW Session is not processing submit)?

TMyCGFrame.IWFrameRegionCreate(Sender: TObject);
begin
...
dlgModifyMstr.JQDialogOptions.Close();
dlgModifyMstr.Visible := False;

MyAsyncEvent
dlgModifyMstr.JQDialogOptions.Open();
dlgModifyMstr.AjaxReRender();
MCarver
 
Posts: 48
Joined: 27 Sep 2013 19:15

by Alexander Bulei » 26 Apr 2016 10:03

Hi,

What should I set the MyDialogEx.Visible to?


You don't need setting the Visible property to false/true after calling the Close/Open.

Amd in async event, you don't need to call the AjaxReRender, because methods as Close/Open have async support.

Best Regards.
Group: Developers | Support Team

  • info [at] cgdevtools.com - General information
  • sales [at] cgdevtools.com - Sales department
  • support [at] cgdevtools.com - Product and Technical Support
User avatar
Alexander Bulei
Site Admin
 
Posts: 3635
Joined: 15 May 2012 08:52
Location: Mealhada, Portugal

by ScottWGast » 18 May 2016 23:13

MCarver,

I've found the same issue and have implemented a .Initialize procedure on each of my frames that will (at some point) reside on a modal TIWCGJQDialog. When I get ready to pop up the dialog, I .Initialize the frame beforehand.

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

by MCarver » 19 May 2016 16:05

Scott,

You have piqued my interest, as I am still fighting this issue. My current approach fails to properly render the CGDropDown, which leaves them empty on the first render of the Dlg.

Could you please paste some code so I can better visualize your approach?

Thank You,
Monte Carver
MCarver
 
Posts: 48
Joined: 27 Sep 2013 19:15

Next

Return to JQDialogEx

cron

Who is online

Users browsing this forum: No registered users and 1 guest

Contact Us.