Edit Access for Selected Table Objects

When viewing objects within a table, the user can select which objects to edit. For example, if the user is viewing page 5 of a table and wants to edit only three of the objects on that page, the user can select those three and click Edit to view an editable table containing only those selected objects.

You can control the access of each cell or a complete row of the Table Edit page.

The following topics are discussed:

Row Edit Access by the objectList

You can control row edit access by the program JPO that is configured to fetch the list of objects for the table by adding a new key to each HashMap in the MapList given by the JPO program.

The new HashMaps of Maplist should contain:


  • id
  • id[connection]
  • RowEditable

The following table contains the list of keys with possible values:

Key Value

id

Objectid of the object

id[connection]

Relationship id of the object, if any

RowEditable

The value can be any of the following:

show--The row is editable and those columns with the setting "Editable = true" display as editable. This is the default value.?

hide--This row will not display in the TableEdit page (cannot be used with Structure Browser tables).

readonly--The row displays as read only (non-editable) even if the columns have the setting "Editable = true".

Sample Code

Here is the Sample Code used in one of the applications:

             MapList listBos = new MapList();
            listBos = connectedDoc.getRelatedObjects(context,  
RELATIONSHIP_CHARACTERISTIC,  characteristicType, busSelects, null, false,    true, 
(short) 1, null, null);
          String characLevel = "";   String characClaimed = "";
          if(listBos != null) {
            for(int i=0; i < listBos.size(); i++)  {
                  Map characMap = (Map)listBos.get(i);
                  characLevel = (String)characMap.get("attribute[" + attrLevel +"]");
                  characClaimed = (String)characMap.get("attribute[" + attrClaimed +"]");
                  if ("True".equalsIgnoreCase(isTemplate) && 
!characLevel.equals(templateLevel))  {
                       characMap.put("RowEditable","readonly");
             } else if ("False".equalsIgnoreCase(isTemplate) && 
"Yes".equalsIgnoreCase(characClaimed)) {
                       characMap.put("RowEditable","readonly");
              }
            }
         }
          return listBos;

Cell Edit Access

You can control the cell level edit access by setting "Edit Access Mask" on the table column. You can further filter the edit access to the cell level by using a filter access expression or by a filter access JPO defined on the access of the object's policy.

Column Setting Accepted Values

Edit Access Mask

Any access mask, for example, modify, connect

The system does the access check on all objects in one database call when it retrieves the column values. Cells that do not have the specified access display as read-only. For example, Specification Central's Micro Biological Characteristics type objects cannot be editable if the object's attribute Claimed value is Yes. You should also set the following:


  • For all the columns with Editable = true, set Row Edit Mask=modify
  • In the Characteristic policy for some users, establish a filter attribute[Claimed] ==Yes in all states
  • When the filter expression evaluates to true, then that user gets modify, read and show access in the appropriate states of the policy

The objects with the Claimed attribute set to Yes display as read-only in the TableEdit component.