Get a Jumpstart with our Sample Apps
Results 1 to 8 of 8

Thread: Lookup and Fill-in Fields

  1. #1
    Member
    Real Name
    Frank Harrison
    Join Date
    Apr 2010
    Location
    Dallas, TX
    Posts
    22

    Default Lookup and Fill-in Fields

    Will the Formview control ever be able to use a an Edit-Combo List Textbox and fill in other fields in the Editor?

    I want to use a DropdownBox populated from the SQL table to select an Employee ID and then fill in Name,Address,Phone..etc

    The other functionality provided by the Formview and Viewbox controls are terrific!

    Thanks

  2. #2
    Alpha Software Employee Beta Spark's Avatar
    Real Name
    Sarah Mitchell
    Join Date
    Jul 2015
    Posts
    378

    Default Re: Lookup and Fill-in Fields

    Quote Originally Posted by frankh View Post
    Will the Formview control ever be able to use a an Edit-Combo List Textbox and fill in other fields in the Editor?

    I want to use a DropdownBox populated from the SQL table to select an Employee ID and then fill in Name,Address,Phone..etc

    The other functionality provided by the Formview and Viewbox controls are terrific!

    Thanks
    Hi Frank,

    Have you looked into using Group Editors? They allow you to create an editor that allows you to edit multiple fields at once. It should be possible to set the value in other fields when a change is made. Are you wanting to edit the values at the same time? Or are you looking to only provide an editor for one value and populate other fields not shown?
    Sarah Mitchell

    Looking for answers? Try our documentation.
    If you can't find something, let us know!

  3. #3
    Member
    Real Name
    Frank Harrison
    Join Date
    Apr 2010
    Location
    Dallas, TX
    Posts
    22

    Default Re: Lookup and Fill-in Fields

    Yes, I did look into the Group Editors but was unsuccessful. I also tried putting an xbasic function that was called from the Save button but I could not figure out where to get the Employee ID value that was chosen in the Dropdown box. This would be a great video! It could explain how to get the values for the Dropdown box from SQL tables and then how to populate the other fields. I would expect to have an editor in the Editor Set for each of these type of Dropdown boxes that populate the other fields. If I do not have to populate other fields using the selected value then the Dropdown boxes work great. Thanks.

  4. #4
    Member
    Real Name
    Josh Moshier
    Join Date
    May 2013
    Posts
    299

    Default Re: Lookup and Fill-in Fields

    I'm curious about this as well as it is very common in my applications to need to set the value of other controls based on the value set in a single control, or set the value of multiple controls when a user clicks a button (i.e. getting a users latitude and longitude using the navigator.geolocation.getCurrentPosition), but with a form I don't believe this is possible?

    I'm guessing my best work around here to persevere my ability to set the value of controls using the javascript methods, is instead of using a form view I'd need to set up my own javascript actions and controls (i.e. containers) to mimic what happens in a form view (i.e. being able to tap on a field and bringing up a field where the edits are done), is this correct?

  5. #5
    "Certified" Alphaholic
    Real Name
    Jetson Lilibeth
    Join Date
    Dec 2011
    Posts
    1,008

    Default Re: Lookup and Fill-in Fields

    Any updates on how to use fill in fields on formview?

  6. #6
    Member
    Real Name
    Greg Taylor
    Join Date
    Feb 2009
    Location
    Columbus, Ohio
    Posts
    409

    Default Re: Lookup and Fill-in Fields

    bump

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

    Default Re: Lookup and Fill-in Fields

    This is actually quite straight forward to do. Just want to clarify first, though... that the original post referenced both an Edit-Combo List and a Dropdownbox. I'll assume he meant the Textbox Control configured as an Edit-Combo List in both cases... since there is a Dropdownbox control... which would not be appropriate here.

    Set up your Editor as you normally would... adding in your Textbox Edit-Combo List control.

    For the Edit-Combo List select the fields you want to display in the edit combo list and the returned value... all normal stuff. For the Fill-In part, we are going to ignore the built-in Fill-in fields property. It's not going to help us. Instead, scroll down to the Javascript section and get into the AfterSelect property.

    Here we have full access to all the data in our Edit-Combo List... and... we have access to the powerful methods of the FormView Control.

    Your Javascript will be...

    Code:
    var _fields = ['Lastname','Price','Qty'];
    var _vals = [data.LASTNAME,data.CUSTAMOUNT,data.TOTAL];
    {dialog.object}.formViewUpdate('FORMVIEW_1',_fields,_vals);
    In my case, I attached an Editor to a State field. When I click on the State field in the FormView control, the Editor is displayed... with my Textbox Edit-Combo control. I display the list and see my fields... Lastname, State, CustAmount, and Total. I make a selection and the Javascript above runs.

    _fields are the fields in the FormView I want to fill in.
    _vals is the data from the Edit-Combo List. All values are referenced via the data object... and all field names must be uppercase.

    Then the UX .formViewUpdate() method is used. The FormView fields are filled in.

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

    Default Re: Lookup and Fill-in Fields

    Hey Steven,

    Could you start a new thread for this question? I don't think it involves a FormView control or populating FormView fields based on data selection.
    In your new thread, could you specify the types of fields your want to dynamically pre-populate? TextBox, DropDownBox etc. The Alpha version/build your using. The SQL database you're using?
    UX? Grid?

    Is that advertising yours? If so, could you remove it please? We're bombarded enough... don't need to see it in forum posts. If it's not yours then please let me know and I'll report it to the Forum Admin.

Similar Threads

  1. Fill fields with table lookup
    By DRT1200 in forum Alpha Five Version 10 - Desktop Applications
    Replies: 5
    Last Post: 01-04-2011, 11:58 AM
  2. Lookup and fill field from fields
    By nlok888 in forum Application Server Version 10 - Web/Browser Applications
    Replies: 3
    Last Post: 09-11-2010, 08:54 PM
  3. Is lookup the right choice to select & fill fields with 2 fields
    By MikeData in forum Alpha Five Version 9 - Desktop Applications
    Replies: 13
    Last Post: 01-10-2009, 05:21 PM
  4. A5, V4.5, do not fill all the fields in table lookup
    By jrtarrago in forum Alpha Five Version 4
    Replies: 3
    Last Post: 11-10-2008, 04:08 PM
  5. Lookup table and fields to fill
    By rleunis in forum Alpha Five Version 6
    Replies: 1
    Last Post: 09-16-2005, 04:13 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •