14 Replies Latest reply on Mar 28, 2011 12:10 PM by philmodjunk

    Tab Scripting Causing Lockup

    BradenDouglass

      Title

      Tab Scripting Causing Lockup

      Post

      Alright all, here is a little background:

      Portions of the frontend need to be completely blocked out from user access and to accomplish this I am using an old school method (to me at least) that utilizes tabs. If something gets selected the tabs will flip to the second view and show the fields. The issue that I am having is when you click on the tabs that navigate around the DB, the tabs that are utilized to hide items reset to their hidden state, regardless of the state that the fields are that force them to flip. To combat this, I decided to use an object modify script when the user selects the nav tab. This works (sort of) but locks the user from selecting any other nav tabs.

      Any ideas / suggestions? Thank you all and again sorry for the gretuitous use of the word "tab" above.

        • 1. Re: Tab Scripting Causing Lockup
          philmodjunk

          Can't quite picture the key details. Can you give an example of what you've set up here?

          On the one hand you appear to be using a tab control to hide/reveal objects in the layout. On the other hand, users need to click the tabs in this same tab control?

          I'm having trouble picturing why the same tab control would be used for both purposes.

          • 2. Re: Tab Scripting Causing Lockup
            BradenDouglass

            Sure Phil, sorry I didn't attach a pic, the idea is kind of confusing without seeing it.

            http://cl.ly/5VYx

            • 3. Re: Tab Scripting Causing Lockup
              philmodjunk

              It's still confusing.

              I assume you have an OnObjectModify trigger set on the upper left radio button field. When you click a radio button, what is supposed to happen? It looks like your user clicks on a tab and then can't modify the radio button field because it was on the first tab and all objects on the first tab are no longer visible.

              This is expected behavior. If you want them to always have access to the radio button, why not just place it outside the tab control?

              I can't really figure out what is supposed to be hidden from the user here.

              • 4. Re: Tab Scripting Causing Lockup
                BradenDouglass

                Hmm maybe this will help,

                http://cl.ly/5Ult

                If you open the file or nav to the tab and the numbering / encoding = yes it will continue to hide the values until you click in the field. I was trying to circumvent that action (not really user friendly) by triggering a script when you clicked on the tab. And yes, the trigger is on ObjModify

                • 5. Re: Tab Scripting Causing Lockup
                  philmodjunk

                  That shows me what you want to hide on the encoding tab, but I don't see a problem with what's shown. What does the script trigger do on the radio button fields to "hide" these? select a different tab? Are you trying to keep them from clicking "encoding" if they are not permitted to access this tab?

                  • 6. Re: Tab Scripting Causing Lockup
                    BradenDouglass

                    Issue at hand: 

                     When the user opens the file or navs to the tab and the numbering / encoding fields = yes it will continue to hide the values until you click in the field.

                    My First Solution:

                    Create a script that fires the scripts attached to the encoding / numbering yes no field. This doesn't really work and doesn't allow me to change to a different nav tab once it is fired.

                    Solution I am Looking for:

                    When the user clicks on the tab (enters it), the scripts that are apart of encoding / numbering (yes, no) is fired only once.

                    • 7. Re: Tab Scripting Causing Lockup
                      philmodjunk

                      When the user opens the file or navs to the tab and the numbering / encoding fields = yes it will continue to hide the values until you click in the field.

                      What method are you using to "hide the values"?

                      • 8. Re: Tab Scripting Causing Lockup
                        philmodjunk

                        I took another look at that last screen shot. Apologies. When you said you were going "old school" and talked about the tabs, I assumed you were using tabs to hide the data instead of conditional formats.

                        Let me rephrase that last question:

                        What conditional format expression(s) are you using to hide the controls? What formats get applied to hide them?

                        • 9. Re: Tab Scripting Causing Lockup
                          BradenDouglass

                          Using the tabs to hide data and when . To my knowledge you can't build conditional items into tabs. Whenever I have tried the item is whited out. I have made a simple DB that shows off the issue. If yes is checked, item 1 should be displayed. 1 and 2 are no so it shows 0 (this is correct), when you cycle to 3 you should see 1 since yes is checked but you see 0 instead.

                          http://cl.ly/5YZj

                          • 10. Re: Tab Scripting Causing Lockup
                            philmodjunk

                            How do you expect to use tabs to hide the data, but then allow the user to also click tabs in the same tab control?

                            The badges on the last screen shot you shared show that conditional formats are indeed selected for these layout objects. And conditional formats work just fine inside tab controls.

                            Having looked at your demo file, I am still puzzled. I can see that clicking yes or no uses go to object to select a tab based on the selected value of the tab control, but why would this be included inside a tab control with other tabs? If you just want to keep the user from seeing this tab, you can use the same script but with the tab control's on modify trigger to lock the user out of tab 1.

                            If you have more than just the two tabs and you only want to lock them out of one tab, you'll need to use a more sophisticated script that checks to see what tab is the front tab panel (getlayoutobjectattribute) and to switch to a different tab if it is the "locked" tab. This, however, still "flashes" the tab briefly, so I think I'd rather go with a conditional format that hides the data instead of using this method.

                            • 11. Re: Tab Scripting Causing Lockup
                              BradenDouglass

                              I understand that conditional items can work within tabs. I was unaware that you could make items dissapear in the conditional field. You can change the color, make them quite small (1point) but you couldn't remove them completely like I am doing with the tabs. Do I have this wrong'?

                              • 12. Re: Tab Scripting Causing Lockup
                                philmodjunk

                                Not really, it depends on the object. With text, you can set the size to 500 to make them disappear. Fields with check box formatting or a visible field boundary an't disappear like that.

                                I think I'd rather use a portal nested inside the tab control for this where there is no related portal record in the portal if the radio button field is set to "no". Nestting a smaller tab control inside the larger tab control with tabs of width zero may work also. (I haven't tested that option to see if you can accidentally click on a zero width tab or not.)

                                • 13. Re: Tab Scripting Causing Lockup
                                  BradenDouglass

                                  Phil...your last comment of nesting a tab control within the nav tabs is exactly the way I have it now. If the width is set to 0 it will disapear. My issue is getting the tab to flip to its' correct position without the user having to click on the field that causes the script to run (eg, have it fire when a specific navigation tab is clicked.

                                  • 14. Re: Tab Scripting Causing Lockup
                                    philmodjunk

                                    OK, please note that the nested tab control was invisible in your first screen shots. Your earlier shots only show one tab control.

                                    What you post simply confirms my opinion that a portal would work better. It won't need any special handling when the user clicks the tab with hidden objects and there will be no "flash" of the hidden objects when they do so.