8 Replies Latest reply on May 9, 2009 3:43 AM by BigMacAl

    Value list to insert pictures?

    BigMacAl

      Title

      Value list to insert pictures?

      Post

      I'd like to use a pop-up value list to insert pictures into a container. For example, choosing "Insert picture 01" from the list (quite a long one) would insert Picture 01 into the designated container. Is that possible? Can anyone please advise how to do it? 

       

      Help much appreciated - thanks. 

        • 1. Re: Value list to insert pictures?
          philmodjunk
            

          From where are you inserting the pictures, an image file or a container field?

           

          What do you want to insert, the image or a reference to it?

          • 2. Re: Value list to insert pictures?
            BigMacAl
               It could be either from a reference to the images in a folder, or from images stored elsewhere (thus embedded but hidden) in the database - whichever is easier or, probably more appropriate, more elegant.
            • 3. Re: Value list to insert pictures?
              philmodjunk
                

              There issues here that make a difference, will the database be shared over the network? If so, then you have to be careful where you store your images if you use "by reference" or your clients won't see the images. You can research this issue in the Knowledge Base. On the other hand, if there are going to be a large number of images, storing the actual images instead of a file reference, could make your database extremely large.

               

              In either case, I'd try creaing a table with at least two fields, we'll call it ImageList.

              Image (Container Field)

              Name (Text Field)

               

              Define a value list "ImageNames" and specify ImageList::Name as the source of values.

               

              Now store either each image or it's reference in the Image field of separate records and give each a descriptive name.

               

              Now you can format a text field to use the ImageNames value list to select specific picture records.

               

              You've now got multiple options for how to make the value list selection work for you.

               

              Do you want to see just one image in each record? An unknown flexible number of records? or...?

               

              Once I know that we can move forward.

              • 4. Re: Value list to insert pictures?
                BigMacAl
                  

                Actually, what I ultimately want to achieve is a single record with three lists and three containers, the first list pointing to the first container, the second to the second, and third to third, so that the record displays different combinations of images depending on the menu selection.

                 

                Fortunately, this won't be shared over a network - which should make things easier - and the size of database shouldn't be too much of a problem either as there are only 300 smallish images in all (I've used a lot more in the past).

                 

                Thanks for your help on this PhilModJunk.

                • 5. Re: Value list to insert pictures?
                  philmodjunk
                    

                  I'll describe how to do this for one container and you can repeat the process 2 more times to set it up for three.

                  Define a text field in your main table's record (I'll call this table, "MainTable" in my example) and name it "Picture1".

                  Create a relationship linking your two tables. ImageList::Name--=--MainTable:: Picture1

                  Format Picture1 to use the ImageNames value list.

                  On your layout, add the ImageList::Image field to your layout.

                  Now, when you select a picture from the Picture1 field's value list, the matching picture will appear.

                   

                  If you do this for three separate field, you'll need two more relationships just like above, but matching different fields in MainTable. This requires creating 2 more Table Occurrences for ImageList. Open Manage | Database | Relationships. Click ImageList and then click the button that looks like two overlapping plus signs. Now build it's relationship. When you add the reference to the related Image field, be sure to select from the new Table Occurrence's field list.

                   

                  Note that in many cases we might choose to use a portal instead of three separate fields to display the picture fields instead of this method. It depends on what you are trying to do and how you want to set up your layout.

                  • 6. Re: Value list to insert pictures?
                    BigMacAl
                      

                    That makes absolute sense, for which, many thanks - much appreciated.

                     

                    One thing I'm unclear about though: are you saying that I should use a text field for the pictures ("Picture1" in your example) instead of a container? I didn't know that was possible.

                     

                     

                    • 7. Re: Value list to insert pictures?
                      philmodjunk
                        

                      BigMacAl wrote:

                       

                      One thing I'm unclear about though: are you saying that I should use a text field for the pictures ("Picture1" in your example) instead of a container? I didn't know that was possible.

                       


                      No, Picture1 is a key field that will contain the name of the selected picture. The database will use that field to determine which record in the ImageList table to display. If you check back over my directions, you put two fields on your layout for every picture: a text field you use for selecting the name of the picture you want and the related container field for displaying the picture.

                       

                      It might make better sense to name the field "Picture1Name".


                      • 8. Re: Value list to insert pictures?
                        BigMacAl
                           That's fantastic - it all worked a treat! Many, many thanks for your help Phil.