7 Replies Latest reply on Feb 12, 2015 1:03 PM by Mark_M

    IWP Hiding Buttons

    Mark_M

      Title

      IWP Hiding Buttons

      Post

      >

      Version: FM 12 Pro Advanced Client / FM 12 Server

      Question:

      Just wondering if there is a more elegant way to accomplish what I need.  I've made it work but it seems like a sledgehammer approach to the problem.  I didn't come up with this solution as I've never worked in IWP before, I found it via a web-search.

      Need:

      To hide or display buttons on a web page depending on conditions within fields for that record, the buttons must be click-able to fire a script.  I'm using IWP to deliver documents to employees (not all have FM client).  Some employees receive "Letters".  Letters are informational only and are "No Action Required".  Some employees receive "Contracts".  Contracts require the employee to electronically sign the contract by clicking an "Accept" or "Decline" button.  Once the contract has been accepted or declined, those buttons are removed and replaced with "No Action Required" and another field displays the date/time and status of the electronic signature.  Two buttons (accept and decline) must both be displayed at the same time to provide two different selections.  When those buttons are not needed they are not displayed and the "No Action Required" graphic is displayed instead.

      Current Solution:

      So I created a global table (tblButtons) which has two fields a Button_Key and a Button_Container.  The keys are "Accept", "Delcine" or "No Action Required" and the container fields store a graphic for an Accept Button, a Decline Button, or a No Action Required graphic.  The employee record has three calculations, one for each "button", that returns true for only one condition.  There are three relationships between the employee table and the button table, one for each condition.  On the web page I've added three portals, one for each condition - each portal uses it's own relationship to display the correct button.  When the record requires a display of "No Action", the Accept and Decline calculations return false and the "No Action" calculation returns true.  The relationship then shows the "No Action Required" graphic.  When the record requires the Accept and Decline buttons, those calculations return true and the "No Action" calculation returns false.  The web page displays the Accept button in it's portal and the Decline button in it's portal - since "No Action" is false, that graphic is not displayed.

       

      Is there a simpler way in FM 12?

       

      >>>>

        • 1. Re: IWP Hiding Buttons
          schamblee

          I created a sample I believe will work, but I have not tested on IWP.   I don't know of any issues.   My sample uses a tab control to hide the buttons and the no action label.  https://www.dropbox.com/s/m1uel6ez1xyrx4m/HideButtonSample.fmp12?dl=0

          • 2. Re: IWP Hiding Buttons
            Mark_M

            >

            Thank you I'll have to play with that concept.

            I had to change the theme to Classic for IWP and then I turned off all the fill and lines so that only the buttons showed, there is still kind of a "Shadow" visible showing there the Tabs are but if I put them behind another object so the button appear below it it may hide those shadows from the user so then can't "click" on them to bring up the other option so I'll have to do some scripting to control that.

             

            >>>>

            • 3. Re: IWP Hiding Buttons
              schamblee

              Did you set the tab width to 0?  Verify that you have remove the fill and line color.  If you set line to none it still appears, so I set it to the lowest setting and then change it to the null color. (In the color palette, the white icon with the red slash thru it.  This may be an issue with IWP, I had to figure out on the desktop how to hide the tab panel.   I've seen it used with several different themes on the desktop.  I just have not use IWP, but a couple of times in testing.

              • 4. Re: IWP Hiding Buttons
                Mark_M

                >

                Well I got it working well on a single record, but when I went to the next step and tested it on a person with multiple records I ran into a problem.

                The Tab Panel display is the same for all records and my current layout for IWP is based on a List View not a Form View.  Meaning all the same panels display in the list, when what is needed is different panels to be active for different records depending on that individual records need for an Accept/Decline or No Action Required option.  (If one row is a letter it is "No Action Required" and if the next row is a contract needing the Accept Decline buttons I can't mix them.)

                Dang it - that was working well.  I may need to change my web page flow, maybe a list view of documents available with a "View" button.  That button takes them to a different layout where the actual container field is and then on that page is the option to Accept/Decline if needed.

                 

                >>>>

                • 5. Re: IWP Hiding Buttons
                  schamblee

                  In list view, the Go to Object is moving the tab based on Current Record Status.  I will do some more testing I see If I can come up with solution.

                  • 6. Re: IWP Hiding Buttons
                    schamblee

                    Here is a new sample that will work in list view.  The buttons and the layout are plain because of hiding the buttons and No Action Label I use conditional formatting to set color of object to show them on the layout.https://www.dropbox.com/s/onf3ew3gm0s21g4/HideButtonSample2.fmp12?dl=0

                    • 7. Re: IWP Hiding Buttons
                      Mark_M

                      SC,

                      Thanks a whole bunch.  The Tab Trick was really good and I've kept it for future reference.

                      The 2nd with conditional formatting (while I appreciate the input) probably won't help as conditional formatting doesn't work in IWP.

                       

                      So I know what I'm going to do know and I just stepped through a very rough test sequence with a co-worker.  I'm just going to bite the bullet and have two different layouts.  The employee will see a List View of available documents.  When they click a "View" button, a calculation field will route them to a "No Action Required" layout or an "Accept/Decline" layout.  Once they've clicked an Accept or Decline button and the electronic signature is captured, the script will refresh the page to the "No Action Required" layout because the needed action is complete.

                      Not as elegant as the Tab or Portal option, but it make more sense for me to maintain over the coming years.

                       

                      >>>>