Update iWidget attributes when refreshing iWidget definitions
In general, when you refresh an iWidget definition, the previous iWidget definition data stored in the portal model of the portal are replaced. The exception to this rule are iWidget attributes, that is items of the attributes item set, which are defined in the iWidget definition.There are two options to determine how the value of an item of the iWidget attributes item set is handled:
Conditional update of iWidget attributes
Use this option if you or users customized iWidget attributes in the portal model after you registered an iWidget in the portal and if you want to retain this customization across iWidget definition updates.
Replace of iWidget attributes
Use this option to handle iWidget attributes as any other iWidget definition data when you refresh an iWidget definition.
Both options are described in more detail in the following.
Conditional update of iWidget attributes
The default update behavior of values of iWidget attributes is determined by the readOnly attribute of the item given in the new iWidget definition. It indicates whether updating the iWidget definition overwrites an existing item value stored in the portlet preferences of the portlet definition that corresponds to the iWidget definition:readOnly="true"
This setting indicates that the new item value is set and overwrites a value that may have been stored in course of an earlier deployment of the iWidget definition.
readOnly="false"
This setting is the default. It indicates that the new item value is set only if the item value has not been defined in the previous version of the iWidget definition.
Unlike the iWidget model, this read only flag is bound to a value in the portal model. Therefore, if you set the readOnly attribute to true, but you do not specify a new item value, then the previous value is removed from the portal model and the read only flag is not persisted. To define a read only item, you need to provide a value; this can be an empty string.
The following table provides an overview of how values of iWidget attributes are updated when refreshing an iWidget definition stored in the portal:
Table 1. Update behavior of iWidget attributes when an iWidget definition is refreshed
Previous iWidget attribute: id="someAttribute"
New iWidget attribute: id="someNewAttribute"
Update result value: previousValue readOnly: true or false
value: newValue readOnly: true
value: newValue readOnly: true value: previousValue readOnly: true or false
value: newValue readOnly: false
value: previousValue readOnly: false value: previousValue readOnly: true or false
value: newValue readOnly: n/a
value: previousValue readOnly: false value: previousValue readOnly: true or false
value: n/a readOnly: true
value: n/a readOnly: n/a value: previousValue readOnly: true or false
value: n/a readOnly: false
value: previousValue readOnly: false value: previousValue readOnly: true or false
value: n/a readOnly: n/a
value: previousValue readOnly: false value: n/a readOnly: n/a
value: newValue readOnly: true
value: newValue readOnly: true value: n/a readOnly: n/a
value: newValue readOnly: false
value: newValue readOnly: false value: n/a readOnly: n/a
value: newValu readOnly: n/a
value: newValue readOnly: false
Note: Attributes defined on items of the attributes item set other than value are not affected by the refresh mechanism described in this section, that is, they are always set according to the new iWidget definition. For example, the read only attribute is updated regardless of changes to the value of the item.
Replace iWidget attributes
You can overrule the mechanism described above by setting a special portlet preference on the portlet definition of the IWidgetWrapper portlet corresponding to the iWidget definition:com.ibm.portal.replace.attributes = true | false
Set the value of this preference to true results in the deletion of all portlet preferences related to the previously deployed iWidget definition, including the ones iWidget attributes upon updating the iWidget definition. The default settings is false .
Parent
Use widgetsRelated
How iWidgets are represented in the portal model
Previous
Register iWidgets for use with the Page Builder theme
December 14, 2011
Apr 1, 2011 1:26:17 PM
});