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

Replace of iWidget attributes

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"

readOnly="false"

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


Parent

Use widgets

Related

How iWidgets are represented in the portal model


Previous

Register iWidgets for use with the Page Builder theme

Reusing registered iWidgets

Customize iWidget attributes

Modify portlet settings

December 14, 2011
   

 

Apr 1, 2011 1:26:17 PM

});


+

Search Tips   |   Advanced Search