3 Replies Latest reply on Oct 23, 2014 11:10 AM by grouper

    Goto Specific field in Portal

    grouper

      Title

      Goto Specific field in Portal

      Post

      Hi,

      I 've built a portal that has 3 related fields in it. The first is the portal_row_number (defined by a calculation), the second is a container field and the third is the corresponding master ID of the related table. I 'm trying to create two scripts (attached to buttons) that navigate through the portal rows, using the goto next/previous portal rows.

      The portal is set up so that when the user clicks on the container, a setfield command is performed that makes the contents of the small portal container (looks like a thumbnail) visible on a larger container of the same field in the same layout, using a selected_table_occurence structure (the whole layout looks like having a small preview on the left and the bigger image on the right).

      So the script attached to the navigation buttons should call in the setfield in order to work. I found no other way around it in order to get the correct ID for the setfield each time, but to include the master ID of the related selected_table in each portal row, make it hidden, and force the script to navigate to the ID object on the portal row, get(activefieldcontents), set a variable and setfield according to the variable.

      The problem is that I can' t make the script navigate correctly through the portal .There are other portals on the same layout, so the script steps are :

      goto object [portal]

      go to next portal row

      goto object [ID field inside portal row]

      get activefieldcontents to variable

      set field .......

      For some reason this script always navigates to the 1st portal row. Presumable because the goto object [ID] always navigates to the 1st row. Can anyone help on how to set up the script so that it navigates correctly? Also, since the focus may already have been at a specific portal row (i.e. 5th) before clicking the navigation buttons, how should the script move the focus to the next/previous from that row?

      thanks

       

        • 1. Re: Goto Specific field in Portal
          SteveMartino

          Posting a sample file may help.  I think your problem lies in the fact when you click your button you change the focus.  You have to capture the portal row number before you click the next/previous button.  When you click into a field on the portal row, you could use a script trigger to capture the portal row number in a global variable.  Then previous/next button can take the variable and add or subtract one to put you in the next/previous portal row, then go to field (or object if you named the field in the inspector) should get you to the proper field

          • 2. Re: Goto Specific field in Portal
            philmodjunk

            Go to Object [portal]

            is putting your focus on the first portal row.

            Like Steve, I don't see why your are trying to navigate through the portal rows in this fashion.

            Aren't you clicking a portal row to select the image you want to appear in the larger container field? IF so the mouse click will put the focus on the desired portal row and there is no need to do any "navigating through portal rows" as you are already where you need to be.

            • 3. Re: Goto Specific field in Portal
              grouper

              Yes, clicking did the trick, but I wanted to have the option of navigating through next/previous buttons, because the rows with the thumbnails are usually many more than can be shown in the default portal dimensions (more than 50), so the user would have to continuously keep clicking and moving the portal scroll bar when he reached the bottom in order to see the magnified result of the container on the layout.

              With navigation buttons this process is done very quickly, without having to change the mouse location, and also provides fast access to the goto first/last (last is for new items) buttons which are next to the next/previous.

              I finally managed to get around this by creating a calculation field that got the ID from the related table and used an additional setfield step in the script attached to navigation buttons that got this value.

              thank you both Phil and Steve for your quick answers, the support on this forum is excellent!