Alpha Video Training
Results 1 to 9 of 9

Thread: Combing two Xdialog Boxes

  1. #1
    Member Graham Wickens's Avatar
    Real Name
    Graham Wickens
    Join Date
    Apr 2000
    Location
    Gloucestershire, UK
    Posts
    732

    Default Combing two Xdialog Boxes

    I am working on a dialog that asks for a field name in a defined table and then a value from that field:

    DIM SHARED vFieldName as c
    DIM SHARED varC_result as C
    DIM SHARED vFieldValue as C
    DIM vFieldValue_rl_def as C

    varC_result = ui_dlg_box("Field Selection",<<%dlg%
    {region}
    Name:| [%p=ui_get_fieldname("base_details","VFieldName");I=$a5_smart_field%.40vFieldName];
    {endregion};
    {line=1,0};
    {region}
    <15OK!OK> <15Cancel!CANCEL>
    {endregion};
    %dlg%)
    VFieldValue_rl_def = "k=base_details,{keylist_build("H=.05,1:25,2:25",''+"+vFieldName+",left(''+"+vFieldName+",25),left(''+"+vFieldName+",25))}{}"
    varC_result = ui_dlg_box("@="+vFieldName,<<%dlg%
    {region}
    Entry:| [%@VFieldValue_rl_def%.40VFieldValue];
    {endregion};
    {line=1,0};
    {region}
    <15OK!OK> <15Cancel!CANCEL>
    {endregion};
    %dlg%)
    I can get it to work using the two example xdialogs as above. Is it possible to combine both in one Dialog? If so, how is it done?
    been away from coding for a while so am very rusty :)
    --
    Support your local Search and Rescue Unit, Get Lost!

    www.westrowops.co.uk

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

    Default Re: Combing two Xdialog Boxes

    Graham,

    Is the second dlg working xdlg?
    VFieldValue_rl_def = "k=base_details,{keylist_build("H=.05,1:25,2:25",''+"+vFieldName+",left(''+"+vFieldName+",25),left(''+"+vFieldName+",25))}{}"
    varC_result = ui_dlg_box("@="+vFieldName,<<%dlg%
    {region}
    Entry:| [%@VFieldValue_rl_def%.40VFieldValue];
    {endregion};
    {line=1,0};
    {region}
    <15OK!OK> <15Cancel!CANCEL>
    {endregion};
    %dlg%)

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

    Default Re: Combing two Xdialog Boxes

    Graham,

    I did this way.
    Code:
    'Create an XDialog dialog box to prompt for parameters.
    DIM SHARED vOption as C
    DIM SHARED vddwn as C
    DIM SHARED vddwn2 as C
    DIM SHARED varC_result as C
    ok_button_label = "&OK"
    cancel_button_label = "&Cancel"
    
    DIM vddwn_rl_def as C 
    '// created with action_script and arranged it
    'vddwn_rl_def = "k=base_details,{keylist_build(\"H=.05,1:25[Base]\",''+base,left(''+base,25))}{}"
    'DIM vddwn2_rl_def as C 
    'vddwn2_rl_def = "k=base_details,{keylist_build(\"H=.05,1:25[Unique]\",''+unique,left(''+unique,25))}{}"
    
    
    vOption ="base"
    if vOption ="base" then
    	vddwn_rl_def = "k=base_details,{keylist_build(\"H=.05,1:25[Base]\",''+base,left(''+base,25))}{}"
    else
    	vddwn_rl_def = "k=base_details,{keylist_build(\"H=.05,1:25[Unique]\",''+unique,left(''+unique,25))}{}"
    end if
    
    varC_result = ui_dlg_box("select value",<<%dlg%
    {region}
    {region}List option:{endregion}|
    {region}
    (vOption:base!vOpt_changed);
    (vOption:unique!vOpt_changed);
    {endregion};
    ;
    {endregion};
    
    {region}
    select one:| [%@vddwn_rl_def%.40vddwn];
    
    {endregion};
    {line=1,0};
    {region}
    <*15=ok_button_label!OK> <15=cancel_button_label!CANCEL>
    {endregion};
    %dlg%,<<%code%
    if a_dlg_button ="vOpt_changed" then
    	if vOption ="base" then
    		vddwn_rl_def = "k=base_details,{keylist_build(\"H=.05,1:25[Base]\",''+base,left(''+base,25))}{}"
    	else
    		vddwn_rl_def = "k=base_details,{keylist_build(\"H=.05,1:25[Unique]\",''+unique,left(''+unique,25))}{}"
    	end if
    	vddwn_rl_def = replace_parameters(vddwn_rl_def,local_variables())
    	a_dlg_button =""
    end if
    %code%)
    you have missed "\" in your second dlg code.
    see this example.
    Code:
    vddwn_rl_def = "k=base_details,{keylist_build(\"H=.05,1:25[Unique]\",''+unique,left(''+unique,25))}{}"

  4. #4
    Member Graham Wickens's Avatar
    Real Name
    Graham Wickens
    Join Date
    Apr 2000
    Location
    Gloucestershire, UK
    Posts
    732

    Default Re: Combing two Xdialog Boxes

    Quote Originally Posted by johnkoh View Post
    Graham,

    Is the second dlg working xdlg?
    Yes
    --
    Support your local Search and Rescue Unit, Get Lost!

    www.westrowops.co.uk

  5. #5
    Member Graham Wickens's Avatar
    Real Name
    Graham Wickens
    Join Date
    Apr 2000
    Location
    Gloucestershire, UK
    Posts
    732

    Default Re: Combing two Xdialog Boxes

    I can see that that works, but it gets complicated when there are 16 fields to choose from!
    --
    Support your local Search and Rescue Unit, Get Lost!

    www.westrowops.co.uk

  6. #6
    Member Graham Wickens's Avatar
    Real Name
    Graham Wickens
    Join Date
    Apr 2000
    Location
    Gloucestershire, UK
    Posts
    732

    Default Re: Combing two Xdialog Boxes

    Thanks John,
    your code pointed me in the correction direction:

    DIM SHARED vFieldList as C
    DIM shared vFieldValue as C
    DIM SHARED varC_result as C
    vFieldValue_def = "k=base_details,{keylist_build("H=.05,1:25[]",''+"-vFieldList-",left(''+"-vFieldList-",25))}{unique_key_value()}"
    varC_result = ui_dlg_box("Select From Following Fields",<<%dlg%
    {Background=#0+204+255}
    {region}
    {region}List:{endregion}|
    {region}(VFieldList:Ati_Code!vFieldList_changed);
    (VFieldList:Base!vFieldList_changed);
    (VFieldList:C1!vFieldList_changed);
    (VFieldList:Country!vFieldList_changed);
    (VFieldList:County_Name!vFieldList_changed);
    (VFieldList:District_Name!vFieldList_changed);
    (VFieldList:Faa_Code!vFieldList_changed);
    (VFieldList:Iata_Code!vFieldList_changed);
    (VFieldList:Icao_Code!vFieldList_changed);
    (VFieldList:Old_Code!vFieldList_changed);
    (VFieldList:Other_Code!vFieldList_changed);
    (VFieldList:Other_Name!vFieldList_changed);
    (VFieldList:Place_Name!vFieldList_changed);
    (VFieldList:Province_Name!vFieldList_changed);
    (VFieldList:Region_Name!vFieldList_changed);
    (VFieldList:User1!vFieldList_changed);{endregion};
    ;
    {endregion};
    {line=1,0};
    Value:| [%@vFieldValue_def%.40vFieldValue];
    {region};
    <*15OK!OK> <15Cancel!CANCEL>
    {endregion};
    %dlg%,<<%code%
    if a_dlg_button ="vFieldList_changed" then
    vFieldValue_def = "k=base_details,{keylist_build("H=.05,1:40["-VfieldList-"]",''+"-vFieldlist-",left(''+"-vFieldList-",40))}{unique_key_value()}"
    vFieldValue_def = replace_parameters(vFieldValue_def,local_variables())
    a_dlg_button =""
    end if
    %code%)
    ui_msg_box("test",vFieldList-"="-vFieldValue)
    --
    Support your local Search and Rescue Unit, Get Lost!

    www.westrowops.co.uk

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

    Default Re: Combing two Xdialog Boxes

    this and see the event (If a_dlg_button ="vfield_changed" then)

    Code:
    varC_result = ui_dlg_box("Field Selection",<<%dlg%
    {region}
    Name:| [%p=ui_get_fieldname("base_details","VFieldName");I=$a5_smart_field%.40vFieldName!vfield_changed];
    {endregion};
    
    {region}
    Entry:| [%@VFieldValue_rl_def%.40VFieldValue];
    {endregion};
    
    {line=1,0};
    {region}
    <15OK!OK> <15Cancel!CANCEL>
    {endregion};
    %dlg%,<<%code%
    If a_dlg_button ="vfield_changed" then
    	VFieldValue_rl_def = ""
    	VFieldValue_rl_def = "k=base_details,{keylist_build(\"H=.05,1:25,2:25\",''+"+vFieldName+",left(''+"+vFieldName+",25),left(''+"+vFieldName+",25))}{}"	
    	vFieldValue_rl_def = replace_parameters(vFieldValue_rl_def,local_variables())
    	a_dlg_button =""
    end if
    %code%)
    
    end

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

    Default Re: Combing two Xdialog Boxes

    Another sample. Drop down box instead of radio buttons;

    Code:
    Ddwnfield_list=<<%str%
    Ati_Code
    Base
    C1
    Country
    County_Name
    District_Name
    Faa_Code
    Iata_Code
    Icao_Code
    Old_Code
    Other_Code
    Other_Name
    Place_Name
    Province_Name
    Region_Name
    User1
    unique
    %str%
    
    'you can get the field value instead of type it
    
    DIM SHARED vFieldName as c
    DIM SHARED varC_result as C
    DIM SHARED vFieldValue as C
    DIM vFieldValue_rl_def as C 
    
    varC_result = ui_dlg_box("Field Selection",<<%dlg%
    {region}
    Name:| [%p=ui_get_fieldname("base_details","VFieldName");I=$a5_smart_field%.40vFieldName];
    
    **** | apply dropdown box instead of radio;
    Name:| [.36.5vfieldName^=Ddwnfield_list!vfield_changed];
    {endregion};
    
    {region}
    Entry:| [%@VFieldValue_rl_def%.40VFieldValue];
    {endregion};
    
    {line=1,0};
    {region}
    <15OK!OK> <15Cancel!CANCEL>
    {endregion};
    %dlg%,<<%code%
    If a_dlg_button ="vfield_changed" then
    	vFieldName = vFieldName
    	VFieldValue_rl_def = ""
    	VFieldValue_rl_def = "k=base_details,{keylist_build(\"H=.05,1:25,2:25\",''+"+vFieldName+",left(''+"+vFieldName+",25),left(''+"+vFieldName+",25))}{}"	
    	vFieldValue_rl_def = replace_parameters(vFieldValue_rl_def,local_variables())
    	a_dlg_button =""
    end if
    %code%)
    
    end

  9. #9
    Member Graham Wickens's Avatar
    Real Name
    Graham Wickens
    Join Date
    Apr 2000
    Location
    Gloucestershire, UK
    Posts
    732

    Default Re: Combing two Xdialog Boxes

    Ha!
    just got there myself !!

    thanks again for input.
    --
    Support your local Search and Rescue Unit, Get Lost!

    www.westrowops.co.uk

Similar Threads

  1. questions about xdialog boxes
    By Reva in forum Alpha Five Version 7
    Replies: 10
    Last Post: 09-02-2006, 03:03 PM
  2. how to close xdialog boxes
    By martinwcole in forum Alpha Five Version 6
    Replies: 2
    Last Post: 10-15-2005, 11:12 PM
  3. XDialog Boxes - Conference AVI
    By dik_coleman in forum Alpha Five Version 5
    Replies: 6
    Last Post: 07-23-2004, 09:03 AM
  4. Xdialog boxes
    By NBGH in forum Alpha Five Version 5
    Replies: 3
    Last Post: 12-11-2002, 02:42 PM
  5. Dynamic (filtered) List Boxes in Xdialog Boxes
    By Selwyn Rabins in forum Alpha Five Version 5
    Replies: 6
    Last Post: 11-11-2002, 01:26 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
  •