Deactivating Table Inputs

rickj
2021-03-24
2021-03-24
  • rickj

    rickj - 2021-03-24

    I have implemented a visualization table containing references to configuration and tuneup parameters for my client. The visualization's user management consists of several login groups, only some of which are permitted to modify table values. I am able to implement this functionality minimally using the "Access Rights" property. When inputs are disallowed in this way, the table colors are modified as an indication.

    The problem is that there is no control over the color selection and the colors automatically selected are unattractive. As an alternative I attempted to place a semitransparent rectangle in front of the table that intercepts clicks (effectively disabling table input) while producing a more visually pleasing presentation. The problem with the alternative is that the "access Rights" mechanism will not allow this rectangle to be invisible for groups with higher permission and visible for groups having lower or no permissions.

    I have tried looking up the current sessions group name (as suggested in some example projects) but have come up with an empty wstring.

    I'm open to any suggestions such as ...
    1. How to modify disabled table colors?
    2. How to get the UserGroup name of the current session within the a screen context?
    3. How to make a rectangle visible when not logged in and invisible when logged in?
    4. Any other suggestions?

     
  • rickj

    rickj - 2021-03-24

    Ok, I've been able to make the code snippet below to work, to get the group name for each active session. However, how would an active screen determine in which session it is being displayed?

        VisuElems.g_ClientManager.BeginIteration();
        WHILE (VisuClient := VisuElems.g_ClientManager.GetNextClient()) <> 0 DO
            IF (VisuClient^.GlobalData.ClientType = VisuElems.Visu_ClientType.TargetVisualization)  THEN
                VisuElems.g_VisuManager.SetMainVisu(VisuClient,HomeScreen);
            END_IF
            CurrentUserGroupName[GroupCnt] := VisuClient^.GlobalData.CurrentUserGroupName;
            GroupCnt := GroupCnt+1;
        END_WHILE
    
     
  • m.prestel

    m.prestel - 2021-03-24

    There is a global variable CurrentUserGroupName available.
    Create a function and call it in the element.

    Best regards,
    Marcel

     
  • rickj

    rickj - 2021-03-24

    Marcel,

    Thank you so much! I have been wanting to know how to do this for almost a year. That is exactly what I was looking for. It works perfectly.

    Marcel, I owe you a big beer for this.

    Best Regards
    Rick

     

Log in to post a comment.