8 Replies Latest reply on Jul 20, 2011 3:56 PM by philmodjunk

    Ever Expanding Check Box Set

    MatthewMackay

      Title

      Ever Expanding Check Box Set

      Post

      Within my solution I currently have a check box set that the user can add to.

      As you can see from the photo, the boundaries of the check box set are nearing. I imagine I'm going to have to use a portal but am not quite sure how to implement it as the current value list for the check box set is conditional, any ideas?

      Screen_shot_2011-07-20_at_21.50.34.png

        • 1. Re: Ever Expanding Check Box Set
          philmodjunk

          The same relationship you can use for a conditional value list can be used for a portal. The trick is to supply scripts to a button in the portal so that selecting it adds/removes that value from a field defined in the layout's table. Then conditional formatting on an object in the portal row can use an expression that changes the appearance of the object if that portal row's value is included in the list of values maintained in the field.

          This is just a general description of the technique. The script has to be written to successfully add a value if it's not already listed in the field and to remove it if it is to mirror the behavior you get when you click a check box.

          • 2. Re: Ever Expanding Check Box Set
            MatthewMackay

            I've uploaded a new image, I've managed to get the related table showing in a portal but not as desired as I'm sure you can tell. How would I get 1 item per portal row?

            • 3. Re: Ever Expanding Check Box Set
              philmodjunk

              "Door Stop"
              "Gold Thresholds"
              "Metal Thresholds"

              Etc.

              Would all be entered with the quoted text in separate records of the same related table. My mistake in assuming that you already were using a table as the source of values for your check box. Adding new values to the list is achieved by adding new records to this table. You can add buttons, scripts and layout for managing this list much like using the edit option to edit a custom value list.

              To list the fields, you then use edit box formatted text fields to display thes values in the portal.

              To produce what looks like a check box, you can put an X (or other layout text) on in the portal row and use conditional formatting to hide and reveal this layout text. (Setting font size to 500 makes text disappear.) You can add a rectangle behind the X if you want your check box to have borders. The last and most critical step is to then use button setup... to turn either the X or the X and the text field into a button that performs a script to select/deselect values from your list.

              • 4. Re: Ever Expanding Check Box Set
                philmodjunk

                I just found a demo file that illustrates this method. It differs in a few small ways--It uses a calculation field formatted as a check box to show which value is selected, but otherwise shows what I am describing here.

                It uses a global variable to maintain and update the needed values so that the calculation field can correctly return a 1 for all portal records where the value is selected. The calculation expression used in the calculation field can be used in a conditional format expression if you want to use layout text instead of a calculation field. Using a conditional format allows you to use other characters such as a tick mark instead of the standard "X" to show which values are selected.

                • 5. Re: Ever Expanding Check Box Set
                  MatthewMackay

                  I'm getting every single record present within the table that is creating my check box conditional value list. Is there any way to only show the values that are present in the checkbox set?

                  My checkbox set is conditional on an item from the 'Room Inventory' table. My script to add new items to the checkbox set is;

                  Add New Fitting

                  Set Variable [ $Item; Value:Room Inventory::Item ] Set Variable [ $$ItemID; Value:Room Inventory::PK_Item_ID ] Go to Layout [ “Create New Fittings” (Room Inventory) ] New Record/Request Set Field [ Room Inventory::Category; Get (ScriptParameter) ]

                  Set Field [ Room Inventory::Item; $Item ]

                  Go to Field [ Room Inventory::Fittings ]

                  • 6. Re: Ever Expanding Check Box Set
                    philmodjunk

                    I see I was correct that your check box values are stored in a table. That's the table you want to use for your scrolling check box portal as well.  When setting up your portal, use the same table occurrence you used for your conditional value list's relationship.

                    • 7. Re: Ever Expanding Check Box Set
                      MatthewMackay

                      I still get multiple values in each portal row using the table from my conditional value list.

                      Can you post a link to the demo file mentioned?

                      • 8. Re: Ever Expanding Check Box Set
                        philmodjunk

                        Do not use your existing value list to add a check box group to your field in the portal. Use the actual text field where just one value is entered and leave it formatted as a standard edit box. Then you'll see one value to each portal row.

                        Profound Apologies! I thought I had. Here it is:  http://www.4shared.com/file/47D2cLni/CheckboxWScrollBar.html