mrc logo mrc logo
  • m-Power m-Power
    What is m-Power?
    Overview Demos Build Process Case Studies Specs Pricing Trial
    m-Power Resources
    Overview How-To Videos Webinars & Podcasts White Papers Fact Sheets
  • Solutions Solutions
    What does m-Power build?
    Overview Database Front-Ends Reporting CRM Systems Business Intelligence Dashboards Inventory Management Mobile Apps ERP Enhancements Modernization Spreadsheets to the web MS Access to the web B2B/Web Portals Scheduling Embedded Analytics Web Forms Workflow Data Exploration Budgeting & Forecasting APIs and Web Services Db2 Web Query Alternative
    Solutions by Industry
    Overview Manufacturing Government Foodservice Software Vendors Logistics & Supply Chain Software Consultants Healthcare
  • Services Services
    Development Services Training Mentoring
  • About About
    Overview Partners Press Releases Careers Events Contact Blog
  • Support Support
    Support Home FAQ Documentation Customer Portal Enhancements Updates Roadmap Techblog
Try m-Power

m-Power Manual

Browse:

  • Home
  • Bootstrap Templates
  • Visibility Controls via m-Painter
Back to Manual

Visibility Controls via m-Painter

View current documentation for this feature here.

m-Painter offers several visibility control methods to add to your application to allow you to have finite control over which elements of the page are displayed and to whom based on several different configurations. At present, m-Painter supports three such methods:

  • Conditional Visibility — Show/Hide elements based on other on-screen inputs
  • Control Access with Roles — Show/Hide elements based on the current user's menuing role
  • Control Access with User Privileges — Use table-driven logic to control which elements on the page will be shown/hidden

These features are only available within Bootstrap Templates. Some options may not always be available. For instance, "Conditional" Visibility" is only available when working with form input based templates.

Conditional Visibility

Available in maintenance applications where users enter data, this feature will allow you to conditionally show/hide elements on the page based on other values the user has entered. For this example, I am going to conditionally show the "State" input only when the user enters in the country name of USA. First open m-Painter and right click on the label "State".

Select "User Interface", then select "Edit Element."

The "Edit Element" window now shows you the label you selected. Since we want to hide the label and the input, click the "Move to Parent" option. This now shows the label and the input, but we want to move up one more level to select the entire row. Do so by clicking "Move to Parent" again.

Seeing that we have the proper element selected (see screenshot below), we can now click the "Conditional Visibility" button.

Use the dropdown list to control the field/input that is controlling the visibility. Then choose to enter information for either the hide or the show element. In my case, you can see that my selected element (the State row) will only display when the user enters a country value of USA.
Note: If you want to run tests off of a blank value, use the value of "BLANK" or "NOTBLANK".
When completed press OK to exit the "Visibility Control window" then pres OK again to exit out of the "Edit Element" window. Finally save your changes.

Below you can see the "before" and "after" of my change once I've entered in a country value of USA.
 

Control Access with Roles

Since most users utilize the built-in menuing system (along with sign-on security), m-Painter allows you to leverage those configurations to further control what options are shown/hidden on the page. For this example, we are going to conditionally hide the "Add New" button based on a user's role. There are two users, "hurckes" as a member of the "IT" group and a second user, "user1" who is a member of the "OTHER" group. More information about assigning users to roles can be found here.
Note: This feature requires that you have both your menuing and sign-on security enabled and configured.

Open m-Painter and right-click next to the "Add New Record" button. Select edit element

Your "Edit Element" dialog will look similar to this. If you scroll to the right, you'll see the "Add New Record" text.

Click the "Control Access with Roles" button.

You can select multiple roles. Whichever roles you select will be the only ones who will be able to view this element. When finished, press OK to exit the "Role Control" dialog and press OK again to exit the "Edit Element" dialog. Be sure to save.
Below you can see the difference of what the display looks like based on the logged in user.
 

Control Access with User Privileges

Developers who want more control of which users can have access to specific functionality will find the User Privileges feature beneficial. More information about configuring User Privileges can be found here. This section assumes you have already created the table, retrieval, and configured the mrc Signon configuration file.

This example will illustrate how to use User Privileges to hide/show an element (The add new record button) based on the current user privilege. First, open m-Painter and right click next to the element you wish to control.

An "Edit Element" dialog will appear. Be sure you've selected the proper element by using the parent/child navigation arrows. Once the proper one is selected, click the "Control Access with User Privileges" button.

Next, in the privilege name, enter the name of the column you are wishing to apply the privilege. This field must match a mapped field from your app listed in the mrc Signon Configuration file. Lastly, enter the Privilege value. At runtime, we will examine the user's record to see if the value listed in the field in question matches what is specified here. If it is a match, the element will be displayed. If it does not match, the selected element will be hidden.

When completed, press OK to exit the User Privilege window. You'll see the highlighted code has been added. Click OK to exit the Edit Element window. Finally, click save in m-Painter and run your application.

In my case, the first image is based on a matched User Privilege. The second image is an unmatched privilege.
 

Created: May 14, 2018 | Modified: November 17, 2023

Search


Browse By Category

Build Process (13)
Starting with m-Power (8)
Retrievals (10)
Reports (15)
Summaries (4)
Maintainers (17)
Graphs (8)
m-Power Data Explorer (4)
General (24)
Calculations (5)
Utilities (9)
m-Power Administration (23)
Security (11)
Freemarker (6)
m-Painter (29)
Form Validation (5)
External Objects & UDFs (12)
Deprecated Documentation (23)
Bootstrap Templates (7)

Popular Tags

Dropdowns Graph Properties Video Graphing Data Dictionary Excel Advanced Dates Database Bar Graphs Bootstrap Templates Calculations Maintainers Compiling mrc-Productivity Series SQL Record Selections Report Popular Graphs Java Retrievals External Objects Tomcat m-Painter Summaries Build Process Performance Maintainer Prompt Screens Administration Freemarker App Properties Security Parameters Retrieval Reports Email Form Validation Admin DB2 Getting Started RPG Application Properties Production

See all tags »

michaels, ross & cole, ltd. (mrc)

Privacy Policy Cookie Policy Cookie Settings Notice at Collection Do Not Sell or Share My Personal Information

mrc (US)

2001 Midwest Road
Suite 310
Oak Brook, IL 60523
630-916-0662

mrc (UK)

Mortlake Business Centre
20 Mortlake High Street
London, SW14 8JN
+44-20-335-59566


© 2024 mrc. All rights reserved.