locked
Hiding a tab in the HTML client RRS feed

  • Question

  • I'm using the HTML client and wondered if I can hide a page's tab based on user information?

    In my case I have two joined tables, Person and Employee, in a parent-child, zero-to-one relationship.  Not every Person has an Employee record.

    On my Person view screen I have two tabs: 'Person Info' and 'Employee Info'.  You see where this is going.

    What I'd like to do is hide the Employee Info tab if the person isn't an employee.  I was thinking of doing the following on the screen created method (pseudocode warning):

    myapp.ViewPerson.created = function(screen)

    screen.Person.getEmployee().then(function(results)

    {

    if(results == undefined){            

    screen.findContentItem("EditEmployeeTab").isVisible = false;        

    }    

    }

    };


    As for another idea, if I go to the Employee Info tab for someone who isn't an employee, is it possible to hide the greyed-out fields on there that indicate there's no data to be shown, and replace things with some custom markup that might say in effect, 'This person is not an employee'?






    Monday, July 14, 2014 8:50 PM

Answers

  • I tried out my code snippet above, and lo and behold it worked.  I'd still like to know whether anyone has customized a browse screen that has its fields greyed out due to no data being available and replaced it with something else like a watermark reading 'No data to see here.'
    • Proposed as answer by Angie Xu Wednesday, July 16, 2014 9:39 AM
    • Marked as answer by Angie Xu Friday, July 25, 2014 5:16 AM
    Tuesday, July 15, 2014 2:40 PM