3 Replies Latest reply on Oct 29, 2015 8:00 AM by mark_b

    Selecting row item from list in a text field?


      Hi All,

      Background: On a home-study school's server, there is a folder for each student.  Within each student's folder are 5 other folders which contain documents for communications, other documents, complaints, financial and general pdfs and Word docx files.


      Solution: I have created a database that captures the name of each student's folder, the name of the 5 other folders and the document names of the contents of each folder.  The contents are collected as a return-separated list within 5 text fields.


      Problem:  I would like the user to be able to click on one of the document names and have the system open that document. If I can get the position of the cursor within the text field, I think I can get the contents of that list row, then build the full path to the document and open it.  I think I have seen this done somewhere, but I don't remember where.  Can someone point me in the right direction.



        • 1. Re: Selecting row item from list in a text field?

          Leaving aside questions about why you're not using related records and/or container fields for this...


          I've gone down the path before of trying to have the user click into a return-separated list and then run a script based on where they clicked. I got it to work, using Get ( ActiveSelectionStart ) and Get ( ActiveSelectionSize ), but it was clunky and "fiddly".


          Perhaps a slightly different approach:

          • Make a value list of the field based on a self-join
          • Show a checkbox set (or radio buttons) based on that value list, with a utility global field (it could be the same for all the fields, since you're only storing their selection there long enough to retrieve it)
          • Format the checkboxes/radio buttons to be essentially invisible
          • Put an onObjectModify script trigger on the field that captures the item they selected, then clears and leaves the field.


          One limitation is that you won't be able to have a scroll-bar, but that's kind of the deal killer for the other method, too, since scrolling the field "enters" it.




          Chris Cain


          • 2. Re: Selecting row item from list in a text field?

            Thanks Chris.  The self-join and the value list worked great.  The only problem (minor) that exists now is that when one of the text fields is blank, the value list shows "<no values defined>".  Is there a way to modify that statement - like "<No Documents>"?

            Cheers, Mark

            • 3. Re: Selecting row item from list in a text field?

              Never mind - the solution came to me.  Use Hide to hide the field if there's nothing to show.  That avoids the value list message.