Changes

Show/Hide Header

129 bytes added, 14:39, 25 September 2009
no edit summary
==Overview==
This is a new feature designed to support more dynamic pages by providing for control of the The visibility of [[Custom Fields|custom fields]] can be controlled through values that are entered elsewhere on the page.
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 fieldField]] that can contain contains a value such as a text box (:* [[Custom Field Type: Text – Single Line|single]] or * [[Custom Field Type: Text – Multiple Lines|multiple]] line), * [[Custom Field Type: Select One – Combo Box|Combo box - select one]], * [[Custom Field Type: Select Many – Check Boxes|Check boxes - select many]], * [[Custom Field Type: Special – Calculated Value|Calculated field]] or * [[Custom Field Type: Lookup – Entity and People]]* [[Custom Field Type: Lookup – External Entity]]* [[Custom Field Type: Lookup type field.– External People]]
The only field types that cannot be used are fields such as [[Custom Field Type: Special – Browser Script|browser script]], [[Custom Field Type: Display Only – Image|Image]] field, etc.
The controlled fields must all be placed under a '''Title Bar''' type field.
==ExampleSyntax==Place the following code in the '''HTML Tag''' box of the '''Control''' field:
Place the following code in the '''HTML Tag''' box of the '''Control:<font size="3">onchange="_showhideheader(xxxxxx,this.value=='Yes'' field: )"</font>
<pre>'''Where''':onchange="_showhideheader(* ''xxxxxx,this'' is the field ID of the [[Custom Field Type: Title Bar – Multiple Columns|Title Bar]] field that you wish to control.* ''Yes'' is the value==in the control field that you wish to use to trigger the display of '''Title''' '''Bar''' and the other '''Controlled''Yes')"</pre>fields in the block.
Where '''xxxxxx''' is the field ID of the '''Title Bar''' field that you wish to control.
Where '''YesExamples:''' is * Display the value in controlled fields when the control field that you wish to use to trigger the display of is '''Titlenot equal''' to Yes: onchange="_showhideheader(123456,this.value!='Yes''Bar''' and the other '''Controlled''' fields in the block.)"
'''More complex syntax can also be used:'''
<pre>* '''Multiple Conditions''' the control field is either Yes or Maybe: onchange="_showhideheader(123456,(this.value=='Yes' || this.value=='Maybe'))"
onchange="_showhideheader(xxxxxx,this.value!='Yes')"
* Display the controlled fields when the control field is not equal to Yes'''empty''': onchange="_showhideheader(123456,this.value==''")
onchange="_showhideheader(xxxxxx,(this.value=='Yes' || this.value=='Maybe'))"
*Display the controlled fields when the control field is either Yes or Maybe'''numerical''' (greater than 6): onchange="_showhideheader(123456, parseInt(this.value ) >6)"
onchange="_showhideheader(xxxxxx,this.value==''")
Display the controlled fields when the control field is empty==Multiple Headers=='''Multiple headers''' can be hidden/shown simultaneously::<font size="3">onchange="_showhideheader(xxxxxx,this.value='A') ;_showhideheader(yyyyyyy,this.value='B') " </font>
onchange="_showhideheader(This will display the controlled fields associated with '''Title Bar''' type field ID xxxxxx, parseInt(this when the control field has value '''A''' and display controlled fields associated with '''Title Bar''' type field ID yyyyyyy when the control field has value '''B'''.value ) >6)"
Display the controlled fields when the control field is greater than 6. </pre>
If there are a set of fields that are required to be displayed and others to be kept hidden based on values selected from combo box, following syntax may be used:
<pre>
onchange="_showhideheader(xxxxxx,this.value='A') ;_showhideheader(yyyyyyy,this.value='B') "
Display ==Check Boxes==When the controlled fields associated with '''Title BarControl''' type field ID xxxxxx when is a [[Custom Field Type: Select Many – Check Boxes|Select Many Check Box]], you will need to use the control field is A anddisplay controlled fields associated with '''Title Baronclick''' type field ID yyyyyyy when the control field is B</pre>syntax.
:<font size="3">onclick="_showhideheadercheckbox(xxxxxxx,this,'Yes;Cancel')"</font>
* Use '''onclick''' instead of '''onchange'''**Use'''this'''When the instead of '''Controlthis.value''' field is a * '''Select Many Check Box'Yes;Cancel'', you will need to use the onclick syntax. Please see the [[Show/Hide Fields Using a Check Box]] article.'' - values delimited by semi-colon
The difference between this feature and [[Custom Field Type: Dynamic Data – Dynamic Control Field|Dynamic Control]] field is that:
Unlike ==Notes==The difference between this feature and [[Custom Field Type: Dynamic Data – Dynamic Control Field|Dynamic Control Field]] is that:* The set of fields that you wish to control can be located anywhere on the page. With [[Custom Field Type: Dynamic Data – Dynamic Control Field|DynamicControl Fields]] the fields must be below the control field. * Unlike the [[Custom Field Type: Dynamic Data – Dynamic Control Field|custom fieldDynamic Control Field]], there are no fields "nested" within the control field and the set of .* The fields that you wish to hidden by one control can be located anywhere on used to as control fields themselves. Using nested [[Custom Field Type: Dynamic Data – Dynamic Control Field|Dynamic Control Fields]] (dynamic controls within dynamic controls) is not recommended, and you cannot report below the pagefirst level of nested fields.
Using nested [[Custom Field Type: Dynamic Data – Dynamic Control Field|Dynamic Control]] fields (dynamic controls within dynamic controls) you cannot report below the first level of nested fields.
==See Also==
0
edits