Absolute positioning allows you to precisely place items by setting their x and y coordinates in pixels. Each absolutely positioned item contains its own location and extent information and is therefore independent of other items on the form. On the other hand, items with relative positioning are positioned in relation to other items on the form. Their itemlocation information is dependent upon an anchor item. If you move the anchor item, all of its dependent items move to maintain their positions relative to the anchor item.
Absolute positioning is preferred because relative positioning affects more than the location of items. Relative positioning can also affect the alignment and size of items. Any adjustments to the location or size of an anchor item could potentially affect numerous other items. Additionally, to secure the itemlocation of a relatively positioned item, you must sign the positioning of the anchor item.
Using absolute positioning guarantees that the location and extent of items are not reliant on other items. Each item contains its own itemlocation information, making signature filtering easier and more precise. Therefore, forms with absolute positioning are more difficult to compromise.
An item’s own itemlocation code is the only factor in determining its absolute positioning. On the other hand, the same item positioned relatively could depend on several other anchor items, which in turn could be dependent on still other items. Displacement of a single anchor item could result in a domino effect of misplaced and mis-sized items.
Example
The following code samples compare the itemlocation information of an identical button. The first sample uses relative positioning, while the second uses absolute positioning.
<button sid="BUTTON1">
<value>Print</value>
<itemlocation>
<after>LABEL1</after>
<expandl2c>BUTTON3</expandl2c>
<offsetx>-94</offsetx>
<offsety>70</offsety>
</itemlocation>
<button>
|
Relative positioning depends upon a number of variables. Items may even be anchored to more than one anchor item. For example, LABEL1 and BUTTON3
|
<button sid="BUTTON1">
<value>Print</value>
<itemlocation>
<x>200 </x>
<y>200 </y>
<width>130</width>
<height>22</height>
</itemlocation>
</button>
|
Absolute positioned items contain all of their own itemlocation information.
|
Exceptions to this practice
If you are transferring form information from a database table with an indefinite number of rows, you must use relative positioning. Moreover, some forms have dynamically created sections, such as a purchase order form that allows users to add multiple rows. In such cases, you must use relative positioning.