Alpha Video Training
Results 1 to 6 of 6

Thread: XD: How to refresh list using external_record_content_get

  1. #1
    "Certified" Alphaholic MoGrace's Avatar
    Real Name
    Robin
    Join Date
    Mar 2006
    Location
    Los Angeles
    Posts
    3,595

    Default XD: How to refresh list using external_record_content_get

    Mike Wilson mentioned in a post that he never uses keylist_build, preferring instead table.external_record_content_get(). So I thought I would try that idea. However...I want to filter the list with a combo box variable when the user makes a new selecton and cannot figure out how to refresh the list using this function.

    Basically the idea is the user selects a Customer and the list is filtered to only show records for that customer. Sounds easy doesn't it? It works the first time, but what should I put in the change event for vCust to get the list to reinitialize the array?

    Anybody (Mike?) have an example?
    Robin

    Discernment is not needed in things that differ, but in those things that appear to be the same. - Miles Sanford

  2. #2
    "Certified" Alphaholic MoGrace's Avatar
    Real Name
    Robin
    Join Date
    Mar 2006
    Location
    Los Angeles
    Posts
    3,595

    Default Re: XD: How to refresh list using external_record_content_get

    Finian seems to have the resolution here

    He is using both keylist_build and external_record_content_get in UDF's inside the xdialog...I feel a new learning moment coming on!
    Robin

    Discernment is not needed in things that differ, but in those things that appear to be the same. - Miles Sanford

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

    Default Re: XD: How to refresh list using external_record_content_get

    Robin

    I want to filter the list with a combo box variable when the user makes a new selecton and cannot figure out how to refresh the list using this function.
    **My Simple answer is the "Passing variables "


    1) call a the list function from main function which is showing the Dialog
    2) list function which creates the List box
    3) on the event at main fuction, after changed the listbox value (assumed it is occured at from 4th function ) -- call the list fuction again

  4. #4
    "Certified" Alphaholic MoGrace's Avatar
    Real Name
    Robin
    Join Date
    Mar 2006
    Location
    Los Angeles
    Posts
    3,595

    Default Re: XD: How to refresh list using external_record_content_get

    Actually John, keylist_build was easier to use with the genie - unless you can show me an example where you were able to get the other to work in an XD?

    Which may not help me since I can't seem to adapt Finian's script for my use either!
    Robin

    Discernment is not needed in things that differ, but in those things that appear to be the same. - Miles Sanford

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

    Default Re: XD: How to refresh list using external_record_content_get

    Robin,

    Add this code and Try

    'using the table.external...

    'show the list with ui_dlg_box
    dim vSampleBox as c
    dim vSampleList as c

    'get the list
    Sub_MakeSampleList(local_variables())

    ui_dlg_box("for robin",<<%dlg%
    ListBox:;
    [%O={@@}%.50,25vSampleBox^#vSampleList];

    {region}
    <20,2Add!Add><20,2Delete!Delete><20,2Done!Done>
    {endregion};
    %dlg%,<<%code%
    If a_dlg_button ="Add" then
    'show the 3rd dlg, show the list again after added new records to table
    Temp = ui_get_text("Get Text","Enter New Value Information","","&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&")
    If Temp <> "" then
    Data = "Value=" + (tablemax("test",".T.","Value") + 1) + crlf() + "Info=" + alltrim(Temp)
    record_add("test",Data,1)
    End If
    'refresh the list
    Sub_MakeSampleList(local_variables())
    a_dlg_button =""
    end if

    If a_dlg_button ="Delete" then
    'Select the current Id and delete the record or write with <tbl> method
    'showvar(vSampleBox,"test for ID") '17 Test
    Selected_Value = word(vSampleBox,1)
    If val(vSampleBox) > 0 then
    record_delete("test","Value=" + val(Selected_Value))
    end if
    'refresh the list
    Sub_MakeSampleList(local_variables())
    a_dlg_button =""
    end if
    %code%)

    Function Sub_MakeSampleList as v (vars as p)
    with vars
    'vSampleList = table.external_record_content_get("test","padl(alltrim(str(value,2)),5,' ')+' '+space(2)+info","","")

    'it is the owner-draw
    ' vSampleList = table.external_record_content_get("test","value+'{T=0.5} '+info","","")

    'or you can do this add " {data= } "
    vSampleList = table.external_record_content_get("test","'{data='+value+'}'+value+'{T=0.5} '+info","","")
    end with
    end function

  6. #6
    "Certified" Alphaholic MoGrace's Avatar
    Real Name
    Robin
    Join Date
    Mar 2006
    Location
    Los Angeles
    Posts
    3,595

    Default Re: XD: How to refresh list using external_record_content_get

    Good grief John, does that look simpler to you?

    Let me try it in the morning when the wine has worn off...
    Robin

    Discernment is not needed in things that differ, but in those things that appear to be the same. - Miles Sanford

Similar Threads

  1. Refresh a List control
    By Medic1196 in forum Mobile & Browser Applications
    Replies: 2
    Last Post: 01-21-2015, 10:18 PM
  2. how to refresh drop down list?
    By ChilliCrab in forum Windows Desktop Applications
    Replies: 10
    Last Post: 04-07-2014, 11:45 AM
  3. List Controls will not refresh
    By Steve Workings in forum Mobile & Browser Applications
    Replies: 8
    Last Post: 02-19-2014, 12:30 AM
  4. Refresh Record List - List Box Control
    By jdrake in forum Alpha Five Version 9 - Desktop Applications
    Replies: 8
    Last Post: 08-14-2009, 08:54 PM
  5. X-Dialog Refresh Record-List List-Box
    By Louis Nickerson in forum Alpha Five Version 5
    Replies: 7
    Last Post: 02-20-2003, 07:11 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
  •