Alpha Video Training
Results 1 to 10 of 10

Thread: How to get variables of embedded listbox xdialog

  1. #1
    Member
    Real Name
    Razali Yahaya
    Join Date
    Oct 2007
    Location
    Banting, Malaysia
    Posts
    66

    Question How to get variables of embedded listbox xdialog

    I need to populate my form with the variable that selected from the
    listbox that created in the conditional object embedded xdialog.
    I upload the samples. Problem features in form activities.

    I need to do:
    1. select a client_id ( eg 0004)in the listbox.
    2. click OK button,
    3. form:client_id become "0004"
    4. form layout refresh.
    Have try search this board, did not found any thread.

    Any help is greatly appreciated.
    Regards,
    Razali

  2. #2
    "Certified" Alphaholic Clunes's Avatar
    Real Name
    Mark Pearson
    Join Date
    Jan 2010
    Location
    Brisbane, Queensland, Australia
    Posts
    1,001

    Default Re: How to get variables of embedded listbox xdialog

    Not sure exactly what you want, but

    Here is a demo script of an xdialog based on your db. Create a new script, copy and paste this code into yours and save.

    when you run it will open a dialog where you can filter to the person. When you click continue it will take you to one of your forms based on that person.

    I made this with the xdialog genie - pasted as a script and then modified to capture user actions.
    -----------------------------------------------
    Regards
    Mark Pearson
    mark.pearson@onestopsolutions.com.au
    Youtube channel
    Website

  3. #3
    Member
    Real Name
    Razali Yahaya
    Join Date
    Oct 2007
    Location
    Banting, Malaysia
    Posts
    66

    Default Re: How to get variables of embedded listbox xdialog

    Hello Mark,

    Thanks for the prompt help.

    My intention is to use conditional object as to replace the tab object in form. Reason is simply because it seem faster than others, browses or tab. I am using many levels of conditional sheets with different objects in them.
    With xdialog supercontrol, i can embed a list to search and browse.

    In this case, when adding the script into the xdialog supercontrol, the layout can not recognize the variables.

    When comparing the both scripts method, the xdialog supercontrol is faster to appear. (Demonstrated by files test1)

    Do you know how to make it work?

    Thanks.

    Razali

  4. #4
    Member
    Real Name
    Razali Yahaya
    Join Date
    Oct 2007
    Location
    Banting, Malaysia
    Posts
    66

    Default Re: How to get variables of embedded listbox xdialog

    I have read the help files and video example here
    Understood about the variables and binding it to form objects.

    Problem here is how to bind or link the variables created from xdialog genies such as this.

    Thanks.

  5. #5
    Member
    Real Name
    Razali Yahaya
    Join Date
    Oct 2007
    Location
    Banting, Malaysia
    Posts
    66

    Default Re: How to get variables of embedded listbox xdialog

    Hi,

    I guess the drop down xdialog browse seems to provide same purpose as what I was looking for. Faster to develop and implement.

    So I tried create the dropdown browse on the activities form filtering - Salutation = "Mr" from people.dbf table.

    This give error of field not found.

    Anyone knows how to solve this?

    Thanks.

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

    Default Re: How to get variables of embedded listbox xdialog

    Razali,
    In the last sample you attached, what variables do you want to use from the xdialog and to what fields do you want to "bind" them? I could spend a ton of time guessing!! It seems as if all the variables you have in your xdialog are local and within functions....I would try dimming the ones wanted to be shared, otherwise the form will not be able to "see" them outside of the scripts your are running. Then use the "Variable Binding" tab when looking at your xdialog code in design mode to link them to your form fields.
    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
    Member
    Real Name
    Razali Yahaya
    Join Date
    Oct 2007
    Location
    Banting, Malaysia
    Posts
    66

    Default Re: How to get variables of embedded listbox xdialog

    Thanks MikeC for your help.

    Giving you my real scenario, I want to add an xdialog of client waiting or detail list in the conditional object of treatment form.

    So that I could view the waiting list by click the conditional button, then select a client, click 'OK' button to add that client into the current form or opening appropriate form with current selection.

    I seem could not find the variable since they all functional ones.

    So could you show me how to pick a variable, especially the clientId as shown in first attachment or 2nd if you prefer. From that on, I should be able to work on many other list as such.

    Thanks again.

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

    Default Re: How to get variables of embedded listbox xdialog

    so much code in the xdialog it is hard to see what is going on....when did it work last....or didn't it? I suggest stripping all but the xdialog out of the script and get the variable to be seen--then add all the additional. one thing...if you are using the variable mylist1 you have an extra space when you are dimming it (do not think it is a contributing factor here though). But use the variable binding tab to link the variable (whatever one you intend to use) to the field you want.
    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
    __________________________________________




  9. #9
    Member
    Real Name
    Razali Yahaya
    Join Date
    Oct 2007
    Location
    Banting, Malaysia
    Posts
    66

    Default Re: How to get variables of embedded listbox xdialog

    Thank you for the tips, MikeC.
    I will try to work it out, to get the solution. Else I will use browse or button to call out the script as was suggested by Clunes earlier.

    Thanks.

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

    Default Re: How to get variables of embedded listbox xdialog

    Razali,

    I know it is an 4 years old and you may have the solution already but I have this solution for other users.


    3. form:client_id become "0004"
    4. form layout refresh.

    solution -- add the form filter at this fuction
    Code:
    function OnDoubleClick as c(lv as p,listView as p,args as p)
    	WITH lv
    		vmylist  = listView.GetRowValue(args.GetClickRow())
    '		ui_msg_box("OnDoubleClick",vmylist)
    	'add for form filter
    	parentform.QueryRun("client_id="+quote(vMyList),"")     'or other way to find the record
    
    	END WITH
    end function	
    	
    FUNCTION OnSelectionChanged AS V (lv AS P, listView as p )
    	WITH lv
    		vmylist = listView.Selection
    '		ui_msg_box("OnSelectionChanged",vmylist)
    	'add for form filter
    	parentform.QueryRun("client_id="+quote(vMyList),"")
    	END WITH
    END FUNCTION
    
    'The {Listview} does not allowed the event, like " !vMylist_changed" so you have to use the Function()
    If a_dlg_button = "OK"
    	ui_msg_box("OnSelectionChanged",vmylist)
    	'add for form filter
    	parentform.QueryRun("client_id="+quote(vMyList),"")
    	a_dlg_button =""
    end if

Similar Threads

  1. XDialog Coded Listbox vs. Checkbox
    By danh in forum Alpha Five Version 9 - Desktop Applications
    Replies: 8
    Last Post: 05-23-2013, 01:12 PM
  2. xdialog listbox refresh
    By warmexxus in forum Alpha Five Version 7
    Replies: 21
    Last Post: 09-27-2007, 03:35 PM
  3. Change Xdialog text box to listbox
    By christobal in forum Alpha Five Version 8
    Replies: 0
    Last Post: 07-18-2007, 03:31 AM
  4. XDialog ListBox Question
    By Ericl in forum Alpha Five Version 7
    Replies: 4
    Last Post: 02-27-2006, 11:47 AM
  5. Non-xDialog multi-select listbox
    By Blake in forum Alpha Five Version 5
    Replies: 2
    Last Post: 04-14-2004, 10:20 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
  •