Wednesday, June 19, 2013

Columns should vary based on the folder path in Objeclist component

Root cause analysis:
When there is no column preference id defined in the customization, Webtop uses the default preference id i.e., application.display.classic_cabinets_columns to read and store the preferences. Once the columns are modified(added or removed) they are stored in application.display.classic_cabinets_columns. This is reference from all other folders as well. So the modification is applied to all the folders.

In order to fix the issue, we would recommend you to add the <columnpreferenceid> attribute specifying a unique id in the <component> tag. This can be applied to different folders to have different views. Below is an example:
<config version="1.0">
  <scope location="/System/D2">
    <component id="objectlist" extends="objectlist:webtop/config/objectlist_component.xml">
      <desc>
        Displays a list of objects of type dm_sysobject.
      </desc>
      <columns>
        <column>
          <attribute>object_name</attribute>
          <label>
            <nlsid>MSG_NAME</nlsid>
          </label>
          <visible>true</visible>
        </column>
        <column>
          <attribute>title</attribute>
          <label>
            <nlsid>MSG_ATTR_TITLE</nlsid>
          </label>
          <visible>false</visible>
        </column>
        <column>
          <attribute>authors</attribute>
          <label>
            <nlsid>MSG_AUTHORS</nlsid>
          </label>
          <visible>false</visible>
        </column>
        <column>
          <attribute>owner_name</attribute>
          <label>
            <nlsid>MSG_OWNER_NAME</nlsid>
          </label>
          <visible>false</visible>
        </column>
      </columns>
      <columnpreferenceid>application.display.objectlist_columns_d2</columnpreferenceid>
    </component>
  </scope>
  <scope location="/System/Applications">
    <component id="objectlist" extends="objectlist:webtop/config/objectlist_component.xml">
      <desc>
        Displays a list of objects of type dm_sysobject.
      </desc>
      <columns>
        <column>
          <attribute>object_name</attribute>
          <label>
            <nlsid>MSG_NAME</nlsid>
          </label>
          <visible>true</visible>
        </column>
        <column>
          <attribute>title</attribute>
          <label>
            <nlsid>MSG_ATTR_TITLE</nlsid>
          </label>
          <visible>false</visible>
        </column>
        <column>
          <attribute>authors</attribute>
          <label>
            <nlsid>MSG_AUTHORS</nlsid>
          </label>
          <visible>false</visible>
        </column>
        <column>
          <attribute>r_modify_date</attribute>
          <label>
            <nlsid>MSG_MODIFIED_DATE</nlsid>
          </label>
          <visible>true</visible>
        </column>
      </columns>
      <columnpreferenceid>application.display.objectlist_columns_applications</columnpreferenceid>
    </component>
  </scope>
</config>


No comments:

Post a Comment