Difference between revisions of "Show/Hide Header"

From SmartWiki
Jump to: navigation, search
 
Line 5: Line 5:
 
The concept is that one [[Custom Fields|custom field]] - the "control field" - is used to control the display of a set of [[Custom Fields|custom fields]] based on a value entered or selected in the control field.
 
The concept is that one [[Custom Fields|custom field]] - the "control field" - is used to control the display of a set of [[Custom Fields|custom fields]] based on a value entered or selected in the control field.
  
The control field can be any type of [[Custom Fields|custom field]] that can contain a value such as a text box ([[single|Custom Field Type (30): Text – Single Line]] or [[multiple line|Custom Field Type (40): Text – Multiple Lines]]), [[Combo box - select one|Custom Field Type (10): Select One – Combo Box]], [[Check boxes - select many|Custom Field Type (20): Select Many – Check Boxes]], [[Calculated field|Custom Field Type (60): Special – Calculated Value]] or Lookup type field.
+
The control field can be any type of [[Custom Fields|custom field]] that can contain a value such as a text box ([[Custom Field Type (30): Text – Single Line|single|]] or [[multiple line|Custom Field Type (40): Text – Multiple Lines]]), [[Combo box - select one|Custom Field Type (10): Select One – Combo Box]], [[Check boxes - select many|Custom Field Type (20): Select Many – Check Boxes]], [[Calculated field|Custom Field Type (60): Special – Calculated Value]] or Lookup type field.
  
 
The only field types that cannot be used are fields such as [[browser script|Custom Field Type (103): Special – Browser Script]], [[Image|Custom Field Type (34): Display Only – Image]] field, etc.
 
The only field types that cannot be used are fields such as [[browser script|Custom Field Type (103): Special – Browser Script]], [[Image|Custom Field Type (34): Display Only – Image]] field, etc.

Revision as of 16:33, 5 November 2008

Overview

This is a new feature designed to support more dynamic pages by providing for control of the visibility of custom fields through values that are entered elsewhere on the page.

The concept is that one custom field - the "control field" - is used to control the display of a set of custom fields based on a value entered or selected in the control field.

The control field can be any type of custom field that can contain a value such as a text box (single| or Custom Field Type (40): Text – Multiple Lines), Custom Field Type (10): Select One – Combo Box, Custom Field Type (20): Select Many – Check Boxes, Custom Field Type (60): Special – Calculated Value or Lookup type field.

The only field types that cannot be used are fields such as Custom Field Type (103): Special – Browser Script, Custom Field Type (34): Display Only – Image field, etc.

The controlled fields must all be placed under a Title Bar type field.

Example

Place the following code in the HTML Tag box of the Control field:


onchange="_showhideheader(xxxxxx,this.value=='Yes')"

Where xxxxxx is the field ID of the Title Bar field that you wish to control.

Where Yes is the value in the control field that you wish to use to trigger the display of Title Bar and the other Controlled fields in the block.

More complex syntax can also be used:

onchange="_showhideheader(xxxxxx,this.value!='Yes')" - Display the controlled fields when the control field is not equal to Yes. onchange="_showhideheader(xxxxxx,(this.value=='Yes' || this.value=='Maybe'))" - Display the controlled fields when the control field is either Yes or Maybe. onchange="_showhideheader(xxxxxx,this.value==") - Display the controlled fields when the control field is empty. onchange="_showhideheader(xxxxxx, parseInt(this.value ) >6)" - Display the controlled fields when the control field is greater than 6.

The difference between this feature and Custom Field Type (87): Dynamic Data – Dynamic Control Field field is that:

Unlike the Custom Field Type (87): Dynamic Data – Dynamic Control Field custom field, there are no fields "nested" within the control field and the set of fields that you wish to control can be located anywhere on the page.

Using nested Custom Field Type (87): Dynamic Data – Dynamic Control Field fields (dynamic controls within dynamic controls) you cannot report below the first level of nested fields.