Alpha Video Training
Results 1 to 4 of 4

Thread: Embedded xDialogs

  1. #1
    "Certified" Alphaholic
    Real Name
    John Koh
    Join Date
    Jan 2004
    Location
    Maryland, USA
    Posts
    1,084

    Default Embedded xDialogs

    Hi

    How do you refer the variables between the two or more Embedded xDialogs?

    I want to have this action; changing the Left side of the Embedded xDailog( xDialog7) then the variables will be shown at right side of the Embedded xDialog ( xDialog1 ).


    Embedded_xdialog.jpg Embedded_View.jpg

  2. #2
    "Certified" Alphaholic Tom Henkel's Avatar
    Real Name
    Tom Henkel
    Join Date
    May 2002
    Location
    New Jersey, USA
    Posts
    1,875

    Default Re: Embedded xDialogs

    make the variables GLOBAL, then they can be seen by anything in the database until you close it.

    Tom

  3. #3
    "Certified" Alphaholic
    Real Name
    John Koh
    Join Date
    Jan 2004
    Location
    Maryland, USA
    Posts
    1,084

    Default Re: Embedded xDialogs

    Tom,

    Thank you and This is my scripts and I am not sure that I am on right way or not.

    xDialog script 1

    Code:
    'Put code here to DIM any variables used in your Xdialog.
    
    'Make a global_variable
    dim gv as p
    gv = global_variables()
    
    
    dim vParent as c
    dim vChilName as c
    dim vDate as d
    with gv
    
    'IMPORTANT: Do not change the dialog title. Place dialog content here...
    ui_modeless_dlg_box(dlgTitle,<<%dlg%
    {background=<Transparent>}
    {startup=init}
    {frame=1}
    {region}
    Date;| [.20vDate!Name_*];
    Name Send to child:| [.25vParent!Name_*];
    
    not share any more;
    Name get from child:| [%R%.25gv.vChildName];
    
    {endregion};
    {lf};
    
    %dlg%,<<%code%
    'Place code here for your event handlers...
    
    if left(a_dlg_button,4) = "Name" then
        if a_dlg_button ="Name_Change" then
        	ui_modeless_dlg_refresh(":Share:xdialog1")
            gv.vParent = vParent
            gv.vdate = vDate
           ui_modeless_dlg_refresh(":Share:xdialog3")
        end if
        a_dlg_button = ""
    end if
    
    %code%)	
    
    end with
    xDialog Script 2

    Code:
    'Put code here to DIM any variables used in your Xdialog.
    dim vChildName as c =""
    'Set a Global Variable containing the	
    dim gv as p
      gv = global_variables()
    with gv
    	gv.vparent = vParent
    	gv.vdate = vDate
    
    'IMPORTANT: Do not change the dialog title. Place dialog content here...
    ui_modeless_dlg_box(dlgTitle,<<%dlg%
                    {background=<Transparent>}		
    		{wrap=60}
    		This is an embedded dialog box that responds to the xDialog event sent to it from its parent. and receive from parent;
    		{lf};
    		Name for Child:; 
    		  [.50vChildName!vName_changed];
    		Name get From Parent:; 
    		  [%R%.50gv.vParent];
    		Record Date:| [.20gv.vDate];  
    		{lf};
    		Enter a name into the Name field and,  After  second, the "Parent" dialog box will be shown the child Name.;
    		{lf};
    		
    		%dlg%,<<%code%
    		'Place code here for your event handlers...
    		
    		if a_dlg_button ="vName_changed" then
    		    a_dlg_button =""
    		    ui_modeless_dlg_refresh(":share:xdialog3")
    		    gv.vChildName = vChildName
    		    gv.vDate = vDate
    		    ui_modeless_dlg_refresh(":share:xdialog1")
    		end if
    		
    		%code%)
                     end with
    Tom,
    It was fired fine until closed the A5. After open again I kept getting an error message and attached the screen shot here.

    If you can find an error or better way to write, please let me know.

    Thank you again

    Global_Run_error.jpg
    Last edited by johnkoh; 07-17-2012 at 07:38 PM. Reason: attachment location

  4. #4
    "Certified" Alphaholic Tom Henkel's Avatar
    Real Name
    Tom Henkel
    Join Date
    May 2002
    Location
    New Jersey, USA
    Posts
    1,875

    Default Re: Embedded xDialogs

    John,

    When you dim vParent, just dim it as :
    DIM GLOBAL vParent as C
    I have a feeling that somewhere along the way, your variable scope is getting confused.
    Others may argue, but I don't set a pointer to the different variable spaces. It just confuses me.

    Define your variabls as global in both scripts and just use the variable as defined. That should work.

    Code:
    'Put code here to DIM any variables used in your Xdialog.
    
    'Make a global_variable
    
    dim GLOBAL vParent as c
    dim GLOBAL vChilName as c 
    dim GLOBAL vDate as d
    
    
    'IMPORTANT: Do not change the dialog title. Place dialog content here...
    ui_modeless_dlg_box(dlgTitle,<<%dlg%
    {background=<Transparent>}
    {startup=init}
    {frame=1}
    {region}
    Date;| [.20vDate!Name_*];
    Name Send to child:| [.25vParent!Name_*];
    
    not share any more;
    Name get from child:| [%R%.25gv.vChildName];
    
    {endregion};
    {lf};
    
    %dlg%,<<%code%
    'Place code here for your event handlers...
    
    if left(a_dlg_button,4) = "Name" then
        if a_dlg_button ="Name_Change" then
        	ui_modeless_dlg_refresh(":Share:xdialog1")
           ui_modeless_dlg_refresh(":Share:xdialog3")
        end if
        a_dlg_button = ""
    end if
    
    %code%)
    Code:
    'Put code here to DIM any variables used in your Xdialog.
    dim GLOBAL vChildName as C
    'Set a Global Variable containing the	
    dim GLOBAL vParent as C
    dim GLOBAL vDate as D
    
    'IMPORTANT: Do not change the dialog title. Place dialog content here...
    ui_modeless_dlg_box(dlgTitle,<<%dlg%
                    {background=<Transparent>}		
    		{wrap=60}
    		This is an embedded dialog box that responds to the xDialog event sent to it from its parent. and receive from parent;
    		{lf};
    		Name for Child:; 
    		  [.50vChildName!vName_changed];
    		Name get From Parent:; 
    		  [%R%.50gv.vParent];
    		Record Date:| [.20gv.vDate];  
    		{lf};
    		Enter a name into the Name field and,  After  second, the "Parent" dialog box will be shown the child Name.;
    		{lf};
    		
    		%dlg%,<<%code%
    		'Place code here for your event handlers...
    		
    		if a_dlg_button ="vName_changed" then
    		    a_dlg_button =""
    		    ui_modeless_dlg_refresh(":share:xdialog3")
    		    ui_modeless_dlg_refresh(":share:xdialog1")
    		end if
    		
    		%code%)
    The variables are defined in Both scripts as global, so there shouldn't be any confusion.

    Tom

Similar Threads

  1. desktop embedded grid xdialogs
    By JohnZaleski in forum Archived Wishlist
    Replies: 0
    Last Post: 02-05-2010, 11:51 AM
  2. xdialogs in V9
    By JH10 in forum Application Server Version 9 - Web/Browser Applications
    Replies: 2
    Last Post: 10-04-2009, 01:37 PM
  3. Forms vs xDialogs
    By forskare in forum Alpha Five Version 9 - Desktop Applications
    Replies: 11
    Last Post: 03-09-2008, 06:31 PM
  4. xdialogs and entry
    By DaveM in forum Alpha Five Version 7
    Replies: 5
    Last Post: 02-04-2008, 11:17 AM
  5. Modal vs. Modeless Xdialogs
    By Tom Cone Jr in forum Alpha Five Version 7
    Replies: 2
    Last Post: 08-14-2006, 12:00 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •