Alpha Video Training
Results 1 to 9 of 9

Thread: Refresh Record List - List Box Control

  1. #1
    Member
    Real Name
    Jay
    Join Date
    Jun 2008
    Location
    Detroit, Michigan
    Posts
    159

    Default Refresh Record List - List Box Control

    How do I refresh data in a Record List - List Box Control that is inside of an Xdialog.

    I see that there is an option to watch a variable when you place this object on a form but not in an Xdialog.

    I can't seem to figure out the Xbasic they are using to do this.

  2. #2
    "Certified" Alphaholic
    Real Name
    David Kates
    Join Date
    Apr 2008
    Location
    Unionville, ON
    Posts
    7,623

    Default Re: Refresh Record List - List Box Control

    I can't see how to do this either since a refresh doesn't seem to work. This is an embedded Xdialog Record-List List box supercontrol?

    This is from Selwyn, back in 2004...

    "I have spent quite a bit of time looking at your script.

    Basically the problem is that you are using a Record_list-List box to display the data. The problem is that there is no way that I know of to tell the record-list list box that the underlying table has changed.

    I suggest that instead of using a record-list list box, that you use a regular list box. The you have full control over populating the list box, and then, when your script that adds a new entry to the table is completed, you can write the xbasic that repopulates the listbox."

    I've searched the related forum messages and it seems there hasn't been much luck in doing this.

  3. #3
    Member
    Real Name
    Jay
    Join Date
    Jun 2008
    Location
    Detroit, Michigan
    Posts
    159

    Default Re: Refresh Record List - List Box Control

    Yes this is in an xDialog.

    I've used regular text boxes in the past and Sewlyn is correct. Its easy to use xBasic to change the data.

    But in this case, I was looking to use a nicely formatted multi-column text box, so I chose a Record List - List Box.

    I was just curious since there is a way to do it when it is embedded in a form.

  4. #4
    "Certified" Alphaholic Mike Wilson's Avatar
    Real Name
    mike wilson
    Join Date
    Apr 2005
    Location
    Grand Rapids, Michigan
    Posts
    4,183

    Default Re: Refresh Record List - List Box Control

    I guess I don't understand the question and issue. A record list-list box populated automatically from the values of a table is an instantaneous snapshot of the values in the table in columnar fashion within a modal object. No action can proceed until that xdialog is closed. So what change in the table is expected? On a network? You could put a button on the xdialog for the user to execute a refresh (see attached).

    A bit ago I had a script that Dr. Wayne and others on this board were going through that refreshed a modeless dialog. I'll see if I can find it and see what can be done with that, some.
    Mike W
    __________________________
    "I rebel in at least small things to express to the world that I have not completely surrendered"

  5. #5
    Member
    Real Name
    Jay
    Join Date
    Jun 2008
    Location
    Detroit, Michigan
    Posts
    159

    Default Re: Refresh Record List - List Box Control

    It looks like this will work.

    Basically it is just closing the xdialog and reopening it.

    The reason I need to refresh it is becasue they are removing items from the table using the Record List - List Box. So I needed to refresh the data when they remove that item.

  6. #6
    "Certified" Alphaholic
    Real Name
    Mike Christensen
    Join Date
    Nov 2005
    Location
    Michigan U.P.
    Posts
    5,937

    Default Re: Refresh Record List - List Box Control

    I will do a bit of looking also as I would like to refresh a multi-select checkbox xdialog...without having to close and reopen it.



    LATER: no luck in finding anything. Came close experimenting but nothing yet. Hopefully Mike has better luck (expertise) than I.
    Last edited by MikeC; 08-14-2009 at 01:05 PM.
    Mike
    __________________________________________
    It is only when we forget all our learning that we begin to know.
    It's not what you look at that matters, it's what you see.
    Henry David Thoreau
    __________________________________________




  7. #7
    "Certified" Alphaholic
    Real Name
    David Kates
    Join Date
    Apr 2008
    Location
    Unionville, ON
    Posts
    7,623

    Default Re: Refresh Record List - List Box Control

    Quote Originally Posted by jdrake View Post
    I was just curious since there is a way to do it when it is embedded in a form.
    How is it done when embedded in a form... that's how I first thought you were using it. I didn't have any luck doing that so would love to know.

  8. #8
    "Certified" Alphaholic
    Real Name
    David Kates
    Join Date
    Apr 2008
    Location
    Unionville, ON
    Posts
    7,623

    Default Re: Refresh Record List - List Box Control

    Just a little bit confused still... are you using an embedded xdialog record-list list box... or a popup xdialog record-list list box?

    If you're using a popup xdialog then here's how to create a modeless xdialog record-list list box and allow a user to delete an item and have the xdialog refresh the list. Basically you're deleting the record, rebuilding the keylist and refreshing the xdialog.

    The credit goes to Jerry Brightbill, Alpha5, from a 2003 post.

    Code:
    'Create an XDialog dialog box to prompt for parameters.
    DIM SHARED varList as C
    DIM SHARED varC_result as C
    ok_button_label = "&OK"
    cancel_button_label = "&Cancel"
    delete_button_label = "&Delete"
    DIM varList_rl_def as C 
    dim tbl as P
    dim indx_1 as P
    
    varList_rl_def = "kl=tblcategories,{keylist_build(\"H=.05,1:25[Category]\",''+Category,left(''+Category,25))}{}"
    'varC_result = ui_dlg_box("Category List",<<%dlg%
    varc_result = ui_modeless_dlg_box("Category List",<<%dlg%
    {can_exit=ok}
    {region}
    Type prompt here:| [%@varList_rl_def%.40,5varList];
    {endregion};
    {line=1,0};
    {region}
    <*15=ok_button_label!OK> <15=cancel_button_label!CANCEL> <15=delete_button_label!DELETE>
    {endregion};
    %dlg%,<<%code%
    IF a_dlg_button = "DELETE" then
        'ui_msg_box("Category Delete", varList)
    	tbl = table.open("tblCategories")
    	indx_1 = tbl.index_primary_put("Category")
    	tbl.fetch_find(varList)
    	tbl.change_begin()
    	tbl.delete()
    	tbl.change_end(.t.)
    	tbl.close()
        varList_rl_def = "kl=tblcategories,{keylist_build(\"H=.05,1:25[Category]\",''+Category,left(''+Category,25))}{}"
        ui_modeless_dlg_refresh("Category List")
    end if
    IF a_dlg_button = "OK" then
        ui_modeless_dlg_close("Category List")
    end if
    %code%)

  9. #9
    "Certified" Alphaholic
    Real Name
    Mike Christensen
    Join Date
    Nov 2005
    Location
    Michigan U.P.
    Posts
    5,937

    Default Re: Refresh Record List - List Box Control

    I found 2 functions that, by rights, should refresh a modal xdialog...but cannot get them to work. The UI_DLG_REFRESH_TARGETED() function takes a crlf variable representing one or more controls as its second argument. Maybe I am not recognizing what a control is?? I would think the control would be say this:
    Code:
    [%d;O={@@}%.160,20Sel_Comp^$$a_Sel_Comp]
    http://support.alphasoftware.com/alp...TARGETED().htm

    http://support.alphasoftware.com/alp..._REFRESH().htm

    If anyone has used either of these two functions with success, please advise.
    Mike
    __________________________________________
    It is only when we forget all our learning that we begin to know.
    It's not what you look at that matters, it's what you see.
    Henry David Thoreau
    __________________________________________




Similar Threads

  1. Record-List List Box With Active Link
    By mspearman in forum Application Server Version 9 - Web/Browser Applications
    Replies: 2
    Last Post: 08-02-2009, 01:42 PM
  2. Xdialog Record List vs. List View Control
    By Jason in forum Alpha Five Version 7
    Replies: 1
    Last Post: 02-20-2006, 09:34 PM
  3. record list list box variable transfer
    By dik_coleman in forum Alpha Five Version 6
    Replies: 1
    Last Post: 11-19-2005, 05:27 PM
  4. Diff. between List & Record List Xdialog box?
    By Bob Pickle in forum Alpha Five Version 5
    Replies: 3
    Last Post: 12-21-2003, 09:52 AM
  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
  •