Alpha DevCon 2018
Results 1 to 5 of 5

Thread: Changing an Embedded Browse on-the-fly using Xbasic

  1. #1
    Member
    Real Name
    John Turner
    Join Date
    Jun 2000
    Location
    Chicago
    Posts
    52

    Default Changing an Embedded Browse on-the-fly using Xbasic

    In an embedded browse (simple set 1 to many), is there a way to change the field a column points to using xbasic? The object explorer is unclear. So, say a column points to the "First Name" (clients->FstNam) field of a table and while using the form you check a check box that's titled "Switch to Calculated Name" so now the column points to a form calculated field called "Calculated Name" (calc->FstNam).

  2. #2
    "Certified" Alphaholic Stan Mathews's Avatar
    Real Name
    Stan Mathews
    Join Date
    Apr 2000
    Location
    Bowling Green, KY
    Posts
    25,107

    Default Re: Changing an Embedded Browse on-the-fly using Xbasic

    At one time that was a feature of the AlphaSports Customer Information form.

    topparent:Browse1:Lastname.Object.Column_title = searchby.text

    used as the onchange event code for the searchby variable reset the column heading (and thus the field represented).

    There's a bit more code after to resize and resynch the browse.


    Code:
    'set the column heading of the browse object to be the same as the entry selected in the combo box.
    topparent:Browse1:Lastname.Object.Column_title  = searchby.text
    
    'Set the width of the column in the browse to 30 (it will have gotten set to a smaller value when the SearchBy variable was changed)
    Browse1:Lastname.Entry.Width = 30
    
    
    
    'now sort table by the field that was selected
    dim tbl as p 
    tbl = table.current()
    tbl.order(searchby.text,searchby.text + " <> \"\"")
    
    'move the record pointer to the first record in the table
    tbl.fetch_first()
    
    
    mulstbtn1.text = "1"  '' I chose '1' because it is not in the set A-Z that we display
    
    'resynchronize the form with the data in the underlying table
    topparent.resynch()

  3. #3
    Member
    Real Name
    John Turner
    Join Date
    Jun 2000
    Location
    Chicago
    Posts
    52

    Default Re: Changing an Embedded Browse on-the-fly using Xbasic

    Sorry Stan, I guess I wasn't clear or maybe I'm misunderstanding. I have used: topparent:Browse1:Lastname.Object.Column_title = searchby.text
    to change the title of the column but it has no connection to the actual data displayed. It just changes the title of the column. But you did trigger a thought - I will try putting the new column (calc->FstNam) right next to the original column and hiding the one I don't want to see.

  4. #4
    "Certified" Alphaholic Stan Mathews's Avatar
    Real Name
    Stan Mathews
    Join Date
    Apr 2000
    Location
    Bowling Green, KY
    Posts
    25,107

    Default Re: Changing an Embedded Browse on-the-fly using Xbasic

    If you're viewing the Customer Information form and you change the searchby variable from lastname to company, does the browse column title change to company but lastnames are still displayed in the browse? Or does the browse then display company names?

    There is a calculated field defined for the form and that is what is displayed.


    disp.gif
    Last edited by Stan Mathews; 09-29-2011 at 05:07 PM.

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

    Default Re: Changing an Embedded Browse on-the-fly using Xbasic

    Just an update to the help to find this feature that is no longer exampled in the AS Customer Information form

    Combo box

    Redefine a Browse
    Robin

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

Similar Threads

  1. Changing properties of an embedded browse
    By seaken64 in forum Alpha Five Version 9 - Desktop Applications
    Replies: 2
    Last Post: 02-07-2010, 09:38 AM
  2. Embedded Browse Not Changing With Parent
    By cpc@technonet.com in forum Alpha Five Version 8
    Replies: 7
    Last Post: 03-09-2009, 10:53 AM
  3. Changing Material in BOm on the fly
    By tdorg in forum Application Server Version 9 - Web/Browser Applications
    Replies: 1
    Last Post: 08-15-2008, 04:17 AM
  4. Changing an Embedded Browse
    By davej in forum Alpha Five Version 5
    Replies: 4
    Last Post: 01-31-2004, 11:55 PM
  5. Filtering on the fly in embedded browse
    By Howard G. Cornett in forum Alpha Five Version 5
    Replies: 6
    Last Post: 04-16-2003, 05:43 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
  •