Alpha Video Training
Results 1 to 11 of 11

Thread: Select items in a list from a function call return

  1. #1
    Member
    Real Name
    Eric
    Join Date
    Aug 2013
    Posts
    40

    Default Select items in a list from a function call return

    Hello,

    I have a form with a listbox that is populated through a SQL query.
    When the user comes to this form I am launching an XBasic function to get some data and return it to the form.
    One of the things I am also trying to do is select the items in the listbox from the javascript data returned from the XBasic ajax call.

    Thanks In Advance

  2. #2
    "Certified" Alphaholic Clipper87's Avatar
    Real Name
    Frank
    Join Date
    Dec 2008
    Location
    Antwerp, Belgium
    Posts
    1,891

    Default Re: Select items in a list from a function call return

    Is this a web application you are talking about ? Listbox ? You mean a List in a UX component or a dropdownbox ? Need more details to be able to answer, be more specific
    Frank

    Tell me and I'll forget; show me and I may remember; involve me and I'll understand

  3. #3
    Member
    Real Name
    Eric
    Join Date
    Aug 2013
    Posts
    40

    Default Re: Select items in a list from a function call return

    Sorry,

    It is a web app, inside of a UX. I have a Listbox that pulls it's own list of items to populate itself with. I need to be able to send it the values to mark as selected through the javascript return values from an XBasic function.

  4. #4
    "Certified" Alphaholic Clipper87's Avatar
    Real Name
    Frank
    Join Date
    Dec 2008
    Location
    Antwerp, Belgium
    Posts
    1,891

    Default Re: Select items in a list from a function call return

    You mean it is a text control with control type set to dropdown box & populated dynamically ? Or is it a list control ? You really need to be specific maybe add few screenshots & clearly explain what you want to do. Don't know if I'll be able to help you as I still don't understand what you mean by "I need to be able to send it the values to mark as selected through the javascript return values from an XBasic function."
    Frank

    Tell me and I'll forget; show me and I may remember; involve me and I'll understand

  5. #5
    Member
    Real Name
    Eric
    Join Date
    Aug 2013
    Posts
    40

    Default Re: Select items in a list from a function call return

    1-9-2014 6-22-14 AM.jpg

    I've attached a pic of the form.
    When this form is brought up, I do an XBasic Ajax call to pull in the the scheduled times, and also need to highlight / select which installers have been previously assigned to this job.

  6. #6
    "Certified" Alphaholic Clipper87's Avatar
    Real Name
    Frank
    Join Date
    Dec 2008
    Location
    Antwerp, Belgium
    Posts
    1,891

    Default Re: Select items in a list from a function call return

    Still no go, the screenshot could be anything, a screenshot of the component defintion could possible help or create a video with Jing in which you explain what you want to do. Sorry.
    Frank

    Tell me and I'll forget; show me and I may remember; involve me and I'll understand

  7. #7
    Member
    Real Name
    Eric
    Join Date
    Aug 2013
    Posts
    40

    Default Re: Select items in a list from a function call return

    UX
    <PANELCARD1>
    <LIST1> -> Shows list of site measurements that need to be taken.
    </PANELCARD1>

    <PANELCARD2>
    <FRAME1>
    (a bunch of textboxes listing the details of the location that was selected on LIST1)
    </FRAME1>

    <FRAME2>
    (three text boxes with the date / start time / end time of the measurement)
    <LIST2> - a listbox populated through it's own SQL query
    </FRAME2>
    </PANECARD2>

    XBASIC CODE (called when an item is selected in LIST1)
    function PullCurrentScheduleInformation as c (...)
    (In here I make several calls to the backend database to pull the schedule info and the list of installers selected to do the measurements)
    PullCurrentScheduleInformation = (a series of javascript that populates the controls in PANELCARD2 > FRAME2)
    - I am trying to send the correctly formatted javascript to LIST2 to select the appropriate items in it.
    end function
    UX

  8. #8
    Member
    Real Name
    Eric
    Join Date
    Aug 2013
    Posts
    40

    Default Re: Select items in a list from a function call return

    When you select an item in LIST1 it changes to PANEL2 and makes an Ajax call to the function PullCurrentScheduledInformation, this then returns Javascript ( i.e. PullCurrentScheduledInformation = "{dialog.Object}.setValue('RFMTIME','" + passtime + "' );" )

    Does this help any?

  9. #9
    "Certified" Alphaholic Clipper87's Avatar
    Real Name
    Frank
    Join Date
    Dec 2008
    Location
    Antwerp, Belgium
    Posts
    1,891

    Default Re: Select items in a list from a function call return

    Did you watch this video ? https://www.youtube.com/watch?v=wqD015PuoT0
    Frank

    Tell me and I'll forget; show me and I may remember; involve me and I'll understand

  10. #10
    Member
    Real Name
    Eric
    Join Date
    Aug 2013
    Posts
    40

    Default Re: Select items in a list from a function call return

    I just found this video https://www.youtube.com/watch?v=52wTvdNQ8og which pointed me in the right direction ("{dialog.Object}.setValue('LIST','Value' );").

    There is a little catch in that you need to set the return value of the list to the data your going to pass in.

    The only problem is that appears to only allow you to select one item at a time.

  11. #11
    Member
    Real Name
    Eric
    Join Date
    Aug 2013
    Posts
    40

    Default Re: Select items in a list from a function call return

    Or, I may have just forgotten to turn on multiselect on my test list.

    (FYI, multi-select items like so - "{dialog.Object}.setValue('LIST',['Value1','Value2'] );" )

    Thank you for your help.

Similar Threads

  1. Select all items in multi-select list box by default
    By Jay Talbott in forum Alpha Five Version 8
    Replies: 10
    Last Post: 02-02-2012, 06:27 PM
  2. Select Multiple Items in List Box
    By delsandberg in forum Alpha Five Version 9 - Desktop Applications
    Replies: 4
    Last Post: 02-01-2012, 05:13 PM
  3. How can I pre-select all items in a check box-list box?
    By Jay Talbott in forum Alpha Five Version 10 - Desktop Applications
    Replies: 4
    Last Post: 10-31-2011, 11:20 AM
  4. Add Button to Call v9XDialog & Return
    By ryland@rylandwiltshire.co in forum Alpha Five Version 9 - Desktop Applications
    Replies: 5
    Last Post: 02-08-2009, 10:58 PM
  5. Select items from QB DATA during refresh
    By mrdemeo in forum QReportBuilder
    Replies: 1
    Last Post: 08-08-2008, 02:56 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
  •