Crestron Components Lib - Showcase App

ch5-tab-button: contractName

contractName attribute:


contractName attribute allows a developer to bind event clicks based on a contract. The value is referred to, and each tabs is assigned with an incremental digit based on the initial value passed as attribute value.


NOTE: The Showcase app is not capable of testing with this attribute. Please check this attribute with Contract enabled control system.


<ch5-tab-button
        indexId="idx"
        contractName="LivingRoom.AppleTV"
        buttonReceiveStateShow="btn{{idx}}Show"
        buttonReceiveStateEnable="btn{{idx}}Enable"
        receiveStateEnable="tabBtnEnable"
        receiveStateShow="tabBtnShow"
        receiveStateCustomStyle="tabBtnCustomStyle"
        receiveStateCustomClass="tabBtnCustomClass" >
</ch5-tab-button>


If the initial value of contractName is assigned as "LivingRoom.AppleTV" (digitals), the events are bound as below:


Use Contract Use ContractValue Contract Value Attribute Example Example
useContractForEachButtonSelection TRUE TabSelected receiveStateSelectedButton LivingRoom.AppleTV.TabSelected
useContractForEachButtonSelection FALSE Tab[X]_Selected buttonReceiveStateSelected Button1: LivingRoom.AppleTV.Tab1_Selected
Button2: LivingRoom.AppleTV.Tab2_Selected
Button3: LivingRoom.AppleTV.Tab3_Selected
TabPress Tab[X]_Press Button1: LivingRoom.AppleTV.Tab1_Press
Button2: LivingRoom.AppleTV.Tab2_Press
Button3: LivingRoom.AppleTV.Tab3_Press
useContractForCustomClass TRUE CustomClass receiveStateCustomClass LivingRoom.AppleTv.CustomClass
useContractForCustomClass FALSE receiveStateCustomClass tabBtnCustomClass
useContractForCustomStyle TRUE CustomStyle receiveStateCustomStyle LivingRoom.AppleTv.CustomStyle
useContractForCustomStyle FALSE receiveStateCustomStyle tabBtnCustomStyle
useContractForEnable TRUE Enable receiveStateEnable LivingRoom.AppleTv.Enable
useContractForEnable FALSE receiveStateEnable tabBtnEnable
useContractForShow TRUE Visible receiveStateShow LivingRoom.AppleTv.Visible
useContractForShow FALSE receiveStateShow tabBtnShow

For the below Example receiveStateSelected and ItemPress for all the individual buttons is set by default.

<p>As Tab is pressed by user, Tab[X] will become true and send signal.<br/>NOTE: Repeat digital is not supported when Tab[x]_Press signal is sent.</p>
<ch5-tab-button 
	 contractName="House"
	 indexId="idx"
	 buttonType="info">
	 <ch5-tab-button-label>
			<template>
				 {{idx}}
			</template>
	 </ch5-tab-button-label>
</ch5-tab-button>

As Tab is pressed by user, Tab[X] will become true and send signal.
NOTE: Repeat digital is not supported when Tab[x]_Press signal is sent.

useContractForCustomClass attribute:

Possible values are true, false

The default value is false.

If this value is set to true then the value received from the contract will be considered to the customclass attribute on the `ch5-tab-button` tag and The contractName attribute's default value is empty, making the default value for useContractForCustomClass as false

<p>The class list for the ch5-tab-button will be appended with the Join value associated with control system state name of "My.Contract.Prefix.CustomClass" and the customclass attribute of "blue-dashed-border" should be ignored</p>
<ch5-tab-button 
	 indexId="idx"
	 buttonType="info"
	 show="true" 
	 customclass="blue-dashed-border" 
	 useContractForCustomClass="true" 
	 contractName="My.Contract.Prefix"
	 useContractForEnable="true">
	 <ch5-tab-button-label>
			<template>
				 {{idx}}
			</template>
	 </ch5-tab-button-label>
</ch5-tab-button>

The class list for the ch5-tab-button will be appended with the Join value associated with control system state name of "My.Contract.Prefix.CustomClass" and the customclass attribute of "blue-dashed-border" should be ignored

useContractForEachButtonSelection attribute

The default value is false.
If the value is true then the selected state of the buttons is taken from the contractName.TabSelected else from contractName.Tab[X]_Selected.

	<ch5-tab-button
		indexId="idx"
		buttonType="info"
		numberOfItems="4"
		contractName=""
		useContractForEachButtonSelection="false">
		<ch5-tab-button-label>
			<template>
				{{idx}}
			</template>
		</ch5-tab-button-label>
	</ch5-tab-button>

useContractForCustomStyle attribute:

Possible values are true, false

The default value is false.

If this value is set to true then the value received from the contract will be considered to the customstyle attribute on the `ch5-tab-button` tag. The contractName attribute's default value is empty, making the default value for useContractForCustomStyle as false

<p>The class list for the ch5-tab-button will be appended with the Join value associated with control system state name of "My.Contract.Prefix.CustomStyle" and the customstyle attribute should be ignored.</p>

<ch5-tab-button 
	 indexId="idx"
	 buttonType="info"
	 show="true" 
	 customstyle="border: 3px dashed blue" 
	 useContractForCustomStyle="true" 
	 contractName="My.Contract.Prefix">
	 <ch5-tab-button-label>
			<template>
				 {{idx}}
			</template>
	 </ch5-tab-button-label>
</ch5-tab-button>  

The class list for the ch5-tab-button will be appended with the Join value associated with control system state name of "My.Contract.Prefix.CustomStyle" and the customstyle attribute should be ignored.

useContractForEnable attribute:

Possible values are true, false

The default value is false.

If this value is set to true then the value received from the contract will be considered to enable `ch5-tab-button`. The contractName attribute's default value is empty, making the default value for useContractForEnable as false

<ch5-tab-button 
	 indexId="idx"
	 buttonType="info"
	 numberOfItems="4"
	 contractName="House"
	 useContractForEnable="true">
	 <ch5-tab-button-label>
			<template>
				 {{idx}}
			</template>
	 </ch5-tab-button-label>
</ch5-tab-button>

useContractForShow attribute:

Possible values are true, false

The default value is false.

If this value is set to true then the value received from the contract will be considered to show / hide `ch5-tab-button` tag.The contractName attribute's default value is empty, making the default value for useContractForShow as false

<ch5-tab-button 
	 indexId="idx"
	 buttonType="info"
	 numberOfItems="4"
	 contractName=""
	 useContractForShow="true">
	 <ch5-tab-button-label>
			<template>
				 {{idx}}
			</template>
	 </ch5-tab-button-label>
</ch5-tab-button>