Alpha Video Training
Results 1 to 11 of 11

Thread: Dialog Question

  1. #1
    BRIAN GRAY
    Guest

    Default Dialog Question

    Hello,

    I have a dialog genie that enters new records into a table.
    Everything works great but I am now trying to add a new feature and would like a little help. I have added a new button to the genie where the user will be able to enter another record for the same client (The button will first enter the current record and then recall the same genie to be able to enter another record)

    It enters the current record currectly but when it calls the genie again it does not close the first instance first so the second instance is displayed on top of the first.
    The second instance is displaying the genie with blank pages they are stuck with the first instance.

    Hope this makes sense what i need is a command to close the dialog before the second is called.

    Thanks Brian

  2. #2
    Alpha Software Employee Lenny Forziati's Avatar
    Real Name
    Lenny Forziati
    Join Date
    Nov 2001
    Location
    Alpha Software
    Posts
    4,680

    Default RE: Dialog Question

    What type of Xdialog are you using? For a modeless dialog, you use ui_modeless_dlg_close("your dialog name"), for a modal dialog, simply don't set a_dlg_button to "".

    -Lenny

  3. #3
    BRIAN GRAY
    Guest

    Default RE: Dialog Question

    Hello Lenny,

    Thanks for replying the dialog in question is a modal.
    The script does not contain a_dlg_button = ""

    Below is part of the script

    if a_dlg_button = "&AdditionalWork" then
    dim tbl as p
    dim Customer_Id as c

    tbl = table.open("job description",FILE_RW_SHARED)
    tbl.enter_begin()
    tbl.Customer_id = CID
    tbl.Job = tow
    tbl.Frequency = frequency
    tbl.Intial_charge = vinitialprice
    tbl.Charge = vsprice
    tbl.Intial_cleaning_date = vic
    tbl.Last_cleaning_date = vlc
    tbl.Next_cleaning_date = vnc
    tbl.Comments = vcomments
    tbl.enter_end(.t.)
    tbl.close()

    'Run script locally (using local variables): Enter New Job
    script_play_local("Enter New Job")
    end if

    Thanks again for replying

    Brian

  4. #4
    BRIAN GRAY
    Guest

    Default RE: Dialog Question

    No other Ideas??????

  5. #5
    Former Alpha Employee Edward Larrabee's Avatar
    Real Name
    Edward Larrabee
    Join Date
    Nov 2002
    Location
    New Hampshire
    Posts
    1,385

    Default RE: Dialog Question

    Brian,

    Did you create the dialog box using Action Scripting?

  6. #6
    "Certified" Alphaholic Scott Emerick's Avatar
    Real Name
    Scott Emerick
    Join Date
    Dec 2000
    Location
    Central Virginia/ North Carolina Border
    Posts
    2,154

    Default RE: Dialog Question

    Brian,

    Might I suggest leaving the dialog opened and just reset your variables and do a ui_dlg_refresh()after you write to the table.

    Scott

  7. #7
    Alpha Software Employee Lenny Forziati's Avatar
    Real Name
    Lenny Forziati
    Join Date
    Nov 2001
    Location
    Alpha Software
    Posts
    4,680

    Default RE: Dialog Question

    The first dialog does not close because of the line script_play_local("Enter New Job"). Until your script "Enter New Job" has completed, the dialog will not close. You should notice that if you close the second dialog, both will close.

    Scott's suggestion would be the best way to handle your dialog. Otherwise you should expect unpredictable results as script_play_lopcal will open your second dialog using the same variable namespace so both dialogs will actually have the exact same variable values.

    -Lenny

  8. #8
    BRIAN GRAY
    Guest

    Default RE: Dialog Question

    Thanks Scott

    I will try to see what happens will let you know

    Brian

  9. #9
    BRIAN GRAY
    Guest

    Default RE: Dialog Question

    Hello,

    Well I've tried ui_dlg_refresh() and all it seems to do is close the dlg????????? You mentioned to reset the varables the refresh is supposed to do that correct?? Anyway any more ideas Thanks

    Brian

  10. #10
    Alpha Software Employee Lenny Forziati's Avatar
    Real Name
    Lenny Forziati
    Join Date
    Nov 2001
    Location
    Alpha Software
    Posts
    4,680

    Default RE: Dialog Question

    All of your dialog actions will need a_dlg_button = "" in them or they will cause the dialog to close.

    -Lenny

  11. #11
    BRIAN GRAY
    Guest

    Default RE: Dialog Question

    Hello,

    I have figured out how to reset most of the variables and refresh the dialog But i am having troble reseting the smart fields on the dialog I have a calendar popup and a calculator popup.

    Everyway I've tried i keep getting variable mismatch

    I'm getting real close

    Thanks again Brian

Similar Threads

  1. Dialog Question
    By BRIAN GRAY in forum Alpha Five Version 5
    Replies: 3
    Last Post: 06-15-2003, 04:55 PM
  2. Dialog question
    By BRIAN GRAY in forum Alpha Five Version 5
    Replies: 4
    Last Post: 06-09-2003, 07:48 AM
  3. X-Dialog Question
    By Louis Nickerson in forum Alpha Five Version 5
    Replies: 7
    Last Post: 02-17-2003, 07:54 AM
  4. X-Dialog Question
    By Louis Nickerson in forum Alpha Five Version 5
    Replies: 7
    Last Post: 12-13-2002, 02:18 AM
  5. X-Dialog Question
    By Louis Nickerson in forum Alpha Five Version 5
    Replies: 2
    Last Post: 12-02-2002, 08:44 PM

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
  •