Alpha Video Training
Results 1 to 9 of 9

Thread: Placing mutiple conditional objects on top one another

  1. #1
    Member
    Real Name
    Aaron Okievs
    Join Date
    Feb 2011
    Posts
    18

    Default Placing mutiple conditional objects on top one another

    Hello everybody,

    I have a problem making use of multiple conditional objects placed on the same position on a tabbed object. I had to attached the files and photos of what am trying to put together below.

    design_mode.png

    form_view.png

    HMSDB.zip

    According to the form: "MedicalRecordsForm", which is connected to the "medical_records" table, has a Tabbed Object with tabs: General and Dental Care. The issue is with the Dental Care tab, with a conditional object "COND1" and Teeth Number "teeth_number" radio buttons 1,2,3 from the medical_records table look-up Simple List.

    The idea is that, when a teeth number radio button (1) is clicked, it activates the COND1 conditional object to display its field objects: DETAILS1, TEETH_CONCERNED, EXPLANATION_OF_NEEDS, including its field labels. When the second radio button (2) is clicked, it will activate COND2 conditional object and its field objects, and in the process, hides COND1 conditional object and its field objects.

    I want to add up to 32 radio buttons that will activate up to 32 different conditional objects for an Adult Human Dental, or that will create new fields to enter values on, once each radio button is clicked.

    ISSUE: I didn't add a COND2 conditional object since it gives the form errors and sometimes closes the alpha five development environment. I've tried all possible way to make this work, but couldn't. I was told from the forum that its possible to make use of conditional objects on a tab, still couldn't see how possible it is from what I've tried so far.

    Any ideas and suggestions on how I can make this work from what I've posted would be greatly appreciated from the forum.

    Thanks a lot.

    Aaron Okievs.
    Last edited by aaronhaul; 03-25-2012 at 12:14 AM.

  2. #2
    "Certified" Alphaholic Ray in Capetown's Avatar
    Real Name
    Ray Hendler
    Join Date
    Jan 2009
    Location
    South Africa
    Posts
    2,036

    Default Re: Placing mutiple conditional objects on top one another

    You shouldn't add conditional objects in the same position.
    Use the one object to add condition expressions.
    Do you know how?
    Properties, add a condition expression by selecting <new condition>

  3. #3
    Member
    Real Name
    Aaron Okievs
    Join Date
    Feb 2011
    Posts
    18

    Default Re: Placing mutiple conditional objects on top one another

    Thank you for your information. I did just as you've said by using same conditional object: COND1 to create multiple conditions by using the <new condition> expression. I used the condition expression:

    Teeth_Number = "1"
    Teeth_Number = "2"
    Teeth_Number = "3"

    Since am to make use of this method, how can I connect this to the radio buttons so whenever I select a different radio button: 1, 2 , or 3, a New form field will be displayed in same position?

    Please I need more information.

  4. #4
    VAR
    Real Name
    Martin W. Cole
    Join Date
    Apr 2000
    Location
    Terrell, Texas (near Dallas)
    Posts
    5,957

    Default Re: Placing mutiple conditional objects on top one another

    I have a hospital app, where I have well over 30 conditions for ONE conditional object. Mine is based on the therapy.

    Since yours is "changed" so to speak when you make a change to a radio button, which I imagine works as a drop down to select which condition you want, have a table field on the form that is reset at the onchange event of the radio object, and have all conditions based on that field - like dummy=1 or dummy="1", and then put inside the condition what you want for that expression. Then, when the user picks the raidio for a different value, (the onchange event for that radio control) set dummy to "2" or whatever, and say cond1.refresh(). Saving that value to a field will have that patient's record show the last condition you selected for him.
    Cole Custom Programming - Terrell, Texas
    972 524 8714
    martin_w_cole@msn.com

    ____________________
    "A young man who is not liberal has no heart, but an old man who is not conservative has no mind." GB Shaw

  5. #5
    "Certified" Alphaholic Ray in Capetown's Avatar
    Real Name
    Ray Hendler
    Join Date
    Jan 2009
    Location
    South Africa
    Posts
    2,036

    Default Re: Placing mutiple conditional objects on top one another

    To simply have the last radio (or any) button pressed be the one to activate the condition you can do as follows.
    This is the simplest without my seeing how you have created the buttons also, not using a value, if one is attached to the button.

    1..with the form in Design mode right click button 1, select:- "events"|"On push" and "create using xbasic"
    2.. in the code editor that appears type Teeth_Number = "1"
    .... you may need (probably better) to add a second line as Martin says with cond1.refresh()
    3.. save
    4.. goto point 1.. above and use button 2 - follow the same procedure but in the code editor type Teeth_Number = "2"
    then again for button 3 enter eeth_Number ="3" etc

    Remember to save the form when you have closed the code editor. Switch to the Form View. Test the buttons.

    if the button based on a variable you can use the value and other techniques to set Teeth_number value but there is nothing wrong with using that simple click last is the active selection - easy for the user too.
    Last edited by Ray in Capetown; 03-25-2012 at 11:14 AM.

  6. #6
    "Certified" Alphaholic Ray in Capetown's Avatar
    Real Name
    Ray Hendler
    Join Date
    Jan 2009
    Location
    South Africa
    Posts
    2,036

    Default Re: Placing mutiple conditional objects on top one another

    Aaron
    I got a bit carried away so here is a working test example.
    Just unzip the contents of testcond.zip to you working folder (where your app resides)
    and in your app, control panel, tables tab, Add a table called "ttable".
    You will thereafter see a new form;- "testdummy" - open and see how that works as described.
    and it does need COND1.refresh(), when I use conditions based on form and form mode changes it doesn't seem to.
    and Martin, I always believed I had to use parentform.cond1. refresh so this is something I learned.
    Attached Files Attached Files
    Last edited by Ray in Capetown; 03-25-2012 at 12:11 PM.

  7. #7
    Member
    Real Name
    Aaron Okievs
    Join Date
    Feb 2011
    Posts
    18

    Default Re: Placing mutiple conditional objects on top one another

    Thank you all for your contributions. It really helps. Since I will be adding NEW details for each teeth radio button click, I decided to create a new table record for each conditional statement by using same COND1.

    Is it possible to use variables to store the data on the form instead of the database table?

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

    Default Re: Placing mutiple conditional objects on top one another

    Is it possible to use variables to store the data on the form instead of the database table?
    A form is not separate from a table. A form is a way of displaying the data stored in a table, generally one record at a time. A form can have variables and you can read/write the values of the variables from/to an external file. Not much benefit there.

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

    Default Re: Placing mutiple conditional objects on top one another

    I would set it up having the teeth data as each tooth being a record in a child table for the patient and filter the child to get the tooth data. See attached example.
    Attached Files Attached Files
    Mike W
    __________________________
    "I rebel in at least small things to express to the world that I have not completely surrendered"

Similar Threads

  1. Using Conditional Objects
    By Mr GreenJeans in forum Alpha Five Version 6
    Replies: 23
    Last Post: 09-11-2005, 01:20 AM
  2. Placing 2 conditional fields within the same space
    By Robert Lee in forum Alpha Five Version 5
    Replies: 4
    Last Post: 01-01-2004, 05:31 PM
  3. Conditional Objects
    By Curtis Nunn in forum Alpha Five Version 5
    Replies: 1
    Last Post: 09-12-2003, 03:11 PM
  4. conditional objects
    By kjsocier in forum Alpha Five Version 5
    Replies: 6
    Last Post: 10-30-2002, 01:35 PM
  5. Conditional Objects
    By Bill Harriff in forum Alpha Five Version 4
    Replies: 2
    Last Post: 05-11-2002, 02:11 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
  •